Passed
Push — main ( a1f051...4bdfa7 )
by smiley
02:03
created
src/Decoder/Decoder.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,8 @@
 block discarded – undo
163 163
 		$str = AlphaNum::decodeSegment($this->bitBuffer, $versionNumber);
164 164
 
165 165
 		// See section 6.4.8.1, 6.4.8.2
166
-		if($fc1InEffect){ // ???
166
+		if($fc1InEffect){
167
+// ???
167 168
 			// We need to massage the result a bit if in an FNC1 mode:
168 169
 			$str = str_replace(chr(0x1d), '%', $str);
169 170
 			$str = str_replace('%%', '%', $str);
Please login to merge, or discard this patch.
src/Decoder/BitMatrix.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -220,8 +220,8 @@  discard block
 block discarded – undo
220 220
 			// Should return null, but, some QR codes apparently do not mask this info.
221 221
 			// Try again by actually masking the pattern first.
222 222
 			$formatInfo = $this->doDecodeFormatInformation(
223
-				($formatInfoBits1 ^ $this::FORMAT_INFO_MASK_QR),
224
-				($formatInfoBits2 ^ $this::FORMAT_INFO_MASK_QR)
223
+				($formatInfoBits1^$this::FORMAT_INFO_MASK_QR),
224
+				($formatInfoBits2^$this::FORMAT_INFO_MASK_QR)
225 225
 			);
226 226
 
227 227
 			// still nothing???
@@ -246,13 +246,13 @@  discard block
 block discarded – undo
246 246
 			? $this->check($j, $i)
247 247
 			: $this->check($i, $j);
248 248
 
249
-		return ($bit) ? (($versionBits << 1) | 0x1) : ($versionBits << 1);
249
+		return ($bit) ? (($versionBits << 1)|0x1) : ($versionBits << 1);
250 250
 	}
251 251
 
252 252
 	/**
253 253
 	 * Returns information about the format it specifies, or null if it doesn't seem to match any known pattern
254 254
 	 */
255
-	private function doDecodeFormatInformation(int $maskedFormatInfo1, int $maskedFormatInfo2):?int{
255
+	private function doDecodeFormatInformation(int $maskedFormatInfo1, int $maskedFormatInfo2): ?int{
256 256
 		$bestDifference = PHP_INT_MAX;
257 257
 		$bestFormatInfo = 0;
258 258
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 	/**
349 349
 	 * Decodes the version information from the given bit sequence, returns null if no valid match is found.
350 350
 	 */
351
-	private function decodeVersionInformation(int $versionBits):?Version{
351
+	private function decodeVersionInformation(int $versionBits): ?Version{
352 352
 		$bestDifference = PHP_INT_MAX;
353 353
 		$bestVersion    = 0;
354 354
 
Please login to merge, or discard this patch.
src/Common/Version.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 		18 => [6, 30, 56, 82],
55 55
 		19 => [6, 30, 58, 86],
56 56
 		20 => [6, 34, 62, 90],
57
-		21 => [6, 28, 50, 72,  94],
58
-		22 => [6, 26, 50, 74,  98],
57
+		21 => [6, 28, 50, 72, 94],
58
+		22 => [6, 26, 50, 74, 98],
59 59
 		23 => [6, 30, 54, 78, 102],
60 60
 		24 => [6, 28, 54, 80, 106],
61 61
 		25 => [6, 32, 58, 84, 110],
62 62
 		26 => [6, 30, 58, 86, 114],
63 63
 		27 => [6, 34, 62, 90, 118],
64
-		28 => [6, 26, 50, 74,  98, 122],
64
+		28 => [6, 26, 50, 74, 98, 122],
65 65
 		29 => [6, 30, 54, 78, 102, 126],
66 66
 		30 => [6, 26, 52, 78, 104, 130],
67 67
 		31 => [6, 30, 56, 82, 108, 134],
@@ -126,46 +126,46 @@  discard block
 block discarded – undo
126 126
 	 * @see http://www.thonky.com/qr-code-tutorial/error-correction-table
127 127
 	 */
128 128
 	private const RSBLOCKS = [
129
-		1  => [[ 7, [[ 1,  19], [ 0,   0]]], [10, [[ 1, 16], [ 0,  0]]], [13, [[ 1, 13], [ 0,  0]]], [17, [[ 1,  9], [ 0,  0]]]],
130
-		2  => [[10, [[ 1,  34], [ 0,   0]]], [16, [[ 1, 28], [ 0,  0]]], [22, [[ 1, 22], [ 0,  0]]], [28, [[ 1, 16], [ 0,  0]]]],
131
-		3  => [[15, [[ 1,  55], [ 0,   0]]], [26, [[ 1, 44], [ 0,  0]]], [18, [[ 2, 17], [ 0,  0]]], [22, [[ 2, 13], [ 0,  0]]]],
132
-		4  => [[20, [[ 1,  80], [ 0,   0]]], [18, [[ 2, 32], [ 0,  0]]], [26, [[ 2, 24], [ 0,  0]]], [16, [[ 4,  9], [ 0,  0]]]],
133
-		5  => [[26, [[ 1, 108], [ 0,   0]]], [24, [[ 2, 43], [ 0,  0]]], [18, [[ 2, 15], [ 2, 16]]], [22, [[ 2, 11], [ 2, 12]]]],
134
-		6  => [[18, [[ 2,  68], [ 0,   0]]], [16, [[ 4, 27], [ 0,  0]]], [24, [[ 4, 19], [ 0,  0]]], [28, [[ 4, 15], [ 0,  0]]]],
135
-		7  => [[20, [[ 2,  78], [ 0,   0]]], [18, [[ 4, 31], [ 0,  0]]], [18, [[ 2, 14], [ 4, 15]]], [26, [[ 4, 13], [ 1, 14]]]],
136
-		8  => [[24, [[ 2,  97], [ 0,   0]]], [22, [[ 2, 38], [ 2, 39]]], [22, [[ 4, 18], [ 2, 19]]], [26, [[ 4, 14], [ 2, 15]]]],
137
-		9  => [[30, [[ 2, 116], [ 0,   0]]], [22, [[ 3, 36], [ 2, 37]]], [20, [[ 4, 16], [ 4, 17]]], [24, [[ 4, 12], [ 4, 13]]]],
138
-		10 => [[18, [[ 2,  68], [ 2,  69]]], [26, [[ 4, 43], [ 1, 44]]], [24, [[ 6, 19], [ 2, 20]]], [28, [[ 6, 15], [ 2, 16]]]],
139
-		11 => [[20, [[ 4,  81], [ 0,   0]]], [30, [[ 1, 50], [ 4, 51]]], [28, [[ 4, 22], [ 4, 23]]], [24, [[ 3, 12], [ 8, 13]]]],
140
-		12 => [[24, [[ 2,  92], [ 2,  93]]], [22, [[ 6, 36], [ 2, 37]]], [26, [[ 4, 20], [ 6, 21]]], [28, [[ 7, 14], [ 4, 15]]]],
141
-		13 => [[26, [[ 4, 107], [ 0,   0]]], [22, [[ 8, 37], [ 1, 38]]], [24, [[ 8, 20], [ 4, 21]]], [22, [[12, 11], [ 4, 12]]]],
142
-		14 => [[30, [[ 3, 115], [ 1, 116]]], [24, [[ 4, 40], [ 5, 41]]], [20, [[11, 16], [ 5, 17]]], [24, [[11, 12], [ 5, 13]]]],
143
-		15 => [[22, [[ 5,  87], [ 1,  88]]], [24, [[ 5, 41], [ 5, 42]]], [30, [[ 5, 24], [ 7, 25]]], [24, [[11, 12], [ 7, 13]]]],
144
-		16 => [[24, [[ 5,  98], [ 1,  99]]], [28, [[ 7, 45], [ 3, 46]]], [24, [[15, 19], [ 2, 20]]], [30, [[ 3, 15], [13, 16]]]],
145
-		17 => [[28, [[ 1, 107], [ 5, 108]]], [28, [[10, 46], [ 1, 47]]], [28, [[ 1, 22], [15, 23]]], [28, [[ 2, 14], [17, 15]]]],
146
-		18 => [[30, [[ 5, 120], [ 1, 121]]], [26, [[ 9, 43], [ 4, 44]]], [28, [[17, 22], [ 1, 23]]], [28, [[ 2, 14], [19, 15]]]],
147
-		19 => [[28, [[ 3, 113], [ 4, 114]]], [26, [[ 3, 44], [11, 45]]], [26, [[17, 21], [ 4, 22]]], [26, [[ 9, 13], [16, 14]]]],
148
-		20 => [[28, [[ 3, 107], [ 5, 108]]], [26, [[ 3, 41], [13, 42]]], [30, [[15, 24], [ 5, 25]]], [28, [[15, 15], [10, 16]]]],
149
-		21 => [[28, [[ 4, 116], [ 4, 117]]], [26, [[17, 42], [ 0,  0]]], [28, [[17, 22], [ 6, 23]]], [30, [[19, 16], [ 6, 17]]]],
150
-		22 => [[28, [[ 2, 111], [ 7, 112]]], [28, [[17, 46], [ 0,  0]]], [30, [[ 7, 24], [16, 25]]], [24, [[34, 13], [ 0,  0]]]],
151
-		23 => [[30, [[ 4, 121], [ 5, 122]]], [28, [[ 4, 47], [14, 48]]], [30, [[11, 24], [14, 25]]], [30, [[16, 15], [14, 16]]]],
152
-		24 => [[30, [[ 6, 117], [ 4, 118]]], [28, [[ 6, 45], [14, 46]]], [30, [[11, 24], [16, 25]]], [30, [[30, 16], [ 2, 17]]]],
153
-		25 => [[26, [[ 8, 106], [ 4, 107]]], [28, [[ 8, 47], [13, 48]]], [30, [[ 7, 24], [22, 25]]], [30, [[22, 15], [13, 16]]]],
154
-		26 => [[28, [[10, 114], [ 2, 115]]], [28, [[19, 46], [ 4, 47]]], [28, [[28, 22], [ 6, 23]]], [30, [[33, 16], [ 4, 17]]]],
155
-		27 => [[30, [[ 8, 122], [ 4, 123]]], [28, [[22, 45], [ 3, 46]]], [30, [[ 8, 23], [26, 24]]], [30, [[12, 15], [28, 16]]]],
156
-		28 => [[30, [[ 3, 117], [10, 118]]], [28, [[ 3, 45], [23, 46]]], [30, [[ 4, 24], [31, 25]]], [30, [[11, 15], [31, 16]]]],
157
-		29 => [[30, [[ 7, 116], [ 7, 117]]], [28, [[21, 45], [ 7, 46]]], [30, [[ 1, 23], [37, 24]]], [30, [[19, 15], [26, 16]]]],
158
-		30 => [[30, [[ 5, 115], [10, 116]]], [28, [[19, 47], [10, 48]]], [30, [[15, 24], [25, 25]]], [30, [[23, 15], [25, 16]]]],
159
-		31 => [[30, [[13, 115], [ 3, 116]]], [28, [[ 2, 46], [29, 47]]], [30, [[42, 24], [ 1, 25]]], [30, [[23, 15], [28, 16]]]],
160
-		32 => [[30, [[17, 115], [ 0,   0]]], [28, [[10, 46], [23, 47]]], [30, [[10, 24], [35, 25]]], [30, [[19, 15], [35, 16]]]],
161
-		33 => [[30, [[17, 115], [ 1, 116]]], [28, [[14, 46], [21, 47]]], [30, [[29, 24], [19, 25]]], [30, [[11, 15], [46, 16]]]],
162
-		34 => [[30, [[13, 115], [ 6, 116]]], [28, [[14, 46], [23, 47]]], [30, [[44, 24], [ 7, 25]]], [30, [[59, 16], [ 1, 17]]]],
163
-		35 => [[30, [[12, 121], [ 7, 122]]], [28, [[12, 47], [26, 48]]], [30, [[39, 24], [14, 25]]], [30, [[22, 15], [41, 16]]]],
164
-		36 => [[30, [[ 6, 121], [14, 122]]], [28, [[ 6, 47], [34, 48]]], [30, [[46, 24], [10, 25]]], [30, [[ 2, 15], [64, 16]]]],
165
-		37 => [[30, [[17, 122], [ 4, 123]]], [28, [[29, 46], [14, 47]]], [30, [[49, 24], [10, 25]]], [30, [[24, 15], [46, 16]]]],
166
-		38 => [[30, [[ 4, 122], [18, 123]]], [28, [[13, 46], [32, 47]]], [30, [[48, 24], [14, 25]]], [30, [[42, 15], [32, 16]]]],
167
-		39 => [[30, [[20, 117], [ 4, 118]]], [28, [[40, 47], [ 7, 48]]], [30, [[43, 24], [22, 25]]], [30, [[10, 15], [67, 16]]]],
168
-		40 => [[30, [[19, 118], [ 6, 119]]], [28, [[18, 47], [31, 48]]], [30, [[34, 24], [34, 25]]], [30, [[20, 15], [61, 16]]]],
129
+		1  => [[7, [[1, 19], [0, 0]]], [10, [[1, 16], [0, 0]]], [13, [[1, 13], [0, 0]]], [17, [[1, 9], [0, 0]]]],
130
+		2  => [[10, [[1, 34], [0, 0]]], [16, [[1, 28], [0, 0]]], [22, [[1, 22], [0, 0]]], [28, [[1, 16], [0, 0]]]],
131
+		3  => [[15, [[1, 55], [0, 0]]], [26, [[1, 44], [0, 0]]], [18, [[2, 17], [0, 0]]], [22, [[2, 13], [0, 0]]]],
132
+		4  => [[20, [[1, 80], [0, 0]]], [18, [[2, 32], [0, 0]]], [26, [[2, 24], [0, 0]]], [16, [[4, 9], [0, 0]]]],
133
+		5  => [[26, [[1, 108], [0, 0]]], [24, [[2, 43], [0, 0]]], [18, [[2, 15], [2, 16]]], [22, [[2, 11], [2, 12]]]],
134
+		6  => [[18, [[2, 68], [0, 0]]], [16, [[4, 27], [0, 0]]], [24, [[4, 19], [0, 0]]], [28, [[4, 15], [0, 0]]]],
135
+		7  => [[20, [[2, 78], [0, 0]]], [18, [[4, 31], [0, 0]]], [18, [[2, 14], [4, 15]]], [26, [[4, 13], [1, 14]]]],
136
+		8  => [[24, [[2, 97], [0, 0]]], [22, [[2, 38], [2, 39]]], [22, [[4, 18], [2, 19]]], [26, [[4, 14], [2, 15]]]],
137
+		9  => [[30, [[2, 116], [0, 0]]], [22, [[3, 36], [2, 37]]], [20, [[4, 16], [4, 17]]], [24, [[4, 12], [4, 13]]]],
138
+		10 => [[18, [[2, 68], [2, 69]]], [26, [[4, 43], [1, 44]]], [24, [[6, 19], [2, 20]]], [28, [[6, 15], [2, 16]]]],
139
+		11 => [[20, [[4, 81], [0, 0]]], [30, [[1, 50], [4, 51]]], [28, [[4, 22], [4, 23]]], [24, [[3, 12], [8, 13]]]],
140
+		12 => [[24, [[2, 92], [2, 93]]], [22, [[6, 36], [2, 37]]], [26, [[4, 20], [6, 21]]], [28, [[7, 14], [4, 15]]]],
141
+		13 => [[26, [[4, 107], [0, 0]]], [22, [[8, 37], [1, 38]]], [24, [[8, 20], [4, 21]]], [22, [[12, 11], [4, 12]]]],
142
+		14 => [[30, [[3, 115], [1, 116]]], [24, [[4, 40], [5, 41]]], [20, [[11, 16], [5, 17]]], [24, [[11, 12], [5, 13]]]],
143
+		15 => [[22, [[5, 87], [1, 88]]], [24, [[5, 41], [5, 42]]], [30, [[5, 24], [7, 25]]], [24, [[11, 12], [7, 13]]]],
144
+		16 => [[24, [[5, 98], [1, 99]]], [28, [[7, 45], [3, 46]]], [24, [[15, 19], [2, 20]]], [30, [[3, 15], [13, 16]]]],
145
+		17 => [[28, [[1, 107], [5, 108]]], [28, [[10, 46], [1, 47]]], [28, [[1, 22], [15, 23]]], [28, [[2, 14], [17, 15]]]],
146
+		18 => [[30, [[5, 120], [1, 121]]], [26, [[9, 43], [4, 44]]], [28, [[17, 22], [1, 23]]], [28, [[2, 14], [19, 15]]]],
147
+		19 => [[28, [[3, 113], [4, 114]]], [26, [[3, 44], [11, 45]]], [26, [[17, 21], [4, 22]]], [26, [[9, 13], [16, 14]]]],
148
+		20 => [[28, [[3, 107], [5, 108]]], [26, [[3, 41], [13, 42]]], [30, [[15, 24], [5, 25]]], [28, [[15, 15], [10, 16]]]],
149
+		21 => [[28, [[4, 116], [4, 117]]], [26, [[17, 42], [0, 0]]], [28, [[17, 22], [6, 23]]], [30, [[19, 16], [6, 17]]]],
150
+		22 => [[28, [[2, 111], [7, 112]]], [28, [[17, 46], [0, 0]]], [30, [[7, 24], [16, 25]]], [24, [[34, 13], [0, 0]]]],
151
+		23 => [[30, [[4, 121], [5, 122]]], [28, [[4, 47], [14, 48]]], [30, [[11, 24], [14, 25]]], [30, [[16, 15], [14, 16]]]],
152
+		24 => [[30, [[6, 117], [4, 118]]], [28, [[6, 45], [14, 46]]], [30, [[11, 24], [16, 25]]], [30, [[30, 16], [2, 17]]]],
153
+		25 => [[26, [[8, 106], [4, 107]]], [28, [[8, 47], [13, 48]]], [30, [[7, 24], [22, 25]]], [30, [[22, 15], [13, 16]]]],
154
+		26 => [[28, [[10, 114], [2, 115]]], [28, [[19, 46], [4, 47]]], [28, [[28, 22], [6, 23]]], [30, [[33, 16], [4, 17]]]],
155
+		27 => [[30, [[8, 122], [4, 123]]], [28, [[22, 45], [3, 46]]], [30, [[8, 23], [26, 24]]], [30, [[12, 15], [28, 16]]]],
156
+		28 => [[30, [[3, 117], [10, 118]]], [28, [[3, 45], [23, 46]]], [30, [[4, 24], [31, 25]]], [30, [[11, 15], [31, 16]]]],
157
+		29 => [[30, [[7, 116], [7, 117]]], [28, [[21, 45], [7, 46]]], [30, [[1, 23], [37, 24]]], [30, [[19, 15], [26, 16]]]],
158
+		30 => [[30, [[5, 115], [10, 116]]], [28, [[19, 47], [10, 48]]], [30, [[15, 24], [25, 25]]], [30, [[23, 15], [25, 16]]]],
159
+		31 => [[30, [[13, 115], [3, 116]]], [28, [[2, 46], [29, 47]]], [30, [[42, 24], [1, 25]]], [30, [[23, 15], [28, 16]]]],
160
+		32 => [[30, [[17, 115], [0, 0]]], [28, [[10, 46], [23, 47]]], [30, [[10, 24], [35, 25]]], [30, [[19, 15], [35, 16]]]],
161
+		33 => [[30, [[17, 115], [1, 116]]], [28, [[14, 46], [21, 47]]], [30, [[29, 24], [19, 25]]], [30, [[11, 15], [46, 16]]]],
162
+		34 => [[30, [[13, 115], [6, 116]]], [28, [[14, 46], [23, 47]]], [30, [[44, 24], [7, 25]]], [30, [[59, 16], [1, 17]]]],
163
+		35 => [[30, [[12, 121], [7, 122]]], [28, [[12, 47], [26, 48]]], [30, [[39, 24], [14, 25]]], [30, [[22, 15], [41, 16]]]],
164
+		36 => [[30, [[6, 121], [14, 122]]], [28, [[6, 47], [34, 48]]], [30, [[46, 24], [10, 25]]], [30, [[2, 15], [64, 16]]]],
165
+		37 => [[30, [[17, 122], [4, 123]]], [28, [[29, 46], [14, 47]]], [30, [[49, 24], [10, 25]]], [30, [[24, 15], [46, 16]]]],
166
+		38 => [[30, [[4, 122], [18, 123]]], [28, [[13, 46], [32, 47]]], [30, [[48, 24], [14, 25]]], [30, [[42, 15], [32, 16]]]],
167
+		39 => [[30, [[20, 117], [4, 118]]], [28, [[40, 47], [7, 48]]], [30, [[43, 24], [22, 25]]], [30, [[10, 15], [67, 16]]]],
168
+		40 => [[30, [[19, 118], [6, 119]]], [28, [[18, 47], [31, 48]]], [30, [[34, 24], [34, 25]]], [30, [[20, 15], [61, 16]]]],
169 169
 	];
170 170
 
171 171
 	/**
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	/**
258 258
 	 * the version pattern for the given version
259 259
 	 */
260
-	public function getVersionPattern():?int{
260
+	public function getVersionPattern(): ?int{
261 261
 		return (self::VERSION_PATTERN[$this->version] ?? null);
262 262
 	}
263 263
 
Please login to merge, or discard this patch.
src/Common/MaskPattern.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 */
68 68
 	public function __construct(int $maskPattern){
69 69
 
70
-		if((0b111 & $maskPattern) !== $maskPattern){
70
+		if((0b111&$maskPattern) !== $maskPattern){
71 71
 			throw new QRCodeException('invalid mask pattern');
72 72
 		}
73 73
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 						$penalty += (3 + ($numSameBitCells - 5));
162 162
 					}
163 163
 
164
-					$numSameBitCells = 1;  // Include the cell itself.
164
+					$numSameBitCells = 1; // Include the cell itself.
165 165
 					$prevBit         = $bit;
166 166
 				}
167 167
 			}
Please login to merge, or discard this patch.
src/Common/BitBuffer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	/**
39 39
 	 * Read count (bits)
40 40
 	 */
41
-	private int $bitsRead  = 0;
41
+	private int $bitsRead = 0;
42 42
 
43 43
 	/**
44 44
 	 * BitBuffer constructor.
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 			$toRead         = min($numBits, $bitsLeft);
125 125
 			$bitsToNotRead  = ($bitsLeft - $toRead);
126 126
 			$mask           = ((0xff >> (8 - $toRead)) << $bitsToNotRead);
127
-			$result         = (($this->buffer[$this->bytesRead] & $mask) >> $bitsToNotRead);
127
+			$result         = (($this->buffer[$this->bytesRead]&$mask) >> $bitsToNotRead);
128 128
 			$numBits        -= $toRead;
129 129
 			$this->bitsRead += $toRead;
130 130
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		if($numBits > 0){
139 139
 
140 140
 			while($numBits >= 8){
141
-				$result = (($result << 8) | ($this->buffer[$this->bytesRead] & 0xff));
141
+				$result = (($result << 8)|($this->buffer[$this->bytesRead] & 0xff));
142 142
 				$this->bytesRead++;
143 143
 				$numBits -= 8;
144 144
 			}
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			if($numBits > 0){
148 148
 				$bitsToNotRead  = (8 - $numBits);
149 149
 				$mask           = ((0xff >> $bitsToNotRead) << $bitsToNotRead);
150
-				$result         = (($result << $numBits) | (($this->buffer[$this->bytesRead] & $mask) >> $bitsToNotRead));
150
+				$result         = (($result << $numBits)|(($this->buffer[$this->bytesRead]&$mask) >> $bitsToNotRead));
151 151
 				$this->bitsRead += $numBits;
152 152
 			}
153 153
 		}
Please login to merge, or discard this patch.
src/Data/Kanji.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 			$byte2 = ord($string[($i + 1)]);
100 100
 
101 101
 			// byte 1 unused and vendor ranges
102
-			if($byte1 < 0x81 || ($byte1 > 0x84 && $byte1 < 0x88) || ($byte1 > 0x9f && $byte1 < 0xe0) ||  $byte1 > 0xea){
102
+			if($byte1 < 0x81 || ($byte1 > 0x84 && $byte1 < 0x88) || ($byte1 > 0x9f && $byte1 < 0xe0) || $byte1 > 0xea){
103 103
 				return false;
104 104
 			}
105 105
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		$len = strlen($this->data);
129 129
 
130 130
 		for($i = 0; ($i + 1) < $len; $i += 2){
131
-			$c = (((0xff & ord($this->data[$i])) << 8) | (0xff & ord($this->data[($i + 1)])));
131
+			$c = (((0xff & ord($this->data[$i])) << 8)|(0xff & ord($this->data[($i + 1)])));
132 132
 
133 133
 			if($c >= 0x8140 && $c <= 0x9ffc){
134 134
 				$c -= 0x8140;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		$length = $bitBuffer->read(self::getLengthBits($versionNumber));
159 159
 
160 160
 		if($bitBuffer->available() < ($length * 13)){
161
-			throw new QRCodeDataException('not enough bits available');  // @codeCoverageIgnore
161
+			throw new QRCodeDataException('not enough bits available'); // @codeCoverageIgnore
162 162
 		}
163 163
 
164 164
 		// Each character will require 2 bytes. Read the characters as 2-byte pairs and decode as SJIS afterwards
@@ -168,15 +168,15 @@  discard block
 block discarded – undo
168 168
 		while($length > 0){
169 169
 			// Each 13 bits encodes a 2-byte character
170 170
 			$twoBytes          = $bitBuffer->read(13);
171
-			$assembledTwoBytes = ((((int)($twoBytes / 0x0c0)) << 8) | ($twoBytes % 0x0c0));
171
+			$assembledTwoBytes = ((((int)($twoBytes / 0x0c0)) << 8)|($twoBytes % 0x0c0));
172 172
 
173 173
 			$assembledTwoBytes += ($assembledTwoBytes < 0x01f00)
174 174
 				? 0x08140  // In the 0x8140 to 0x9FFC range
175 175
 				: 0x0c140; // In the 0xE040 to 0xEBBF range
176 176
 
177 177
 			$buffer[$offset]       = chr(0xff & ($assembledTwoBytes >> 8));
178
-			$buffer[($offset + 1)] = chr(0xff & $assembledTwoBytes);
179
-			$offset                += 2;
178
+			$buffer[($offset + 1)] = chr(0xff&$assembledTwoBytes);
179
+			$offset += 2;
180 180
 			$length--;
181 181
 		}
182 182
 
Please login to merge, or discard this patch.
src/Data/Hanzi.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		$len = strlen($this->data);
132 132
 
133 133
 		for($i = 0; ($i + 1) < $len; $i += 2){
134
-			$c = (((0xff & ord($this->data[$i])) << 8) | (0xff & ord($this->data[($i + 1)])));
134
+			$c = (((0xff & ord($this->data[$i])) << 8)|(0xff & ord($this->data[($i + 1)])));
135 135
 
136 136
 			if($c >= 0xa1a1 && $c <= 0xaafe){
137 137
 				$c -= 0x0a1a1;
@@ -177,15 +177,15 @@  discard block
 block discarded – undo
177 177
 		while($length > 0){
178 178
 			// Each 13 bits encodes a 2-byte character
179 179
 			$twoBytes          = $bitBuffer->read(13);
180
-			$assembledTwoBytes = ((((int)($twoBytes / 0x060)) << 8) | ($twoBytes % 0x060));
180
+			$assembledTwoBytes = ((((int)($twoBytes / 0x060)) << 8)|($twoBytes % 0x060));
181 181
 
182 182
 			$assembledTwoBytes += ($assembledTwoBytes < 0x00a00) // 0x003BF
183 183
 				? 0x0a1a1  // In the 0xA1A1 to 0xAAFE range
184 184
 				: 0x0a6a1; // In the 0xB0A1 to 0xFAFE range
185 185
 
186 186
 			$buffer[$offset]       = chr(0xff & ($assembledTwoBytes >> 8));
187
-			$buffer[($offset + 1)] = chr(0xff & $assembledTwoBytes);
188
-			$offset                += 2;
187
+			$buffer[($offset + 1)] = chr(0xff&$assembledTwoBytes);
188
+			$offset += 2;
189 189
 			$length--;
190 190
 		}
191 191
 
Please login to merge, or discard this patch.
src/Data/ECI.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 			$bitBuffer->put($this->encoding, 8);
74 74
 		}
75 75
 		elseif($this->encoding < 16384){
76
-			$bitBuffer->put(($this->encoding | 0x8000), 16);
76
+			$bitBuffer->put(($this->encoding|0x8000), 16);
77 77
 		}
78 78
 		elseif($this->encoding < 1000000){
79
-			$bitBuffer->put(($this->encoding | 0xC00000), 24);
79
+			$bitBuffer->put(($this->encoding|0xC00000), 24);
80 80
 		}
81 81
 
82 82
 		return $this;
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 		}
97 97
 		// two bytes
98 98
 		elseif(($firstByte & 0b11000000) === 0b10000000){
99
-			$id = ((($firstByte & 0b00111111) << 8) | $bitBuffer->read(8));
99
+			$id = ((($firstByte & 0b00111111) << 8)|$bitBuffer->read(8));
100 100
 		}
101 101
 		// three bytes
102 102
 		elseif(($firstByte & 0b11100000) === 0b11000000){
103
-			$id = ((($firstByte & 0b00011111) << 16) | $bitBuffer->read(16));
103
+			$id = ((($firstByte & 0b00011111) << 16)|$bitBuffer->read(16));
104 104
 		}
105 105
 		else{
106 106
 			throw new QRCodeDataException(sprintf('error decoding ECI value first byte: %08b', $firstByte)); // @codeCoverageIgnore
Please login to merge, or discard this patch.
src/Common/ECICharset.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,16 +19,16 @@  discard block
 block discarded – undo
19 19
  */
20 20
 final class ECICharset{
21 21
 
22
-	public const CP437                 = 0;  // Code page 437, DOS Latin US
23
-	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
24
-	public const CP437_WO_GLI          = 2;  // An equivalent code table to CP437, without the return-to-GLI 0 logic
25
-	public const ISO_IEC_8859_1        = 3;  // Latin-1 (Default)
26
-	public const ISO_IEC_8859_2        = 4;  // Latin-2
27
-	public const ISO_IEC_8859_3        = 5;  // Latin-3
28
-	public const ISO_IEC_8859_4        = 6;  // Latin-4
29
-	public const ISO_IEC_8859_5        = 7;  // Latin/Cyrillic
30
-	public const ISO_IEC_8859_6        = 8;  // Latin/Arabic
31
-	public const ISO_IEC_8859_7        = 9;  // Latin/Greek
22
+	public const CP437                 = 0; // Code page 437, DOS Latin US
23
+	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
24
+	public const CP437_WO_GLI          = 2; // An equivalent code table to CP437, without the return-to-GLI 0 logic
25
+	public const ISO_IEC_8859_1        = 3; // Latin-1 (Default)
26
+	public const ISO_IEC_8859_2        = 4; // Latin-2
27
+	public const ISO_IEC_8859_3        = 5; // Latin-3
28
+	public const ISO_IEC_8859_4        = 6; // Latin-4
29
+	public const ISO_IEC_8859_5        = 7; // Latin/Cyrillic
30
+	public const ISO_IEC_8859_6        = 8; // Latin/Arabic
31
+	public const ISO_IEC_8859_7        = 9; // Latin/Greek
32 32
 	public const ISO_IEC_8859_8        = 10; // Latin/Hebrew
33 33
 	public const ISO_IEC_8859_9        = 11; // Latin-5
34 34
 	public const ISO_IEC_8859_10       = 12; // Latin-6
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 * @see \mb_convert_encoding()
119 119
 	 * @see \iconv()
120 120
 	 */
121
-	public function getName():?string{
121
+	public function getName(): ?string{
122 122
 		return (self::MB_ENCODINGS[$this->charsetID] ?? null);
123 123
 	}
124 124
 
Please login to merge, or discard this patch.