* eatAn * @return int run */
()
| 1355 | * @return int run |
| 1356 | */ |
| 1357 | protected function eatAn() { |
| 1358 | $la = $this->lengthIndicator(QR_MODE_AN, $this->version); |
| 1359 | $ln = $this->lengthIndicator(QR_MODE_NM, $this->version); |
| 1360 | $p = 0; |
| 1361 | while($this->isalnumat($this->dataStr, $p)) { |
| 1362 | if ($this->isdigitat($this->dataStr, $p)) { |
| 1363 | $q = $p; |
| 1364 | while($this->isdigitat($this->dataStr, $q)) { |
| 1365 | $q++; |
| 1366 | } |
| 1367 | $dif = $this->estimateBitsModeAn($p) // + 4 + la |
| 1368 | + $this->estimateBitsModeNum($q - $p) + 4 + $ln |
| 1369 | - $this->estimateBitsModeAn($q); // - 4 - la |
| 1370 | if ($dif < 0) { |
| 1371 | break; |
| 1372 | } else { |
| 1373 | $p = $q; |
| 1374 | } |
| 1375 | } else { |
| 1376 | $p++; |
| 1377 | } |
| 1378 | } |
| 1379 | $run = $p; |
| 1380 | if (!$this->isalnumat($this->dataStr, $p)) { |
| 1381 | $dif = $this->estimateBitsModeAn($run) + 4 + $la |
| 1382 | + $this->estimateBitsMode8(1) // + 4 + l8 |
| 1383 | - $this->estimateBitsMode8($run + 1); // - 4 - l8 |
| 1384 | if ($dif > 0) { |
| 1385 | return $this->eat8(); |
| 1386 | } |
| 1387 | } |
| 1388 | $this->items = $this->appendNewInputItem($this->items, QR_MODE_AN, $run, str_split($this->dataStr)); |
| 1389 | return $run; |
| 1390 | } |
| 1391 | |
| 1392 | /** |
| 1393 | * eatKanji |
no test coverage detected