----------------------------------------------------------------------
(QRinput $input)
| 2865 | |
| 2866 | //---------------------------------------------------------------------- |
| 2867 | public function __construct(QRinput $input) |
| 2868 | { |
| 2869 | $spec = array(0,0,0,0,0); |
| 2870 | |
| 2871 | $this->datacode = $input->getByteStream(); |
| 2872 | if(is_null($this->datacode)) { |
| 2873 | throw new Exception('null imput string'); |
| 2874 | } |
| 2875 | |
| 2876 | QRspec::getEccSpec($input->getVersion(), $input->getErrorCorrectionLevel(), $spec); |
| 2877 | |
| 2878 | $this->version = $input->getVersion(); |
| 2879 | $this->b1 = QRspec::rsBlockNum1($spec); |
| 2880 | $this->dataLength = QRspec::rsDataLength($spec); |
| 2881 | $this->eccLength = QRspec::rsEccLength($spec); |
| 2882 | $this->ecccode = array_fill(0, $this->eccLength, 0); |
| 2883 | $this->blocks = QRspec::rsBlockNum($spec); |
| 2884 | |
| 2885 | $ret = $this->init($spec); |
| 2886 | if($ret < 0) { |
| 2887 | throw new Exception('block alloc error'); |
| 2888 | return null; |
| 2889 | } |
| 2890 | |
| 2891 | $this->count = 0; |
| 2892 | } |
| 2893 | |
| 2894 | //---------------------------------------------------------------------- |
| 2895 | public function init(array $spec) |
nothing calls this directly
no test coverage detected