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

Method __construct

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

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

(QRinput $input)

Source from the content-addressed store, hash-verified

2865
2866 //----------------------------------------------------------------------
2867 public function __construct(QRinput $input)
2868 {
2869 $spec = array(0,0,0,0,0);
2870
2871 $this->datacode = $input->getByteStream();
2872 if(is_null($this->datacode)) {
2873 throw new Exception('null imput string');
2874 }
2875
2876 QRspec::getEccSpec($input->getVersion(), $input->getErrorCorrectionLevel(), $spec);
2877
2878 $this->version = $input->getVersion();
2879 $this->b1 = QRspec::rsBlockNum1($spec);
2880 $this->dataLength = QRspec::rsDataLength($spec);
2881 $this->eccLength = QRspec::rsEccLength($spec);
2882 $this->ecccode = array_fill(0, $this->eccLength, 0);
2883 $this->blocks = QRspec::rsBlockNum($spec);
2884
2885 $ret = $this->init($spec);
2886 if($ret < 0) {
2887 throw new Exception('block alloc error');
2888 return null;
2889 }
2890
2891 $this->count = 0;
2892 }
2893
2894 //----------------------------------------------------------------------
2895 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