Upgrade framework
This commit is contained in:
@@ -11,9 +11,10 @@
|
||||
|
||||
namespace Symfony\Component\Routing\DependencyInjection;
|
||||
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
/**
|
||||
* Adds tagged routing.loader services to routing.resolver service.
|
||||
@@ -22,25 +23,18 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
*/
|
||||
class RoutingResolverPass implements CompilerPassInterface
|
||||
{
|
||||
private $resolverServiceId;
|
||||
private $loaderTag;
|
||||
|
||||
public function __construct($resolverServiceId = 'routing.resolver', $loaderTag = 'routing.loader')
|
||||
{
|
||||
$this->resolverServiceId = $resolverServiceId;
|
||||
$this->loaderTag = $loaderTag;
|
||||
}
|
||||
use PriorityTaggedServiceTrait;
|
||||
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
if (false === $container->hasDefinition($this->resolverServiceId)) {
|
||||
if (false === $container->hasDefinition('routing.resolver')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$definition = $container->getDefinition($this->resolverServiceId);
|
||||
$definition = $container->getDefinition('routing.resolver');
|
||||
|
||||
foreach ($container->findTaggedServiceIds($this->loaderTag, true) as $id => $attributes) {
|
||||
$definition->addMethodCall('addLoader', array(new Reference($id)));
|
||||
foreach ($this->findAndSortTaggedServices('routing.loader', $container) as $id) {
|
||||
$definition->addMethodCall('addLoader', [new Reference($id)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user