1 | <?php |
||
8 | final class Cns extends AbstractDocument |
||
9 | { |
||
10 | const LENGTH = 15; |
||
11 | |||
12 | const LABEL = 'CNS'; |
||
13 | |||
14 | const REGEX = '/^([\d]{3})([\d]{4})([\d]{4})([\d]{4})$/'; |
||
15 | |||
16 | const FORMAT = '$1 $2 $3 $4'; |
||
17 | |||
18 | const DIGIT_COUNT = 1; |
||
19 | |||
20 | /** |
||
21 | * @var DigitCalculable |
||
22 | */ |
||
23 | private $calculator; |
||
24 | |||
25 | /** |
||
26 | * CNS constructor. |
||
27 | * |
||
28 | * @param string $number |
||
29 | */ |
||
30 | 15 | public function __construct($number) |
|
36 | |||
37 | 15 | public function defineCalculator($number) |
|
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 1 | public function format() |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | 11 | public function calculateDigit($baseNumber) |
|
62 | } |
||
63 |
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.