1 | <?php |
||
15 | class FileRobotStore implements RobotStoreInterface |
||
16 | { |
||
17 | private const FILE_VERSION = '001'; |
||
18 | |||
19 | private static $store; |
||
20 | |||
21 | private $file; |
||
22 | |||
23 | /** |
||
24 | * __construct |
||
25 | * |
||
26 | * @param \SplFileObject $file |
||
27 | */ |
||
28 | 1 | private function __construct(\SplFileObject $file) |
|
32 | |||
33 | public function __destruct() |
||
37 | |||
38 | /** |
||
39 | * getStore |
||
40 | * |
||
41 | * @param string $basePath |
||
42 | * @return RobotStoreInterface |
||
43 | */ |
||
44 | 1 | public static function getStore(string $basePath): RobotStoreInterface |
|
53 | |||
54 | /** |
||
55 | * createStore |
||
56 | * |
||
57 | * @param string $basePath |
||
58 | * @return RobotStoreInterface |
||
59 | */ |
||
60 | 1 | private static function createStore(string $basePath): RobotStoreInterface |
|
77 | |||
78 | /** |
||
79 | * @return Robot|null |
||
80 | */ |
||
81 | public function getRobot(): ?Robot |
||
93 | |||
94 | /** |
||
95 | * @param Robot $robot |
||
96 | */ |
||
97 | public function saveRobot(Robot $robot): void |
||
105 | } |
||
106 |
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.