1 | <?php declare(strict_types=1); |
||
13 | class I18nHandler |
||
14 | { |
||
15 | const REGEX_LOCALE = '#^/(?P<locale>[a-z]{2}[-_][a-zA-Z]{2})(?:/|$)#'; |
||
16 | |||
17 | /** @var Translator$translator */ |
||
18 | private $translator; |
||
19 | |||
20 | /** @var array $supportedLocales */ |
||
21 | private $supportedLocales; |
||
22 | |||
23 | /** |
||
24 | * InternationalisationMiddleware constructor. |
||
25 | * @param $helper |
||
26 | * @param string|null $defaultLocale |
||
|
|||
27 | */ |
||
28 | 3 | public function __construct(Translator $translator, array $supportedLocales) |
|
33 | |||
34 | /** |
||
35 | * @param ServerRequestInterface $request |
||
36 | * @return ServerRequestInterface |
||
37 | * @throws NotFoundException |
||
38 | */ |
||
39 | 2 | public function handleI18n(ServerRequestInterface $request): ServerRequestInterface |
|
62 | |||
63 | /** |
||
64 | * @param ServerRequestInterface $request |
||
65 | * @return ServerRequestInterface |
||
66 | */ |
||
67 | 1 | public function removeI18n(ServerRequestInterface $request): ServerRequestInterface |
|
83 | } |
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.