File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -35,14 +35,24 @@ public function __construct(ContainerInterface $container)
35
35
*/
36
36
public function supports (Request $ request , ArgumentMetadata $ argument )
37
37
{
38
- return is_string ($ controller = $ request ->attributes ->get ('_controller ' )) && $ this ->container ->has ($ controller ) && $ this ->container ->get ($ controller )->has ($ argument ->getName ());
38
+ $ controller = $ request ->attributes ->get ('_controller ' );
39
+
40
+ if (\is_array ($ controller ) && \is_callable ($ controller , true ) && \is_string ($ controller [0 ])) {
41
+ $ controller = $ controller [0 ].':: ' .$ controller [1 ];
42
+ }
43
+
44
+ return \is_string ($ controller ) && $ this ->container ->has ($ controller ) && $ this ->container ->get ($ controller )->has ($ argument ->getName ());
39
45
}
40
46
41
47
/**
42
48
* {@inheritdoc}
43
49
*/
44
50
public function resolve (Request $ request , ArgumentMetadata $ argument )
45
51
{
46
- yield $ this ->container ->get ($ request ->attributes ->get ('_controller ' ))->get ($ argument ->getName ());
52
+ if (\is_array ($ controller = $ request ->attributes ->get ('_controller ' ))) {
53
+ $ controller = $ controller [0 ].':: ' .$ controller [1 ];
54
+ }
55
+
56
+ yield $ this ->container ->get ($ controller )->get ($ argument ->getName ());
47
57
}
48
58
}
You can’t perform that action at this time.
0 commit comments