1 | <?php |
||
67 | final class StateRegistration extends AbstractDocument implements DocumentInterface |
||
68 | { |
||
69 | /** |
||
70 | * @var StateInterface |
||
71 | */ |
||
72 | private $state; |
||
73 | |||
74 | /** |
||
75 | * @var array |
||
76 | */ |
||
77 | private static $availableStates = [ |
||
78 | Acre::SHORT_NAME => Acre::class, |
||
79 | Alagoas::SHORT_NAME => Alagoas::class, |
||
80 | Amapa::SHORT_NAME => Amapa::class, |
||
81 | Amazonas::SHORT_NAME => Amazonas::class, |
||
82 | Bahia::SHORT_NAME => Bahia::class, |
||
83 | Ceara::SHORT_NAME => Ceara::class, |
||
84 | DistritoFederal::SHORT_NAME => DistritoFederal::class, |
||
85 | EspiritoSanto::SHORT_NAME => EspiritoSanto::class, |
||
86 | Goias::SHORT_NAME => Goias::class, |
||
87 | Maranhao::SHORT_NAME => Maranhao::class, |
||
88 | MatoGrosso::SHORT_NAME => MatoGrosso::class, |
||
89 | MatoGrossoSul::SHORT_NAME => MatoGrossoSul::class, |
||
90 | MinasGerais::SHORT_NAME => MinasGerais::class, |
||
91 | Para::SHORT_NAME => Para::class, |
||
92 | Paraiba::SHORT_NAME => Paraiba::class, |
||
93 | Parana::SHORT_NAME => Parana::class, |
||
94 | Pernambuco::SHORT_NAME => Pernambuco::class, |
||
95 | Piaui::SHORT_NAME => Piaui::class, |
||
96 | RioDeJaneiro::SHORT_NAME => RioDeJaneiro::class, |
||
97 | RioGrandeDoNorte::SHORT_NAME => RioGrandeDoNorte::class, |
||
98 | RioGrandeDoSul::SHORT_NAME => RioGrandeDoSul::class, |
||
99 | Rondonia::SHORT_NAME => Rondonia::class, |
||
100 | Roraima::SHORT_NAME => Roraima::class, |
||
101 | SantaCatarina::SHORT_NAME => SantaCatarina::class, |
||
102 | SaoPaulo::SHORT_NAME => SaoPaulo::class, |
||
103 | Sergipe::SHORT_NAME => Sergipe::class, |
||
104 | Tocantins::SHORT_NAME => Tocantins::class, |
||
105 | ]; |
||
106 | |||
107 | /** |
||
108 | * StateRegistration constructor. |
||
109 | * |
||
110 | * @param string $number |
||
111 | * @param StateInterface $state |
||
112 | */ |
||
113 | 476 | public function __construct($number, StateInterface $state) |
|
119 | |||
120 | /** |
||
121 | * @param string $name |
||
122 | * @param array $arguments |
||
123 | * |
||
124 | * @return StateRegistration |
||
125 | */ |
||
126 | 20 | public static function __callStatic($name, $arguments) |
|
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | 437 | protected function extractBaseNumber($number) |
|
144 | |||
145 | /** |
||
146 | * {@inheritdoc} |
||
147 | */ |
||
148 | 476 | protected function extractCheckerDigit($number) |
|
152 | |||
153 | /** |
||
154 | * Voter does not has a specific format. |
||
155 | * |
||
156 | * @return string Returns only numbers. |
||
157 | */ |
||
158 | 41 | public function format() |
|
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | 410 | public function calculateDigit($baseNumber) |
|
172 | } |
||
173 |