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