1 | <?php |
||
29 | class RequestIdRequestResponseListener |
||
30 | { |
||
31 | const HEADER_NAME = 'X-Stepup-Request-Id'; |
||
32 | |||
33 | /** |
||
34 | * @var RequestId |
||
35 | */ |
||
36 | private $requestId; |
||
37 | |||
38 | /** |
||
39 | * @param RequestId $requestId |
||
40 | */ |
||
41 | public function __construct(RequestId $requestId) |
||
45 | |||
46 | /** |
||
47 | * If present, reads the request ID from the appropriate header and sets it on a RequestId instance. |
||
48 | * |
||
49 | * @param GetResponseEvent $event |
||
50 | */ |
||
51 | public function onKernelRequest(GetResponseEvent $event) |
||
61 | |||
62 | /** |
||
63 | * If enabled, sets the request ID on the appropriate response header. |
||
64 | * |
||
65 | * @param FilterResponseEvent $event |
||
66 | */ |
||
67 | public function onKernelResponse(FilterResponseEvent $event) |
||
71 | } |
||
72 |
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.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.