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