@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | public function __construct(int $maskPattern){ |
51 | 51 | |
52 | - if((0b111 & $maskPattern) !== $maskPattern){ |
|
52 | + if((0b111&$maskPattern) !== $maskPattern){ |
|
53 | 53 | throw new QRCodeException('invalid mask pattern'); |
54 | 54 | } |
55 | 55 |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | |
18 | 18 | class ECICharset{ |
19 | 19 | |
20 | - public const CP437 = 0; // Code page 437, DOS Latin US |
|
21 | - 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 |
|
22 | - public const CP437_WO_GLI = 2; // An equivalent code table to CP437, without the return-to-GLI 0 logic |
|
23 | - public const ISO_IEC_8859_1 = 3; // Latin-1 (Default) |
|
24 | - public const ISO_IEC_8859_2 = 4; // Latin-2 |
|
25 | - public const ISO_IEC_8859_3 = 5; // Latin-3 |
|
26 | - public const ISO_IEC_8859_4 = 6; // Latin-4 |
|
27 | - public const ISO_IEC_8859_5 = 7; // Latin/Cyrillic |
|
28 | - public const ISO_IEC_8859_6 = 8; // Latin/Arabic |
|
29 | - public const ISO_IEC_8859_7 = 9; // Latin/Greek |
|
20 | + public const CP437 = 0; // Code page 437, DOS Latin US |
|
21 | + 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 |
|
22 | + public const CP437_WO_GLI = 2; // An equivalent code table to CP437, without the return-to-GLI 0 logic |
|
23 | + public const ISO_IEC_8859_1 = 3; // Latin-1 (Default) |
|
24 | + public const ISO_IEC_8859_2 = 4; // Latin-2 |
|
25 | + public const ISO_IEC_8859_3 = 5; // Latin-3 |
|
26 | + public const ISO_IEC_8859_4 = 6; // Latin-4 |
|
27 | + public const ISO_IEC_8859_5 = 7; // Latin/Cyrillic |
|
28 | + public const ISO_IEC_8859_6 = 8; // Latin/Arabic |
|
29 | + public const ISO_IEC_8859_7 = 9; // Latin/Greek |
|
30 | 30 | public const ISO_IEC_8859_8 = 10; // Latin/Hebrew |
31 | 31 | public const ISO_IEC_8859_9 = 11; // Latin-5 |
32 | 32 | public const ISO_IEC_8859_10 = 12; // Latin-6 |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | return $this->charsetID; |
102 | 102 | } |
103 | 103 | |
104 | - public function getName():?string{ |
|
104 | + public function getName(): ?string{ |
|
105 | 105 | return self::MB_ENCODINGS[$this->charsetID]; |
106 | 106 | } |
107 | 107 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function put(int $num, int $length):BitBuffer{ |
60 | 60 | |
61 | 61 | for($i = 0; $i < $length; $i++){ |
62 | - $this->putBit((($num >> ($length - $i - 1)) & 1) === 1); |
|
62 | + $this->putBit((($num >> ($length - $i - 1))&1) === 1); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | return $this; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $toRead = $numBits < $bitsLeft ? $numBits : $bitsLeft; |
129 | 129 | $bitsToNotRead = $bitsLeft - $toRead; |
130 | 130 | $mask = (0xff >> (8 - $toRead)) << $bitsToNotRead; |
131 | - $result = ($this->buffer[$this->bytesRead] & $mask) >> $bitsToNotRead; |
|
131 | + $result = ($this->buffer[$this->bytesRead]&$mask) >> $bitsToNotRead; |
|
132 | 132 | $numBits -= $toRead; |
133 | 133 | $this->bitsRead += $toRead; |
134 | 134 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | if($numBits > 0){ |
143 | 143 | |
144 | 144 | while($numBits >= 8){ |
145 | - $result = ($result << 8) | ($this->buffer[$this->bytesRead] & 0xff); |
|
145 | + $result = ($result << 8)|($this->buffer[$this->bytesRead]&0xff); |
|
146 | 146 | $this->bytesRead++; |
147 | 147 | $numBits -= 8; |
148 | 148 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | if($numBits > 0){ |
152 | 152 | $bitsToNotRead = 8 - $numBits; |
153 | 153 | $mask = (0xff >> $bitsToNotRead) << $bitsToNotRead; |
154 | - $result = ($result << $numBits) | (($this->buffer[$this->bytesRead] & $mask) >> $bitsToNotRead); |
|
154 | + $result = ($result << $numBits)|(($this->buffer[$this->bytesRead]&$mask) >> $bitsToNotRead); |
|
155 | 155 | $this->bitsRead += $numBits; |
156 | 156 | } |
157 | 157 | } |