Skip to content

Commit 1b3431a

Browse files
[HttpKernel] Add #[AsController] attribute for declaring listeners on PHP 8
1 parent 420a9e4 commit 1b3431a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
use Symfony\Component\HttpClient\ScopingHttpClient;
7575
use Symfony\Component\HttpFoundation\Request;
7676
use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface;
77+
use Symfony\Component\HttpKernel\Attribute\AsController;
7778
use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface;
7879
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
7980
use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface;
@@ -558,6 +559,9 @@ public function load(array $configs, ContainerBuilder $container)
558559
$container->registerAttributeForAutoconfiguration(EventListener::class, static function (ChildDefinition $definition, EventListener $attribute): void {
559560
$definition->addTag('kernel.event_listener', get_object_vars($attribute));
560561
});
562+
$container->registerAttributeForAutoconfiguration(AsController::class, static function (ChildDefinition $definition, AsController $attribute): void {
563+
$definition->addTag('controller.service_arguments');
564+
});
561565

562566
if (!$container->getParameter('kernel.debug')) {
563567
// remove tagged iterator argument for resource checkers

0 commit comments

Comments
 (0)