Skip to content

Commit 09b9eb2

Browse files
committed
[HttpKernel] don't try to wire Request argument with controller.service_arguments
This does not make sense as Request is not a service and it's already handled by RequestValueResolver.
1 parent ed42760 commit 09b9eb2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\DependencyInjection\LazyProxy\ProxyHelper;
2323
use Symfony\Component\DependencyInjection\Reference;
2424
use Symfony\Component\DependencyInjection\TypedReference;
25+
use Symfony\Component\HttpFoundation\Request;
2526

2627
/**
2728
* Creates the service-locators required by ServiceValueResolver.
@@ -148,6 +149,10 @@ public function process(ContainerBuilder $container)
148149
continue;
149150
}
150151

152+
if (Request::class === $type) {
153+
continue;
154+
}
155+
151156
if ($type && !$p->isOptional() && !$p->allowsNull() && !class_exists($type) && !interface_exists($type, false)) {
152157
$message = sprintf('Cannot determine controller argument for "%s::%s()": the $%s argument is type-hinted with the non-existent class or interface: "%s".', $class, $r->name, $p->name, $type);
153158

0 commit comments

Comments
 (0)