| Total Complexity | 2 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | #[\Attribute] |
||
| 9 | abstract class Guard |
||
| 10 | { |
||
| 11 | use Traits\Base, |
||
| 12 | Traits\Header, |
||
| 13 | Traits\Output, |
||
| 14 | Traits\CheckRequest, |
||
| 15 | Traits\CheckResponse; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @return void|null|ResponseInterface|$this |
||
| 19 | */ |
||
| 20 | abstract public function process(); |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Invoke guard. |
||
| 24 | * |
||
| 25 | * @param ServerRequestInterface $request |
||
| 26 | * @param ResponseInterface $response |
||
| 27 | * @return ResponseInterface|null |
||
| 28 | */ |
||
| 29 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response): ?ResponseInterface |
||
| 42 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.