----------------------------------------------------------------------
(QRinput $input)
| 57 | |
| 58 | //---------------------------------------------------------------------- |
| 59 | public function __construct(QRinput $input) |
| 60 | { |
| 61 | $spec = array(0,0,0,0,0); |
| 62 | |
| 63 | $this->datacode = $input->getByteStream(); |
| 64 | if(is_null($this->datacode)) { |
| 65 | throw new Exception('null imput string'); |
| 66 | } |
| 67 | |
| 68 | QRspec::getEccSpec($input->getVersion(), $input->getErrorCorrectionLevel(), $spec); |
| 69 | |
| 70 | $this->version = $input->getVersion(); |
| 71 | $this->b1 = QRspec::rsBlockNum1($spec); |
| 72 | $this->dataLength = QRspec::rsDataLength($spec); |
| 73 | $this->eccLength = QRspec::rsEccLength($spec); |
| 74 | $this->ecccode = array_fill(0, $this->eccLength, 0); |
| 75 | $this->blocks = QRspec::rsBlockNum($spec); |
| 76 | |
| 77 | $ret = $this->init($spec); |
| 78 | if($ret < 0) { |
| 79 | throw new Exception('block alloc error'); |
| 80 | return null; |
| 81 | } |
| 82 | |
| 83 | $this->count = 0; |
| 84 | } |
| 85 | |
| 86 | //---------------------------------------------------------------------- |
| 87 | public function init(array $spec) |
nothing calls this directly
no test coverage detected