Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

AuthenticationProviderPass.php

Namespace

Drupal\Core\DependencyInjection\Compiler

File

core/lib/Drupal/Core/DependencyInjection/Compiler/AuthenticationProviderPass.php

View source
<?php

namespace Drupal\Core\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
 * Registers the authentication_providers container parameter.
 */
class AuthenticationProviderPass implements CompilerPassInterface {
    
    /**
     * {@inheritdoc}
     */
    public function process(ContainerBuilder $container) : void {
        $authentication_providers = [];
        foreach ($container->findTaggedServiceIds('authentication_provider') as $service_id => $attributes) {
            $authentication_provider = $attributes[0]['provider_id'];
            if ($provider_tag = $container->getDefinition($service_id)
                ->getTag('_provider')) {
                $authentication_providers[$authentication_provider] = $provider_tag[0]['provider'];
            }
        }
        $container->setParameter('authentication_providers', $authentication_providers);
    }

}

Classes

Title Deprecated Summary
AuthenticationProviderPass Registers the authentication_providers container parameter.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal