CoreFiles by mySites.guru
AddValidatorInitializersPass.php40 lines, 1,171 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
043d8acfa48df32dcf3ec99c04170732
sha1
a41071ba216a3d88ebe568572198299f5cb2b8b5
sha256
bfc709559e91438a97ce407be44a7c00585d28586490ea3c3964d500ee2d66c6
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Validator\DependencyInjection;

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

/**
 * @author Fabien Potencier <[email protected]>
 * @author Robin Chalas <[email protected]>
 */
class AddValidatorInitializersPass implements CompilerPassInterface
{
    /**
     * @return void
     */
    public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('validator.builder')) {
            return;
        }

        $initializers = [];
        foreach ($container->findTaggedServiceIds('validator.initializer', true) as $id => $attributes) {
            $initializers[] = new Reference($id);
        }

        $container->getDefinition('validator.builder')->addMethodCall('addObjectInitializers', [$initializers]);
    }
}

The same content is in 133 releases, Joomla 5.1.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.