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

Skip to content

Commit b2df671

Browse files
feature #26341 Autoconfigure service locator tag (apfelbox)
This PR was squashed before being merged into the 4.1-dev branch (closes #26341). Discussion ---------- Autoconfigure service locator tag | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26187 | License | MIT | Doc PR | — We will now also autoconfigure the (required) tag `container.service_locator` for all `ServiceLocator`s. I couldn't find any integration tests for the whole list of autoconfigured core services, so I didn't add any new tests. Commits ------- c4b9b42 Autoconfigure service locator tag
2 parents d1b67a5 + c4b9b42 commit b2df671

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CHANGELOG
1616
* Deprecated `bundle:controller:action` syntax to reference controllers. Use `serviceOrFqcn::method` instead where `serviceOrFqcn`
1717
is either the service ID or the FQCN of the controller.
1818
* Deprecated `Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser`
19+
* The `container.service_locator` tag of `ServiceLocator`s is now autoconfigured.
1920

2021
4.0.0
2122
-----

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface;
4343
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
4444
use Symfony\Component\DependencyInjection\Reference;
45+
use Symfony\Component\DependencyInjection\ServiceLocator;
4546
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
4647
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
4748
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
@@ -288,6 +289,8 @@ public function load(array $configs, ContainerBuilder $container)
288289
->addTag('config_cache.resource_checker');
289290
$container->registerForAutoconfiguration(EnvVarProcessorInterface::class)
290291
->addTag('container.env_var_processor');
292+
$container->registerForAutoconfiguration(ServiceLocator::class)
293+
->addTag('container.service_locator');
291294
$container->registerForAutoconfiguration(ServiceSubscriberInterface::class)
292295
->addTag('container.service_subscriber');
293296
$container->registerForAutoconfiguration(ArgumentValueResolverInterface::class)

0 commit comments

Comments
 (0)