Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / lib / Drupal / Core / DependencyInjection / Compiler / AuthenticationProviderPass.php
1 <?php
2
3 namespace Drupal\Core\DependencyInjection\Compiler;
4
5 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6 use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8 /**
9  * Registers the authentication_providers container parameter.
10  */
11 class AuthenticationProviderPass implements CompilerPassInterface {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function process(ContainerBuilder $container) {
17     $authentication_providers = [];
18     foreach ($container->findTaggedServiceIds('authentication_provider') as $service_id => $attributes) {
19       $authentication_provider = $attributes[0]['provider_id'];
20       if ($provider_tag = $container->getDefinition($service_id)->getTag('_provider')) {
21         $authentication_providers[$authentication_provider] = $provider_tag[0]['provider'];
22       }
23     }
24     $container->setParameter('authentication_providers', $authentication_providers);
25   }
26
27 }