1 | <?php |
||
7 | final class NFeAccessKey implements DocumentInterface |
||
8 | { |
||
9 | const LABEL = 'NFeAccessKey'; |
||
10 | |||
11 | const LENGTH = 44; |
||
12 | |||
13 | const REGEX = '/([\d]{4})/'; |
||
14 | |||
15 | const MASK = '$1 '; |
||
16 | |||
17 | const MODEL = 55; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $nfeKey; |
||
23 | |||
24 | /** |
||
25 | * NFeAccessKey constructor. |
||
26 | * |
||
27 | * @param $nfeKey |
||
28 | */ |
||
29 | 17 | public function __construct($nfeKey) |
|
34 | |||
35 | /** |
||
36 | * @param int $state |
||
37 | * @param \DateTime $generatedAt |
||
38 | * @param Cnpj $cnpj |
||
39 | * @param int $serie |
||
40 | * @param int $invoiceNumber |
||
41 | * @param int $controlNumber |
||
42 | * |
||
43 | * @return NFeAccessKey |
||
44 | */ |
||
45 | 1 | public static function generate($state, \DateTime $generatedAt, Cnpj $cnpj, $serie, $invoiceNumber, $controlNumber) |
|
59 | |||
60 | 1 | public function format() |
|
64 | |||
65 | 3 | public function __toString() |
|
69 | |||
70 | 17 | private function validate($number) |
|
79 | |||
80 | 14 | private function isValid($number) |
|
94 | |||
95 | 13 | private static function calculateDigits($baseNumber) |
|
104 | } |
||
105 |
Late static binding only has effect in subclasses. A
final
class cannot be extended anymore so late static binding cannot occurr. Consider replacingstatic::
withself::
.To learn more about late static binding, please refer to the PHP core documentation.