Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 388e4b3

Browse filesBrowse files
[DI] Make tagged abstract services throw earlier
1 parent cd06c12 commit 388e4b3
Copy full SHA for 388e4b3

File tree

27 files changed

+94
-79
lines changed
Filter options

27 files changed

+94
-79
lines changed

‎src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php
+2-10Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public function process(ContainerBuilder $container)
5555
return;
5656
}
5757

58-
$taggedSubscribers = $container->findTaggedServiceIds($this->tagPrefix.'.event_subscriber');
59-
$taggedListeners = $container->findTaggedServiceIds($this->tagPrefix.'.event_listener');
58+
$taggedSubscribers = $container->findTaggedServiceIds($this->tagPrefix.'.event_subscriber', true);
59+
$taggedListeners = $container->findTaggedServiceIds($this->tagPrefix.'.event_listener', true);
6060

6161
if (empty($taggedSubscribers) && empty($taggedListeners)) {
6262
return;
@@ -78,10 +78,6 @@ public function process(ContainerBuilder $container)
7878

7979
uasort($subscribers, $sortFunc);
8080
foreach ($subscribers as $id => $instance) {
81-
if ($container->getDefinition($id)->isAbstract()) {
82-
throw new InvalidArgumentException(sprintf('The abstract service "%s" cannot be tagged as a doctrine event subscriber.', $id));
83-
}
84-
8581
$em->addMethodCall('addEventSubscriber', array(new Reference($id)));
8682
}
8783
}
@@ -94,10 +90,6 @@ public function process(ContainerBuilder $container)
9490

9591
uasort($listeners, $sortFunc);
9692
foreach ($listeners as $id => $instance) {
97-
if ($container->getDefinition($id)->isAbstract()) {
98-
throw new InvalidArgumentException(sprintf('The abstract service "%s" cannot be tagged as a doctrine event listener.', $id));
99-
}
100-
10193
$em->addMethodCall('addEventListener', array(
10294
array_unique($instance['event']),
10395
isset($instance['lazy']) && $instance['lazy'] ? $id : new Reference($id),

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddCacheClearerPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function process(ContainerBuilder $container)
3232
}
3333

3434
$clearers = array();
35-
foreach ($container->findTaggedServiceIds('kernel.cache_clearer') as $id => $attributes) {
35+
foreach ($container->findTaggedServiceIds('kernel.cache_clearer', true) as $id => $attributes) {
3636
$clearers[] = new Reference($id);
3737
}
3838

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ public function process(ContainerBuilder $container)
3030
// routing
3131
if ($container->has('router')) {
3232
$definition = $container->findDefinition('router');
33-
foreach ($container->findTaggedServiceIds('routing.expression_language_provider') as $id => $attributes) {
33+
foreach ($container->findTaggedServiceIds('routing.expression_language_provider', true) as $id => $attributes) {
3434
$definition->addMethodCall('addExpressionLanguageProvider', array(new Reference($id)));
3535
}
3636
}
3737

3838
// security
3939
if ($container->has('security.access.expression_voter')) {
4040
$definition = $container->findDefinition('security.access.expression_voter');
41-
foreach ($container->findTaggedServiceIds('security.expression_language_provider') as $id => $attributes) {
41+
foreach ($container->findTaggedServiceIds('security.expression_language_provider', true) as $id => $attributes) {
4242
$definition->addMethodCall('addExpressionLanguageProvider', array(new Reference($id)));
4343
}
4444
}

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function process(ContainerBuilder $container)
3333

3434
$collectors = new \SplPriorityQueue();
3535
$order = PHP_INT_MAX;
36-
foreach ($container->findTaggedServiceIds('data_collector') as $id => $attributes) {
36+
foreach ($container->findTaggedServiceIds('data_collector', true) as $id => $attributes) {
3737
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
3838
$template = null;
3939

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function process(ContainerBuilder $container)
3232

3333
if ($container->hasDefinition('templating.engine.php')) {
3434
$helpers = array();
35-
foreach ($container->findTaggedServiceIds('templating.helper') as $id => $attributes) {
35+
foreach ($container->findTaggedServiceIds('templating.helper', true) as $id => $attributes) {
3636
if (isset($attributes[0]['alias'])) {
3737
$helpers[$attributes[0]['alias']] = $id;
3838
}

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationDumperPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationDumperPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function process(ContainerBuilder $container)
2828

2929
$definition = $container->getDefinition('translation.writer');
3030

31-
foreach ($container->findTaggedServiceIds('translation.dumper') as $id => $attributes) {
31+
foreach ($container->findTaggedServiceIds('translation.dumper', true) as $id => $attributes) {
3232
$definition->addMethodCall('addDumper', array($attributes[0]['alias'], new Reference($id)));
3333
}
3434
}

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationExtractorPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationExtractorPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function process(ContainerBuilder $container)
2929

3030
$definition = $container->getDefinition('translation.extractor');
3131

32-
foreach ($container->findTaggedServiceIds('translation.extractor') as $id => $attributes) {
32+
foreach ($container->findTaggedServiceIds('translation.extractor', true) as $id => $attributes) {
3333
if (!isset($attributes[0]['alias'])) {
3434
throw new RuntimeException(sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id));
3535
}

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslatorPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslatorPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function process(ContainerBuilder $container)
2626

2727
$loaders = array();
2828
$loaderRefs = array();
29-
foreach ($container->findTaggedServiceIds('translation.loader') as $id => $attributes) {
29+
foreach ($container->findTaggedServiceIds('translation.loader', true) as $id => $attributes) {
3030
$loaderRefs[$id] = new Reference($id);
3131
$loaders[$id][] = $attributes[0]['alias'];
3232
if (isset($attributes[0]['legacy-alias'])) {

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ValidateWorkflowsPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ValidateWorkflowsPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ValidateWorkflowsPass implements CompilerPassInterface
2525
{
2626
public function process(ContainerBuilder $container)
2727
{
28-
$taggedServices = $container->findTaggedServiceIds('workflow.definition');
28+
$taggedServices = $container->findTaggedServiceIds('workflow.definition', true);
2929
foreach ($taggedServices as $id => $tags) {
3030
$definition = $container->get($id);
3131
foreach ($tags as $tag) {

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConstraintValidatorsPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConstraintValidatorsPassTest.php
+18-3Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ public function testThatConstraintValidatorServicesAreProcessed()
3434
->addTag('validator.constraint_validator', array('alias' => 'my_constraint_validator_alias1'));
3535
$container->register('my_constraint_validator_service2', Validator2::class)
3636
->addTag('validator.constraint_validator');
37-
$container->register('my_abstract_constraint_validator')
38-
->setAbstract(true)
39-
->addTag('validator.constraint_validator');
4037

4138
$addConstraintValidatorsPass = new AddConstraintValidatorsPass();
4239
$addConstraintValidatorsPass->process($container);
@@ -49,6 +46,24 @@ public function testThatConstraintValidatorServicesAreProcessed()
4946
$this->assertEquals($expected, $container->getDefinition((string) $validatorFactory->getArgument(0)));
5047
}
5148

49+
/**
50+
* @expectedException \InvalidArgumentException
51+
* @expectedExceptionMessage The service "my_abstract_constraint_validator" tagged "validator.constraint_validator" must not be abstract.
52+
*/
53+
public function testAbstractConstraintValidator()
54+
{
55+
$container = new ContainerBuilder();
56+
$validatorFactory = $container->register('validator.validator_factory')
57+
->addArgument(array());
58+
59+
$container->register('my_abstract_constraint_validator')
60+
->setAbstract(true)
61+
->addTag('validator.constraint_validator');
62+
63+
$addConstraintValidatorsPass = new AddConstraintValidatorsPass();
64+
$addConstraintValidatorsPass->process($container);
65+
}
66+
5267
public function testThatCompilerPassIsIgnoredIfThereIsNoConstraintValidatorFactoryDefinition()
5368
{
5469
$definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/RuntimeLoaderPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/RuntimeLoaderPass.php
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,8 @@ public function process(ContainerBuilder $container)
2929

3030
$definition = $container->getDefinition('twig.runtime_loader');
3131
$mapping = array();
32-
foreach ($container->findTaggedServiceIds('twig.runtime') as $id => $attributes) {
32+
foreach ($container->findTaggedServiceIds('twig.runtime', true) as $id => $attributes) {
3333
$def = $container->getDefinition($id);
34-
35-
if ($def->isAbstract()) {
36-
continue;
37-
}
38-
3934
$mapping[$def->getClass()] = new Reference($id);
4035
}
4136

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function process(ContainerBuilder $container)
3636
// be registered.
3737
$calls = $definition->getMethodCalls();
3838
$definition->setMethodCalls(array());
39-
foreach ($container->findTaggedServiceIds('twig.extension') as $id => $attributes) {
39+
foreach ($container->findTaggedServiceIds('twig.extension', true) as $id => $attributes) {
4040
$definition->addMethodCall('addExtension', array(new Reference($id)));
4141
}
4242
$definition->setMethodCalls(array_merge($definition->getMethodCalls(), $calls));

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function process(ContainerBuilder $container)
3232
$prioritizedLoaders = array();
3333
$found = 0;
3434

35-
foreach ($container->findTaggedServiceIds('twig.loader') as $id => $attributes) {
35+
foreach ($container->findTaggedServiceIds('twig.loader', true) as $id => $attributes) {
3636
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
3737
$prioritizedLoaders[$priority][] = $id;
3838
++$found;

‎src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,11 @@ class AddConsoleCommandPass implements CompilerPassInterface
2525
{
2626
public function process(ContainerBuilder $container)
2727
{
28-
$commandServices = $container->findTaggedServiceIds('console.command');
28+
$commandServices = $container->findTaggedServiceIds('console.command', true);
2929
$serviceIds = array();
3030

3131
foreach ($commandServices as $id => $tags) {
3232
$definition = $container->getDefinition($id);
33-
34-
if ($definition->isAbstract()) {
35-
throw new \InvalidArgumentException(sprintf('The service "%s" tagged "console.command" must not be abstract.', $id));
36-
}
37-
3833
$class = $container->getParameterBag()->resolveValue($definition->getClass());
3934

4035
if (!$r = $container->getReflectionClass($class)) {

‎src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/PriorityTaggedServiceTrait.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private function findAndSortTaggedServices($tagName, ContainerBuilder $container
4040
{
4141
$services = array();
4242

43-
foreach ($container->findTaggedServiceIds($tagName) as $serviceId => $attributes) {
43+
foreach ($container->findTaggedServiceIds($tagName, true) as $serviceId => $attributes) {
4444
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
4545
$services[$priority][] = new Reference($serviceId);
4646
}

‎src/Symfony/Component/DependencyInjection/Compiler/ResolveTagsInheritancePass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/ResolveTagsInheritancePass.php
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Compiler;
1313

1414
use Symfony\Component\DependencyInjection\ChildDefinition;
15+
use Symfony\Component\DependencyInjection\ContainerBuilder;
1516
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
1617

1718
/**
@@ -21,6 +22,24 @@
2122
*/
2223
class ResolveTagsInheritancePass extends AbstractRecursivePass
2324
{
25+
private $abstractInheritedParents = array();
26+
27+
/**
28+
* {@inheritdoc}
29+
*/
30+
public function process(ContainerBuilder $container)
31+
{
32+
try {
33+
parent::process($container);
34+
35+
foreach ($this->abstractInheritedParents as $id) {
36+
$container->findDefinition($id)->setTags(array());
37+
}
38+
} finally {
39+
$this->abstractInheritedParents = array();
40+
}
41+
}
42+
2443
/**
2544
* {@inheritdoc}
2645
*/
@@ -36,6 +55,9 @@ protected function processValue($value, $isRoot = false)
3655
}
3756

3857
$parentDef = $this->container->findDefinition($parent);
58+
if ($parentDef->isAbstract()) {
59+
$this->abstractInheritedParents[$parent] = $parent;
60+
}
3961

4062
if ($parentDef instanceof ChildDefinition) {
4163
$this->processValue($parentDef);

‎src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,16 +1200,20 @@ public function resolveServices($value)
12001200
* }
12011201
* }
12021202
*
1203-
* @param string $name The tag name
1203+
* @param string $name
1204+
* @param bool $throwOnAbstract
12041205
*
12051206
* @return array An array of tags with the tagged service as key, holding a list of attribute arrays
12061207
*/
1207-
public function findTaggedServiceIds($name)
1208+
public function findTaggedServiceIds($name, $throwOnAbstract = false)
12081209
{
12091210
$this->usedTags[] = $name;
12101211
$tags = array();
12111212
foreach ($this->getDefinitions() as $id => $definition) {
12121213
if ($definition->hasTag($name)) {
1214+
if ($throwOnAbstract && $definition->isAbstract()) {
1215+
throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must not be abstract.', $id, $name));
1216+
}
12131217
$tags[$id] = $definition->getTag($name);
12141218
}
12151219
}

‎src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveTagsInheritancePassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveTagsInheritancePassTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ public function testProcess()
2222
{
2323
$container = new ContainerBuilder();
2424
$container->register('grandpa', self::class)->addTag('g');
25-
$container->setDefinition('parent', new ChildDefinition('grandpa'))->addTag('p')->setInheritTags(true);
25+
$container->setDefinition('parent', new ChildDefinition('grandpa'))->addTag('p')->setInheritTags(true)->setAbstract(true);
2626
$container->setDefinition('child', new ChildDefinition('parent'))->setInheritTags(true);
2727

2828
(new ResolveTagsInheritancePass())->process($container);
2929

3030
$expected = array('p' => array(array()), 'g' => array(array()));
31-
$this->assertSame($expected, $container->getDefinition('parent')->getTags());
3231
$this->assertSame($expected, $container->getDefinition('child')->getTags());
32+
$this->assertSame(array(), $container->getDefinition('parent')->getTags());
3333
}
3434
}

‎src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php
+2-8Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,8 @@ public function process(ContainerBuilder $container)
6060

6161
$definition = $container->findDefinition($this->dispatcherService);
6262

63-
foreach ($container->findTaggedServiceIds($this->listenerTag) as $id => $events) {
63+
foreach ($container->findTaggedServiceIds($this->listenerTag, true) as $id => $events) {
6464
$def = $container->getDefinition($id);
65-
if ($def->isAbstract()) {
66-
throw new InvalidArgumentException(sprintf('The service "%s" must not be abstract as event listeners are lazy-loaded.', $id));
67-
}
6865

6966
foreach ($events as $event) {
7067
$priority = isset($event['priority']) ? $event['priority'] : 0;
@@ -87,11 +84,8 @@ public function process(ContainerBuilder $container)
8784

8885
$extractingDispatcher = new ExtractingEventDispatcher();
8986

90-
foreach ($container->findTaggedServiceIds($this->subscriberTag) as $id => $attributes) {
87+
foreach ($container->findTaggedServiceIds($this->subscriberTag, true) as $id => $attributes) {
9188
$def = $container->getDefinition($id);
92-
if ($def->isAbstract()) {
93-
throw new InvalidArgumentException(sprintf('The service "%s" must not be abstract as event subscribers are lazy-loaded.', $id));
94-
}
9589

9690
// We must assume that the class value has been correctly filled, even if the service is created by a factory
9791
$class = $container->getParameterBag()->resolveValue($def->getClass());

‎src/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testValidEventSubscriber()
8989

9090
/**
9191
* @expectedException \InvalidArgumentException
92-
* @expectedExceptionMessage The service "foo" must not be abstract as event listeners are lazy-loaded.
92+
* @expectedExceptionMessage The service "foo" tagged "kernel.event_listener" must not be abstract.
9393
*/
9494
public function testAbstractEventListener()
9595
{
@@ -103,7 +103,7 @@ public function testAbstractEventListener()
103103

104104
/**
105105
* @expectedException \InvalidArgumentException
106-
* @expectedExceptionMessage The service "foo" must not be abstract as event subscribers are lazy-loaded.
106+
* @expectedExceptionMessage The service "foo" tagged "kernel.event_subscriber" must not be abstract.
107107
*/
108108
public function testAbstractEventSubscriber()
109109
{

‎src/Symfony/Component/Form/DependencyInjection/FormPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/DependencyInjection/FormPass.php
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ private function processFormTypes(ContainerBuilder $container, Definition $defin
6161
$servicesMap = array();
6262

6363
// Builds an array with fully-qualified type class names as keys and service IDs as values
64-
foreach ($container->findTaggedServiceIds($this->formTypeTag) as $serviceId => $tag) {
65-
$serviceDefinition = $container->getDefinition($serviceId);
66-
64+
foreach ($container->findTaggedServiceIds($this->formTypeTag, true) as $serviceId => $tag) {
6765
// Add form type service to the service locator
66+
$serviceDefinition = $container->getDefinition($serviceId);
6867
$servicesMap[$serviceDefinition->getClass()] = new Reference($serviceId);
6968
}
7069

@@ -98,7 +97,7 @@ private function processFormTypeExtensions(ContainerBuilder $container)
9897
private function processFormTypeGuessers(ContainerBuilder $container)
9998
{
10099
$guessers = array();
101-
foreach ($container->findTaggedServiceIds($this->formTypeGuesserTag) as $serviceId => $tags) {
100+
foreach ($container->findTaggedServiceIds($this->formTypeGuesserTag, true) as $serviceId => $tags) {
102101
$guessers[] = new Reference($serviceId);
103102
}
104103

‎src/Symfony/Component/HttpKernel/DependencyInjection/FragmentRendererPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/DependencyInjection/FragmentRendererPass.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,8 @@ public function process(ContainerBuilder $container)
4646

4747
$definition = $container->getDefinition($this->handlerService);
4848
$renderers = array();
49-
foreach ($container->findTaggedServiceIds($this->rendererTag) as $id => $tags) {
49+
foreach ($container->findTaggedServiceIds($this->rendererTag, true) as $id => $tags) {
5050
$def = $container->getDefinition($id);
51-
if ($def->isAbstract()) {
52-
continue;
53-
}
54-
5551
$class = $container->getParameterBag()->resolveValue($def->getClass());
5652

5753
if (!$r = $container->getReflectionClass($class)) {

‎src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@ public function process(ContainerBuilder $container)
4848
$parameterBag = $container->getParameterBag();
4949
$controllers = array();
5050

51-
foreach ($container->findTaggedServiceIds($this->controllerTag) as $id => $tags) {
51+
foreach ($container->findTaggedServiceIds($this->controllerTag, true) as $id => $tags) {
5252
$def = $container->getDefinition($id);
53-
54-
if ($def->isAbstract()) {
55-
continue;
56-
}
5753
$class = $def->getClass();
5854
$autowire = $def->isAutowired();
5955

‎src/Symfony/Component/Routing/DependencyInjection/RoutingResolverPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/DependencyInjection/RoutingResolverPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function process(ContainerBuilder $container)
3939

4040
$definition = $container->getDefinition($this->resolverServiceId);
4141

42-
foreach ($container->findTaggedServiceIds($this->loaderTag) as $id => $attributes) {
42+
foreach ($container->findTaggedServiceIds($this->loaderTag, true) as $id => $attributes) {
4343
$definition->addMethodCall('addLoader', array(new Reference($id)));
4444
}
4545
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.