RegisterAuthenticationsCompilerPass.php 909 Bytes
Newer Older
1 2
<?php
/**
3
 * Copyright (c) by the ACP3 Developers.
4
 * See the LICENSE file at the top-level module directory for licencing details.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
 */

namespace ACP3\Core\Authentication\DependencyInjection;


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

class RegisterAuthenticationsCompilerPass implements CompilerPassInterface
{

    /**
     * @inheritdoc
     */
    public function process(ContainerBuilder $container)
    {
        $definition = $container->findDefinition('core.authentication.authentication_registrar');

        foreach ($container->findTaggedServiceIds('core.authentication') as $serviceId => $tags) {
            $definition->addMethodCall(
                'set',
                [$serviceId, new Reference($serviceId)]
            );
        }
    }
}