1 | <?php |
||
21 | trait AttributeTrait |
||
22 | { |
||
23 | /** |
||
24 | * @return string |
||
25 | */ |
||
26 | public function __toString(): string |
||
30 | |||
31 | /** |
||
32 | * @param string|null $string |
||
33 | * |
||
34 | * @return self |
||
35 | */ |
||
36 | public static function create(string $string = null): self |
||
44 | |||
45 | /** |
||
46 | * @return string |
||
47 | */ |
||
48 | abstract public function stringify(): string; |
||
49 | |||
50 | /** |
||
51 | * @param string|null $string |
||
52 | * |
||
53 | * @return bool |
||
54 | */ |
||
55 | public static function isParsable(string $string = null): bool |
||
64 | |||
65 | /** |
||
66 | * @param string $string |
||
67 | * |
||
68 | * @return array|null |
||
69 | */ |
||
70 | abstract public static function explodeParsable(string $string = null): ?array; |
||
71 | |||
72 | /** |
||
73 | * @param string|null $string |
||
74 | * |
||
75 | * @return null|string |
||
76 | */ |
||
77 | private static function sanitize(string $string = null): ?string |
||
88 | } |
||
89 |
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.