Skip to content

Commit 4860b3e

Browse files
feature symfony#23719 Autoconfigure instances of ArgumentValueResolverInterface (BPScott)
This PR was merged into the 3.4 branch. Discussion ---------- Autoconfigure instances of ArgumentValueResolverInterface | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#23701 | License | MIT | Doc PR | n/a Autoconfigure instances of `Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface` so they get the `controller.argument_value_resolver` tag automatically added to them. This avoids avoid having to tag each resolver or add an `_instanceof` configuration such as ```yaml _instanceof: Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface: tags: [controller.argument_value_resolver] ``` Commits ------- ee4dc20 Autoconfigure instances of ArgumentValueResolverInterface
2 parents 1218c71 + ee4dc20 commit 4860b3e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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\Form\FormTypeInterface;
4343
use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface;
4444
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
45+
use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface;
4546
use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
4647
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
4748
use Symfony\Component\PropertyAccess\PropertyAccessor;
@@ -269,6 +270,8 @@ public function load(array $configs, ContainerBuilder $container)
269270
->addTag('config_cache.resource_checker');
270271
$container->registerForAutoconfiguration(ServiceSubscriberInterface::class)
271272
->addTag('container.service_subscriber');
273+
$container->registerForAutoconfiguration(ArgumentValueResolverInterface::class)
274+
->addTag('controller.argument_value_resolver');
272275
$container->registerForAutoconfiguration(AbstractController::class)
273276
->addTag('controller.service_arguments');
274277
$container->registerForAutoconfiguration(Controller::class)

0 commit comments

Comments
 (0)