1 | <?php |
||
5 | final class Renavam extends AbstractDocument |
||
6 | { |
||
7 | const LENGTH = 11; |
||
8 | |||
9 | const LABEL = 'Renavam'; |
||
10 | |||
11 | const REGEX = '/^([\d]{4})([\d]{6})([\d]{1})$/'; |
||
12 | |||
13 | const NUMBER_OF_DIGITS = 1; |
||
14 | |||
15 | /** |
||
16 | * Renavam constructor. |
||
17 | * |
||
18 | * @param string $renavam Only accept numbers |
||
19 | */ |
||
20 | 18 | public function __construct($renavam) |
|
26 | |||
27 | 9 | public static function createFromString($number) |
|
31 | |||
32 | /** |
||
33 | * Pad left a number to length(11) with 0(ZERO) |
||
34 | * |
||
35 | * @param string $number |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | 18 | private function padNumber($number) |
|
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | 2 | public function format() |
|
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | 10 | public function calculateDigit($baseNumber) |
|
71 | } |
||
72 |
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.