1 | <?php |
||
7 | final class Amapa extends State |
||
8 | { |
||
9 | const LABEL = 'Amapa'; |
||
10 | |||
11 | const REGEX = '/^(03)(\d{3})(\d{3})(\d{1})$/'; |
||
12 | |||
13 | const FORMAT = '$1.$2.$3-$4'; |
||
14 | |||
15 | const LENGTH = 9; |
||
16 | |||
17 | const DIGITS_COUNT = 1; |
||
18 | |||
19 | 6 | public function __construct() |
|
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | * |
||
27 | * @see http://www.sintegra.gov.br/Cad_Estados/cad_AP.html |
||
28 | */ |
||
29 | 4 | public function calculateDigit($baseNumber) |
|
46 | |||
47 | /** |
||
48 | * Discover last digit base on number threshold. |
||
49 | * |
||
50 | * @param int $number |
||
51 | * |
||
52 | * @return string |
||
53 | */ |
||
54 | 4 | private function discoverLastDigit($number) |
|
66 | |||
67 | /** |
||
68 | * Discover digit to be replaced based on number threshold. |
||
69 | * |
||
70 | * @param $number |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | 4 | private function discoverDigitToReplace($number) |
|
83 | |||
84 | /** |
||
85 | * Is number between 3017001 and 3019022. |
||
86 | * |
||
87 | * @param int $number |
||
88 | * |
||
89 | * @return bool |
||
90 | */ |
||
91 | 4 | private function isBetweenFirstSlice($number) |
|
95 | |||
96 | /** |
||
97 | * Is number between 3017001 and 3019022. |
||
98 | * |
||
99 | * @param int $number |
||
100 | * |
||
101 | * @return bool |
||
102 | */ |
||
103 | 4 | private function isBetweenSecondSlice($number) |
|
107 | } |
||
108 |