1 | <?php |
||
28 | final class StackExchange |
||
29 | { |
||
30 | /** |
||
31 | * The authentication instance. |
||
32 | * |
||
33 | * @var Authentication|null |
||
34 | */ |
||
35 | private $authentication; |
||
36 | |||
37 | /** |
||
38 | * Constructor. |
||
39 | * |
||
40 | * @param Authentication|null $anAuthentication The authentication, it can be null |
||
41 | */ |
||
42 | public function __construct(Authentication $anAuthentication = null) |
||
46 | |||
47 | /** |
||
48 | * Gets the api related with access tokens. |
||
49 | * |
||
50 | * @return AccessTokenApi |
||
51 | */ |
||
52 | public function accessTokenApi() |
||
56 | |||
57 | /** |
||
58 | * Gets the api related with answers. |
||
59 | * |
||
60 | * @return AnswerApi |
||
61 | */ |
||
62 | public function answerApi() |
||
66 | |||
67 | /** |
||
68 | * Gets the api related with users. |
||
69 | * |
||
70 | * @return UserApi |
||
71 | */ |
||
72 | public function userApi() |
||
76 | } |
||
77 |
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.