1 | <?php |
||
19 | class AppKernel implements HttpKernelInterface |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * @var ControllerResolver |
||
24 | */ |
||
25 | private $resolver; |
||
26 | |||
27 | /** |
||
28 | * @var SerializedRouteCollection |
||
29 | */ |
||
30 | private $routes; |
||
31 | |||
32 | /** |
||
33 | * @var UrlMatcher |
||
34 | */ |
||
35 | private $urlMatcher; |
||
36 | |||
37 | /** |
||
38 | * @var MiddlewareInterface[] |
||
39 | */ |
||
40 | private $middlewares; |
||
41 | |||
42 | /** |
||
43 | * @Inject({ |
||
44 | * "@ControllerResolver", |
||
45 | * "@Core.RouteCollection", |
||
46 | * "@UrlMatcher", |
||
47 | * null |
||
48 | * }) |
||
49 | * @param ControllerResolver $resolver |
||
50 | * @param SerializedRouteCollection $routes |
||
51 | * @param UrlMatcher $urlMatcher |
||
52 | * @param MiddlewareInterface[] $middlewares |
||
53 | */ |
||
54 | 3 | public function __construct( |
|
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | 3 | public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true) |
|
85 | |||
86 | /** |
||
87 | * @param Request $request |
||
88 | * @return Response|mixed |
||
89 | */ |
||
90 | 3 | private function handleRequest(Request $request) |
|
113 | |||
114 | /** |
||
115 | * @param Response|mixed $response |
||
116 | * @return Response |
||
117 | */ |
||
118 | 3 | private function prepareResponse($response) : Response |
|
130 | |||
131 | /** |
||
132 | * @param Request $request |
||
133 | * @param Response $response |
||
134 | */ |
||
135 | 3 | protected function applyResponseMiddleware(Request $request, Response $response) |
|
143 | |||
144 | /** |
||
145 | * @param Request $request |
||
146 | * @param Exception $exception |
||
147 | * @return Response|null |
||
148 | */ |
||
149 | 1 | protected function applyExceptionMiddleware(Request $request, Exception $exception) |
|
160 | } |
||
161 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.