| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 70 | public static function decodeSegment(BitBuffer $bitBuffer, int $versionNumber):string{ |
||
| 71 | $length = $bitBuffer->read(self::getLengthBits($versionNumber)); |
||
| 72 | |||
| 73 | if($bitBuffer->available() < (8 * $length)){ |
||
| 74 | throw new QRCodeDataException('not enough bits available'); // @codeCoverageIgnore |
||
| 75 | } |
||
| 76 | |||
| 77 | $readBytes = ''; |
||
| 78 | |||
| 79 | for($i = 0; $i < $length; $i++){ |
||
| 80 | $readBytes .= chr($bitBuffer->read(8)); |
||
| 81 | } |
||
| 82 | |||
| 83 | return $readBytes; |
||
| 84 | } |
||
| 87 |