@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ? $this->bitMatrix->get($j, $i) |
71 | 71 | : $this->bitMatrix->get($i, $j); |
72 | 72 | |
73 | - return $bit ? ($versionBits << 1) | 0x1 : $versionBits << 1; |
|
73 | + return $bit ? ($versionBits << 1)|0x1 : $versionBits << 1; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | // Should return null, but, some QR codes apparently do not mask this info. |
190 | 190 | // Try again by actually masking the pattern first. |
191 | 191 | $this->parsedFormatInfo = $this->doDecodeFormatInformation( |
192 | - $formatInfoBits1 ^ FormatInformation::MASK_QR, |
|
193 | - $formatInfoBits2 ^ FormatInformation::MASK_QR |
|
192 | + $formatInfoBits1^FormatInformation::MASK_QR, |
|
193 | + $formatInfoBits2^FormatInformation::MASK_QR |
|
194 | 194 | ); |
195 | 195 | |
196 | 196 | if($this->parsedFormatInfo !== null){ |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | * @return \chillerlan\QRCode\Common\FormatInformation|null information about the format it specifies, or null |
209 | 209 | * if doesn't seem to match any known pattern |
210 | 210 | */ |
211 | - private function doDecodeFormatInformation(int $maskedFormatInfo1, int $maskedFormatInfo2):?FormatInformation{ |
|
211 | + private function doDecodeFormatInformation(int $maskedFormatInfo1, int $maskedFormatInfo2): ?FormatInformation{ |
|
212 | 212 | // Find the int in FORMAT_INFO_DECODE_LOOKUP with fewest bits differing |
213 | 213 | $bestDifference = PHP_INT_MAX; |
214 | 214 | $bestFormatInfo = 0; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | * |
306 | 306 | * @return \chillerlan\QRCode\Common\Version|null |
307 | 307 | */ |
308 | - private function decodeVersionInformation(int $versionBits):?Version{ |
|
308 | + private function decodeVersionInformation(int $versionBits): ?Version{ |
|
309 | 309 | $bestDifference = PHP_INT_MAX; |
310 | 310 | $bestVersion = 0; |
311 | 311 | |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | return $a; |
348 | 348 | } |
349 | 349 | |
350 | - return ($a >> $b) & ~((1 << (8 * PHP_INT_SIZE - 1)) >> ($b - 1)); |
|
350 | + return ($a >> $b)&~((1 << (8 * PHP_INT_SIZE - 1)) >> ($b - 1)); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $count = 0; |
363 | 363 | |
364 | 364 | for($i = 0; $i < 32; $i += 4){ |
365 | - $count += $BITS_SET_IN_HALF_BYTE[self::uRShift($a, $i) & 0x0F]; |
|
365 | + $count += $BITS_SET_IN_HALF_BYTE[self::uRShift($a, $i)&0x0F]; |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | return $count; |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | */ |
19 | 19 | final class ECICharset{ |
20 | 20 | |
21 | - public const CP437 = 0; // Code page 437, DOS Latin US |
|
22 | - public const ISO_IEC_8859_1_GLI = 1; // GLI encoding with characters 0 to 127 identical to ISO/IEC 646 and characters 128 to 255 identical to ISO 8859-1 |
|
23 | - public const CP437_WO_GLI = 2; // An equivalent code table to CP437, without the return-to-GLI 0 logic |
|
24 | - public const ISO_IEC_8859_1 = 3; // Latin-1 (Default) |
|
25 | - public const ISO_IEC_8859_2 = 4; // Latin-2 |
|
26 | - public const ISO_IEC_8859_3 = 5; // Latin-3 |
|
27 | - public const ISO_IEC_8859_4 = 6; // Latin-4 |
|
28 | - public const ISO_IEC_8859_5 = 7; // Latin/Cyrillic |
|
29 | - public const ISO_IEC_8859_6 = 8; // Latin/Arabic |
|
30 | - public const ISO_IEC_8859_7 = 9; // Latin/Greek |
|
21 | + public const CP437 = 0; // Code page 437, DOS Latin US |
|
22 | + public const ISO_IEC_8859_1_GLI = 1; // GLI encoding with characters 0 to 127 identical to ISO/IEC 646 and characters 128 to 255 identical to ISO 8859-1 |
|
23 | + public const CP437_WO_GLI = 2; // An equivalent code table to CP437, without the return-to-GLI 0 logic |
|
24 | + public const ISO_IEC_8859_1 = 3; // Latin-1 (Default) |
|
25 | + public const ISO_IEC_8859_2 = 4; // Latin-2 |
|
26 | + public const ISO_IEC_8859_3 = 5; // Latin-3 |
|
27 | + public const ISO_IEC_8859_4 = 6; // Latin-4 |
|
28 | + public const ISO_IEC_8859_5 = 7; // Latin/Cyrillic |
|
29 | + public const ISO_IEC_8859_6 = 8; // Latin/Arabic |
|
30 | + public const ISO_IEC_8859_7 = 9; // Latin/Greek |
|
31 | 31 | public const ISO_IEC_8859_8 = 10; // Latin/Hebrew |
32 | 32 | public const ISO_IEC_8859_9 = 11; // Latin-5 |
33 | 33 | public const ISO_IEC_8859_10 = 12; // Latin-6 |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | /** |
112 | 112 | * |
113 | 113 | */ |
114 | - public function getName():?string{ |
|
114 | + public function getName(): ?string{ |
|
115 | 115 | return self::MB_ENCODINGS[$this->charsetID]; |
116 | 116 | } |
117 | 117 |
@@ -69,8 +69,8 @@ |
||
69 | 69 | * |
70 | 70 | */ |
71 | 71 | public function __construct(int $formatInfo){ |
72 | - $this->errorCorrectionLevel = ($formatInfo >> 3) & 0x03; // Bits 3,4 |
|
73 | - $this->dataMask = ($formatInfo & 0x07); // Bottom 3 bits |
|
72 | + $this->errorCorrectionLevel = ($formatInfo >> 3)&0x03; // Bits 3,4 |
|
73 | + $this->dataMask = ($formatInfo&0x07); // Bottom 3 bits |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |