1 | <?php |
||
7 | final class Goias extends State |
||
8 | { |
||
9 | const LONG_NAME = '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 | const SHORT_NAME = 'GO'; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $digit; |
||
25 | |||
26 | 7 | public function __construct() |
|
30 | |||
31 | /** |
||
32 | * |
||
33 | * @param string $digit |
||
34 | * |
||
35 | * @return Goias |
||
36 | */ |
||
37 | 7 | private function setCurrentDigit($digit) |
|
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | * |
||
47 | * @see http://www.sintegra.gov.br/Cad_Estados/cad_GO.html |
||
48 | */ |
||
49 | 5 | public function calculateDigit($baseNumber) |
|
67 | |||
68 | /** |
||
69 | * A bizarre rule for this number(11094402). |
||
70 | * |
||
71 | * Default digit is 0, but could be 1 too :( |
||
72 | * |
||
73 | * @param string $number A magic base number. |
||
74 | * |
||
75 | * @return bool Returns true if number is magic, otherwise false. |
||
76 | */ |
||
77 | 5 | private function isMagicNumber($number) |
|
81 | |||
82 | /** |
||
83 | * A big workaround for StateRegistration(11094402) |
||
84 | * |
||
85 | * @param string $digit |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | 2 | private function fixedDigitForMagicNumber($digit) |
|
97 | |||
98 | 5 | private function discoverDigitToReplace($number) |
|
107 | |||
108 | 7 | public function normalizeNumber($number) |
|
115 | } |
||
116 |