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

Method __construct

text-to-qr/lib/phpqrcode/qrencode.php:59–84  ·  view source on GitHub ↗

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

(QRinput $input)

Source from the content-addressed store, hash-verified

57
58 //----------------------------------------------------------------------
59 public function __construct(QRinput $input)
60 {
61 $spec = array(0,0,0,0,0);
62
63 $this->datacode = $input->getByteStream();
64 if(is_null($this->datacode)) {
65 throw new Exception('null imput string');
66 }
67
68 QRspec::getEccSpec($input->getVersion(), $input->getErrorCorrectionLevel(), $spec);
69
70 $this->version = $input->getVersion();
71 $this->b1 = QRspec::rsBlockNum1($spec);
72 $this->dataLength = QRspec::rsDataLength($spec);
73 $this->eccLength = QRspec::rsEccLength($spec);
74 $this->ecccode = array_fill(0, $this->eccLength, 0);
75 $this->blocks = QRspec::rsBlockNum($spec);
76
77 $ret = $this->init($spec);
78 if($ret < 0) {
79 throw new Exception('block alloc error');
80 return null;
81 }
82
83 $this->count = 0;
84 }
85
86 //----------------------------------------------------------------------
87 public function init(array $spec)

Callers

nothing calls this directly

Calls 9

initMethod · 0.95
getByteStreamMethod · 0.45
getEccSpecMethod · 0.45
getVersionMethod · 0.45
rsBlockNum1Method · 0.45
rsDataLengthMethod · 0.45
rsEccLengthMethod · 0.45
rsBlockNumMethod · 0.45

Tested by

no test coverage detected