MCPcopy Create free account
hub / github.com/codemistic/Web-Development / convertData

Method convertData

text-to-qr/lib/phpqrcode/phpqrcode.php:1620–1645  ·  view source on GitHub ↗

----------------------------------------------------------------------

()

Source from the content-addressed store, hash-verified

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)

Callers 1

mergeBitStreamMethod · 0.95

Calls 5

estimateVersionMethod · 0.95
getVersionMethod · 0.95
setVersionMethod · 0.95
createBitStreamMethod · 0.95
getMinimumVersionMethod · 0.45

Tested by

no test coverage detected