Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5779673

Browse files
[DI] reorder ExtensionCompilerPass
1 parent 2e1a0ea commit 5779673

File tree

4 files changed

+2
-18
lines changed

4 files changed

+2
-18
lines changed

src/Symfony/Component/DependencyInjection/Compiler/ExtensionCompilerPass.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,5 @@ public function process(ContainerBuilder $container)
3333

3434
$extension->process($container);
3535
}
36-
37-
if ($container->getKernelPass()) {
38-
$container->getKernelPass()->process($container);
39-
}
4036
}
4137
}

src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public function __construct()
4545
new ResolveInstanceofConditionalsPass(),
4646
new RegisterEnvVarProcessorsPass(),
4747
),
48+
-100 => array(new ExtensionCompilerPass()),
4849
);
4950

5051
$this->optimizationPasses = array(array(
51-
new ExtensionCompilerPass(),
5252
new ResolveChildDefinitionsPass(),
5353
new ServiceLocatorTagPass(),
5454
new DecoratorServicePass(),

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
121121

122122
private $autoconfiguredInstanceof = array();
123123

124-
private $kernelPass;
125-
126124
public function __construct(ParameterBagInterface $parameterBag = null)
127125
{
128126
parent::__construct($parameterBag);
@@ -703,16 +701,6 @@ public function prependExtensionConfig($name, array $config)
703701
array_unshift($this->extensionConfigs[$name], $config);
704702
}
705703

706-
public function setKernelPass(CompilerPassInterface $kernelPass)
707-
{
708-
$this->kernelPass = $kernelPass;
709-
}
710-
711-
public function getKernelPass()
712-
{
713-
return $this->kernelPass;
714-
}
715-
716704
/**
717705
* Compiles the container.
718706
*

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ protected function getContainerBuilder()
769769
$container->getParameterBag()->add($this->getKernelParameters());
770770

771771
if ($this instanceof CompilerPassInterface) {
772-
$container->setKernelPass($this);
772+
$container->addCompilerPass($this, PassConfig::TYPE_BEFORE_OPTIMIZATION, -1000);
773773
}
774774
if (class_exists('ProxyManager\Configuration') && class_exists('Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator')) {
775775
$container->setProxyInstantiator(new RuntimeInstantiator());

0 commit comments

Comments
 (0)