@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | */ |
| 398 | 398 | protected function set_eccLevel(int $eccLevel):void{ |
| 399 | 399 | |
| 400 | - if((0b11 & $eccLevel) !== $eccLevel){ |
|
| 400 | + if((0b11&$eccLevel) !== $eccLevel){ |
|
| 401 | 401 | throw new QRCodeException(sprintf('Invalid error correct level: %s', $eccLevel)); |
| 402 | 402 | } |
| 403 | 403 | |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | /** |
| 481 | 481 | * clamp the logo space values between 0 and maximum length (177 modules at version 40) |
| 482 | 482 | */ |
| 483 | - protected function clampLogoSpaceValue(?int $value):?int{ |
|
| 483 | + protected function clampLogoSpaceValue(?int $value): ?int{ |
|
| 484 | 484 | |
| 485 | 485 | if($value === null){ |
| 486 | 486 | return null; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $byte2 = ord($string[$i + 1]); |
| 92 | 92 | |
| 93 | 93 | // byte 1 unused and vendor ranges |
| 94 | - if($byte1 < 0x81 || ($byte1 > 0x84 && $byte1 < 0x88) || ($byte1 > 0x9f && $byte1 < 0xe0) || $byte1 > 0xea){ |
|
| 94 | + if($byte1 < 0x81 || ($byte1 > 0x84 && $byte1 < 0x88) || ($byte1 > 0x9f && $byte1 < 0xe0) || $byte1 > 0xea){ |
|
| 95 | 95 | return false; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $len = strlen($this->data); |
| 137 | 137 | |
| 138 | 138 | for($i = 0; $i + 1 < $len; $i += 2){ |
| 139 | - $c = ((0xff & ord($this->data[$i])) << 8) | (0xff & ord($this->data[$i + 1])); |
|
| 139 | + $c = ((0xff & ord($this->data[$i])) << 8)|(0xff & ord($this->data[$i + 1])); |
|
| 140 | 140 | |
| 141 | 141 | if($c >= 0x8140 && $c <= 0x9ffc){ |
| 142 | 142 | $c -= 0x8140; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $length = $bitBuffer->read(self::getLengthBits($versionNumber)); |
| 167 | 167 | |
| 168 | 168 | if($bitBuffer->available() < $length * 13){ |
| 169 | - throw new QRCodeDataException('not enough bits available'); // @codeCoverageIgnore |
|
| 169 | + throw new QRCodeDataException('not enough bits available'); // @codeCoverageIgnore |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | // Each character will require 2 bytes. Read the characters as 2-byte pairs and decode as SJIS afterwards |
@@ -176,15 +176,15 @@ discard block |
||
| 176 | 176 | while($length > 0){ |
| 177 | 177 | // Each 13 bits encodes a 2-byte character |
| 178 | 178 | $twoBytes = $bitBuffer->read(13); |
| 179 | - $assembledTwoBytes = ((int)($twoBytes / 0x0c0) << 8) | ($twoBytes % 0x0c0); |
|
| 179 | + $assembledTwoBytes = ((int)($twoBytes / 0x0c0) << 8)|($twoBytes % 0x0c0); |
|
| 180 | 180 | |
| 181 | 181 | $assembledTwoBytes += ($assembledTwoBytes < 0x01f00) |
| 182 | 182 | ? 0x08140 // In the 0x8140 to 0x9FFC range |
| 183 | 183 | : 0x0c140; // In the 0xE040 to 0xEBBF range |
| 184 | 184 | |
| 185 | 185 | $buffer[$offset] = chr(0xff & ($assembledTwoBytes >> 8)); |
| 186 | - $buffer[$offset + 1] = chr(0xff & $assembledTwoBytes); |
|
| 187 | - $offset += 2; |
|
| 186 | + $buffer[$offset + 1] = chr(0xff&$assembledTwoBytes); |
|
| 187 | + $offset += 2; |
|
| 188 | 188 | $length--; |
| 189 | 189 | } |
| 190 | 190 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $len = strlen($this->data); |
| 122 | 122 | |
| 123 | 123 | for($i = 0; $i + 1 < $len; $i += 2){ |
| 124 | - $c = ((0xff & ord($this->data[$i])) << 8) | (0xff & ord($this->data[$i + 1])); |
|
| 124 | + $c = ((0xff & ord($this->data[$i])) << 8)|(0xff & ord($this->data[$i + 1])); |
|
| 125 | 125 | |
| 126 | 126 | if($c >= 0xa1a1 && $c <= 0xaafe){ |
| 127 | 127 | $c -= 0x0a1a1; |
@@ -161,15 +161,15 @@ discard block |
||
| 161 | 161 | while($length > 0){ |
| 162 | 162 | // Each 13 bits encodes a 2-byte character |
| 163 | 163 | $twoBytes = $bitBuffer->read(13); |
| 164 | - $assembledTwoBytes = (($twoBytes / 0x060) << 8) | ($twoBytes % 0x060); |
|
| 164 | + $assembledTwoBytes = (($twoBytes / 0x060) << 8)|($twoBytes % 0x060); |
|
| 165 | 165 | |
| 166 | 166 | $assembledTwoBytes += ($assembledTwoBytes < 0x00a00) // 0x003BF |
| 167 | 167 | ? 0x0a1a1 // In the 0xA1A1 to 0xAAFE range |
| 168 | 168 | : 0x0a6a1; // In the 0xB0A1 to 0xFAFE range |
| 169 | 169 | |
| 170 | 170 | $buffer[$offset] = chr(0xff & ($assembledTwoBytes >> 8)); |
| 171 | - $buffer[$offset + 1] = chr(0xff & $assembledTwoBytes); |
|
| 172 | - $offset += 2; |
|
| 171 | + $buffer[$offset + 1] = chr(0xff&$assembledTwoBytes); |
|
| 172 | + $offset += 2; |
|
| 173 | 173 | $length--; |
| 174 | 174 | } |
| 175 | 175 | |