1 | <?php |
||
5 | final class Cnh extends AbstractDocument |
||
6 | { |
||
7 | const LENGTH = 11; |
||
8 | |||
9 | const LABEL = 'CNH'; |
||
10 | |||
11 | const REGEX = '/^([\d]{3})([\d]{3})([\d]{4})([\d]{1})$/'; |
||
12 | |||
13 | const NUMBER_OF_DIGITS = 2; |
||
14 | |||
15 | /** |
||
16 | * Cnh constructor. |
||
17 | * |
||
18 | * @param string $cnh Only accept numbers |
||
19 | */ |
||
20 | 18 | public function __construct($cnh) |
|
25 | |||
26 | 9 | public static function createFromString($number) |
|
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | 8 | public function calculateDigit($baseNumber) |
|
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 2 | public function format() |
|
49 | |||
50 | /** |
||
51 | * Calculate check digit from base number. |
||
52 | * |
||
53 | * @param string $baseNumber Base numeric section to be calculate your digit. |
||
54 | * |
||
55 | * @return string Returns a calculated checker digit. |
||
56 | */ |
||
57 | 8 | private function calculateFirstDigit($baseNumber) |
|
67 | |||
68 | /** |
||
69 | * Calculate check digit from base number. |
||
70 | * |
||
71 | * @param string $baseNumber Base numeric section to be calculate your digit. |
||
72 | * |
||
73 | * @return string Returns a calculated checker digit. |
||
74 | */ |
||
75 | 8 | private function calculateSecondDigit($baseNumber) |
|
85 | } |
||
86 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.