khanamiryan / php-qrcode-detector-decoder

This is a PHP library to detect and decode QR-codes. This is first and only QR code reader that works without extensions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot use object of type Zxing\Qrcode\Decoder\ECBlocks as array

EasonJolter opened this issue · comments

commented

this image couse Cannot use object of type Zxing\Qrcode\Decoder\ECBlocks as array
ThrowableError in Version.php line 96
public function getECBlocksForLevel($ecLevel) { return $this->ecBlocks[$ecLevel->getOrdinal()]; }
I use try catch, but it dosn't catched, just throw exception.
And why this image couse exception?

360

commented

You have to change the following line in Version.php (94 - 101):
public function getECBlocksForLevel($ecLevel) { return $this->ecBlocks[$ecLevel->getOrdinal()]; }

to:

public function getECBlocksForLevel($ecLevel) { if(is_array($this->ecBlocks)){ return $this->ecBlocks[$ecLevel->getOrdinal()]; }else{ return $this->ecBlocks; } }