----------------------------------------------------------------------
()
| 1618 | |
| 1619 | //---------------------------------------------------------------------- |
| 1620 | public function convertData() |
| 1621 | { |
| 1622 | $ver = $this->estimateVersion(); |
| 1623 | if($ver > $this->getVersion()) { |
| 1624 | $this->setVersion($ver); |
| 1625 | } |
| 1626 | |
| 1627 | for(;;) { |
| 1628 | $bits = $this->createBitStream(); |
| 1629 | |
| 1630 | if($bits < 0) |
| 1631 | return -1; |
| 1632 | |
| 1633 | $ver = QRspec::getMinimumVersion((int)(($bits + 7) / 8), $this->level); |
| 1634 | if($ver < 0) { |
| 1635 | throw new Exception('WRONG VERSION'); |
| 1636 | return -1; |
| 1637 | } else if($ver > $this->getVersion()) { |
| 1638 | $this->setVersion($ver); |
| 1639 | } else { |
| 1640 | break; |
| 1641 | } |
| 1642 | } |
| 1643 | |
| 1644 | return 0; |
| 1645 | } |
| 1646 | |
| 1647 | //---------------------------------------------------------------------- |
| 1648 | public function appendPaddingBit(&$bstream) |
no test coverage detected