1 | <?php |
||
8 | final class Bahia extends State |
||
9 | { |
||
10 | const LONG_NAME = 'Bahia'; |
||
11 | |||
12 | const SHORT_NAME = 'BA'; |
||
13 | |||
14 | const REGEX = '/^([\d]{6,7})(\d{2})$/'; |
||
15 | |||
16 | const FORMAT = '$1-$2'; |
||
17 | |||
18 | const LENGTH = 9; |
||
19 | |||
20 | const NUMBER_OF_DIGITS = 2; |
||
21 | |||
22 | 34 | public function __construct() |
|
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | 34 | public function normalizeNumber(string $number) : string |
|
31 | { |
||
32 | 34 | if (!empty($number)) { |
|
33 | 34 | return str_pad(parent::normalizeNumber($number), $this->getLength(), '0', STR_PAD_LEFT); |
|
34 | } |
||
35 | |||
36 | return $number; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | * |
||
42 | * @see http://www.sintegra.gov.br/Cad_Estados/cad_BA.html |
||
43 | */ |
||
44 | 32 | public function calculateDigit(string $baseNumber) : string |
|
57 | |||
58 | 32 | private function discoverModule($baseNumber) |
|
70 | } |
||
71 |