1 | <?php |
||
7 | final class Goias extends State |
||
8 | { |
||
9 | const LABEL = 'Goias'; |
||
10 | |||
11 | const REGEX = '/^(1[015])(\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 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $digit; |
||
23 | |||
24 | 7 | public function __construct() |
|
28 | |||
29 | /** |
||
30 | * |
||
31 | * @param string $digit |
||
32 | * |
||
33 | * @return Goias |
||
34 | */ |
||
35 | 7 | private function setCurrentDigit($digit) |
|
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | * |
||
45 | * @see http://www.sintegra.gov.br/Cad_Estados/cad_GO.html |
||
46 | */ |
||
47 | 5 | public function calculateDigit($baseNumber) |
|
65 | |||
66 | /** |
||
67 | * A bizarre rule for this number(11094402). |
||
68 | * |
||
69 | * Default digit is 0, but could be 1 too :( |
||
70 | * |
||
71 | * @param string $number A magic base number. |
||
72 | * |
||
73 | * @return bool Returns true if number is magic, otherwise false. |
||
74 | */ |
||
75 | 5 | private function isMagicNumber($number) |
|
79 | |||
80 | /** |
||
81 | * A big workaround for StateRegistration(11094402) |
||
82 | * |
||
83 | * @param string $digit |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | 2 | private function fixedDigitForMagicNumber($digit) |
|
95 | |||
96 | 5 | private function discoverDigitToReplace($number) |
|
105 | |||
106 | 7 | public function normalizeNumber($number) |
|
113 | } |
||
114 |