1 | <?php |
||
8 | final class SaoPaulo implements StateInterface |
||
9 | { |
||
10 | const LONG_NAME = 'SaoPaulo'; |
||
11 | |||
12 | const SHORT_NAME = 'SP'; |
||
13 | |||
14 | /** |
||
15 | * @var State |
||
16 | */ |
||
17 | private $calculation; |
||
18 | |||
19 | 7 | public function __construct() |
|
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | */ |
||
27 | 7 | public function normalizeNumber($number) |
|
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | 7 | public function getState() |
|
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | 4 | public function extractBaseNumber($number) |
|
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | 7 | public function extractCheckerDigit($number) |
|
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | 7 | public function getLength() |
|
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 2 | public function getFormat() |
|
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | 7 | public function getNumberOfDigits() |
|
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | 2 | public function getRegex() |
|
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | * |
||
95 | * @see http://www.sintegra.gov.br/Cad_Estados/cad_SP.html |
||
96 | */ |
||
97 | 4 | public function calculateDigit($baseNumber) |
|
101 | |||
102 | /** |
||
103 | * It will load calculation strategy based on number format. |
||
104 | * |
||
105 | * @param string $number Number of document. |
||
106 | */ |
||
107 | 7 | private function defineStrategy($number) |
|
113 | } |
||
114 |