3434use ReflectionClass ;
3535use ReflectionMethod ;
3636use ReflectionNamedType ;
37- use ReflectionParameter ;
3837
3938/**
4039 * @author Robert Pustułka <robert.pustulka@gmail.com>
4342class ControllerFactory extends BaseControllerFactory
4443{
4544 /**
46- * @var ContainerInterface
45+ * @var \Psr\Container\ ContainerInterface
4746 */
4847 protected $ container ;
4948
5049 /**
5150 * Constructor.
5251 *
53- * @param ContainerInterface $container PSR Container
52+ * @param \Psr\Container\ ContainerInterface $container PSR Container
5453 */
5554 public function __construct (ContainerInterface $ container )
5655 {
@@ -73,7 +72,7 @@ public function create(ServerRequestInterface $request): Controller
7372 $ this ->missingController ($ request );
7473 }
7574
76- /** @var Controller $controller */
75+ /** @var \Cake\Controller\ Controller $controller */
7776 $ controller = $ this ->container ->get ((string )$ className );
7877 $ controller ->setRequest ($ request );
7978
@@ -105,7 +104,7 @@ public function invoke($controller): ResponseInterface
105104 /**
106105 * Prepares arguments
107106 *
108- * @param Controller $controller Controller
107+ * @param \Cake\Controller\ Controller $controller Controller
109108 * @return array
110109 */
111110 private function getArgs ($ controller ): array
@@ -114,7 +113,7 @@ private function getArgs($controller): array
114113 $ action = $ request ->getParam ('action ' );
115114
116115 $ reflector = new ReflectionMethod ($ controller , $ action );
117- /** @var ReflectionParameter[] $parameters */
116+ /** @var \ ReflectionParameter[] $parameters */
118117 $ parameters = $ reflector ->getParameters ();
119118 $ passed = $ request ->getParam ('pass ' );
120119 $ args = [];
@@ -128,7 +127,7 @@ private function getArgs($controller): array
128127 if ($ type instanceof ReflectionNamedType) {
129128 $ id = $ type ->getName ();
130129 } else {
131- $ id = (string ) $ type ;
130+ $ id = (string )$ type ;
132131 }
133132 } else {
134133 $ id = $ parameter ->getName ();
0 commit comments