Total Complexity | 5 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | abstract class QRDataModeAbstract implements QRDataModeInterface{ |
||
19 | |||
20 | /** |
||
21 | * The data to write |
||
22 | */ |
||
23 | protected string $data; |
||
24 | |||
25 | /** |
||
26 | * QRDataModeAbstract constructor. |
||
27 | * |
||
28 | * @throws \chillerlan\QRCode\Data\QRCodeDataException |
||
29 | */ |
||
30 | public function __construct(string $data){ |
||
31 | $data = $this::convertEncoding($data); |
||
32 | |||
33 | if(!$this::validateString($data)){ |
||
34 | throw new QRCodeDataException('invalid data'); |
||
35 | } |
||
36 | |||
37 | $this->data = $data; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * returns the character count of the $data string |
||
42 | */ |
||
43 | protected function getCharCount():int{ |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @inheritDoc |
||
49 | */ |
||
50 | public static function convertEncoding(string $string):string{ |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * shortcut |
||
56 | */ |
||
57 | protected static function getLengthBits(int $versionNumber):int{ |
||
59 | } |
||
60 | |||
62 |