----------------------------------------------------------------------
()
| 91 | |
| 92 | //---------------------------------------------------------------------- |
| 93 | public function eatNum() |
| 94 | { |
| 95 | $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); |
| 96 | |
| 97 | $p = 0; |
| 98 | while(self::isdigitat($this->dataStr, $p)) { |
| 99 | $p++; |
| 100 | } |
| 101 | |
| 102 | $run = $p; |
| 103 | $mode = $this->identifyMode($p); |
| 104 | |
| 105 | if($mode == QR_MODE_8) { |
| 106 | $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln |
| 107 | + QRinput::estimateBitsMode8(1) // + 4 + l8 |
| 108 | - QRinput::estimateBitsMode8($run + 1); // - 4 - l8 |
| 109 | if($dif > 0) { |
| 110 | return $this->eat8(); |
| 111 | } |
| 112 | } |
| 113 | if($mode == QR_MODE_AN) { |
| 114 | $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln |
| 115 | + QRinput::estimateBitsModeAn(1) // + 4 + la |
| 116 | - QRinput::estimateBitsModeAn($run + 1);// - 4 - la |
| 117 | if($dif > 0) { |
| 118 | return $this->eatAn(); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | $ret = $this->input->append(QR_MODE_NUM, $run, str_split($this->dataStr)); |
| 123 | if($ret < 0) |
| 124 | return -1; |
| 125 | |
| 126 | return $run; |
| 127 | } |
| 128 | |
| 129 | //---------------------------------------------------------------------- |
| 130 | public function eatAn() |
no test coverage detected