1 | <?php |
||
15 | class Activator |
||
16 | { |
||
17 | /** |
||
18 | * Create "Exact" activator. |
||
19 | * |
||
20 | * @param string $value |
||
21 | * |
||
22 | * @param bool $caseSensitive |
||
23 | * |
||
24 | * @return Exact |
||
25 | */ |
||
26 | 2 | public static function exact(string $value, bool $caseSensitive = false): Exact |
|
30 | |||
31 | /** |
||
32 | * @param string|array $needles |
||
33 | * |
||
34 | * @return Contains |
||
35 | */ |
||
36 | 1 | public static function contains($needles): Contains |
|
40 | |||
41 | /** |
||
42 | * Create "Regex" activator. |
||
43 | * |
||
44 | * @param string $value |
||
45 | * |
||
46 | * @return Regex |
||
47 | */ |
||
48 | 1 | public static function regex(string $value): Regex |
|
52 | |||
53 | /** |
||
54 | * Create "In" activator. |
||
55 | * |
||
56 | * @param array|Collection $values |
||
57 | * @param bool $strict |
||
58 | * |
||
59 | * @return In |
||
60 | */ |
||
61 | 1 | public static function in($values, bool $strict = true): In |
|
62 | { |
||
63 | 1 | return new In($values, $strict); |
|
|
|||
64 | } |
||
65 | |||
66 | /** |
||
67 | * Create "Attachment" activator. |
||
68 | * |
||
69 | * @param string|null $type |
||
70 | * |
||
71 | * @return Attachment |
||
72 | */ |
||
73 | 1 | public static function attachment(string $type = null): Attachment |
|
77 | |||
78 | /** |
||
79 | * Create "Payload" activator. |
||
80 | * |
||
81 | * @param string $value |
||
82 | * |
||
83 | * @return Payload |
||
84 | */ |
||
85 | 1 | public static function payload(string $value): Payload |
|
89 | } |
||
90 |
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.