1 | <?php |
||
18 | trait ArithmeticTrait |
||
19 | { |
||
20 | /** |
||
21 | * @return mixed |
||
22 | */ |
||
23 | public abstract function getValue(); |
||
24 | |||
25 | /** |
||
26 | * @return static |
||
27 | */ |
||
28 | 7 | public function absolute() |
|
32 | |||
33 | /** |
||
34 | * @return static |
||
35 | */ |
||
36 | 5 | public function makeNegative() |
|
40 | |||
41 | /** |
||
42 | * @return static |
||
43 | */ |
||
44 | 4 | public function makePositive() |
|
48 | |||
49 | /** |
||
50 | * @return static |
||
51 | */ |
||
52 | 2 | public function reversePolarity() |
|
60 | |||
61 | /** |
||
62 | * @param ValueObjectInterface $object |
||
63 | * @return static |
||
64 | */ |
||
65 | 18 | public function add(ValueObjectInterface $object) |
|
69 | |||
70 | /** |
||
71 | * @param ValueObjectInterface $object |
||
72 | * @return static |
||
73 | */ |
||
74 | 1 | public function subtract(ValueObjectInterface $object) |
|
78 | |||
79 | /** |
||
80 | * @param ValueObjectInterface $object |
||
81 | * @return static |
||
82 | */ |
||
83 | 18 | public function multiply(ValueObjectInterface $object) |
|
87 | |||
88 | /** |
||
89 | * @param ValueObjectInterface $object |
||
90 | * @return static |
||
91 | */ |
||
92 | 1 | public function divide(ValueObjectInterface $object) |
|
96 | |||
97 | /** |
||
98 | * @param ValueObjectInterface $object |
||
99 | * @return static |
||
100 | */ |
||
101 | 1 | public function modulus(ValueObjectInterface $object) |
|
105 | |||
106 | /** |
||
107 | * @param ValueObjectInterface $object |
||
108 | * @return static |
||
109 | */ |
||
110 | 1 | public function exponentiation(ValueObjectInterface $object) |
|
114 | } |
||
115 |
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.