1 | <?php declare(strict_types=1); |
||
13 | class RouteFirewall implements MiddlewareInterface |
||
14 | { |
||
15 | /** @var Router $router */ |
||
16 | private $router; |
||
17 | |||
18 | /** @var array $blockedRoutes */ |
||
19 | private $blockedRoutes; |
||
20 | |||
21 | /** @var MiddlewareInterface[] $middlewares */ |
||
22 | private $middlewares; |
||
23 | |||
24 | /** @var Container $container */ |
||
25 | private $container; |
||
26 | |||
27 | /** |
||
28 | * RouteFirewall constructor. |
||
29 | * @param Container $container |
||
|
|||
30 | */ |
||
31 | 4 | public function __construct(Container $c) |
|
42 | |||
43 | /** |
||
44 | * @param ServerRequestInterface $request |
||
45 | * @param RequestHandlerInterface $handler |
||
46 | * @return ResponseInterface |
||
47 | */ |
||
48 | 3 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
68 | |||
69 | 1 | private function handleMiddleware(string $path, Route $route) |
|
82 | |||
83 | /** |
||
84 | * @param Route $route |
||
85 | * @param $middleware |
||
86 | */ |
||
87 | 1 | private function addMiddleware(Route $route, $middleware): void |
|
96 | } |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.