Passed
Push — main ( dee23c...12d0ed )
by smiley
02:20
created
src/Common/EccLevel.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -37,46 +37,46 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	private const MAX_BITS = [
39 39
 	//	[    L,     M,     Q,     H]  // v  => modules
40
-		[    0,     0,     0,     0], // 0  =>  will be ignored, index starts at 1
41
-		[  152,   128,   104,    72], // 1  =>  21
42
-		[  272,   224,   176,   128], // 2  =>  25
43
-		[  440,   352,   272,   208], // 3  =>  29
44
-		[  640,   512,   384,   288], // 4  =>  33
45
-		[  864,   688,   496,   368], // 5  =>  37
46
-		[ 1088,   864,   608,   480], // 6  =>  41
47
-		[ 1248,   992,   704,   528], // 7  =>  45
48
-		[ 1552,  1232,   880,   688], // 8  =>  49
49
-		[ 1856,  1456,  1056,   800], // 9  =>  53
50
-		[ 2192,  1728,  1232,   976], // 10 =>  57
51
-		[ 2592,  2032,  1440,  1120], // 11 =>  61
52
-		[ 2960,  2320,  1648,  1264], // 12 =>  65
53
-		[ 3424,  2672,  1952,  1440], // 13 =>  69 NICE!
54
-		[ 3688,  2920,  2088,  1576], // 14 =>  73
55
-		[ 4184,  3320,  2360,  1784], // 15 =>  77
56
-		[ 4712,  3624,  2600,  2024], // 16 =>  81
57
-		[ 5176,  4056,  2936,  2264], // 17 =>  85
58
-		[ 5768,  4504,  3176,  2504], // 18 =>  89
59
-		[ 6360,  5016,  3560,  2728], // 19 =>  93
60
-		[ 6888,  5352,  3880,  3080], // 20 =>  97
61
-		[ 7456,  5712,  4096,  3248], // 21 => 101
62
-		[ 8048,  6256,  4544,  3536], // 22 => 105
63
-		[ 8752,  6880,  4912,  3712], // 23 => 109
64
-		[ 9392,  7312,  5312,  4112], // 24 => 113
65
-		[10208,  8000,  5744,  4304], // 25 => 117
66
-		[10960,  8496,  6032,  4768], // 26 => 121
67
-		[11744,  9024,  6464,  5024], // 27 => 125
68
-		[12248,  9544,  6968,  5288], // 28 => 129
69
-		[13048, 10136,  7288,  5608], // 29 => 133
70
-		[13880, 10984,  7880,  5960], // 30 => 137
71
-		[14744, 11640,  8264,  6344], // 31 => 141
72
-		[15640, 12328,  8920,  6760], // 32 => 145
73
-		[16568, 13048,  9368,  7208], // 33 => 149
74
-		[17528, 13800,  9848,  7688], // 34 => 153
75
-		[18448, 14496, 10288,  7888], // 35 => 157
76
-		[19472, 15312, 10832,  8432], // 36 => 161
77
-		[20528, 15936, 11408,  8768], // 37 => 165
78
-		[21616, 16816, 12016,  9136], // 38 => 169
79
-		[22496, 17728, 12656,  9776], // 39 => 173
40
+		[0, 0, 0, 0], // 0  =>  will be ignored, index starts at 1
41
+		[152, 128, 104, 72], // 1  =>  21
42
+		[272, 224, 176, 128], // 2  =>  25
43
+		[440, 352, 272, 208], // 3  =>  29
44
+		[640, 512, 384, 288], // 4  =>  33
45
+		[864, 688, 496, 368], // 5  =>  37
46
+		[1088, 864, 608, 480], // 6  =>  41
47
+		[1248, 992, 704, 528], // 7  =>  45
48
+		[1552, 1232, 880, 688], // 8  =>  49
49
+		[1856, 1456, 1056, 800], // 9  =>  53
50
+		[2192, 1728, 1232, 976], // 10 =>  57
51
+		[2592, 2032, 1440, 1120], // 11 =>  61
52
+		[2960, 2320, 1648, 1264], // 12 =>  65
53
+		[3424, 2672, 1952, 1440], // 13 =>  69 NICE!
54
+		[3688, 2920, 2088, 1576], // 14 =>  73
55
+		[4184, 3320, 2360, 1784], // 15 =>  77
56
+		[4712, 3624, 2600, 2024], // 16 =>  81
57
+		[5176, 4056, 2936, 2264], // 17 =>  85
58
+		[5768, 4504, 3176, 2504], // 18 =>  89
59
+		[6360, 5016, 3560, 2728], // 19 =>  93
60
+		[6888, 5352, 3880, 3080], // 20 =>  97
61
+		[7456, 5712, 4096, 3248], // 21 => 101
62
+		[8048, 6256, 4544, 3536], // 22 => 105
63
+		[8752, 6880, 4912, 3712], // 23 => 109
64
+		[9392, 7312, 5312, 4112], // 24 => 113
65
+		[10208, 8000, 5744, 4304], // 25 => 117
66
+		[10960, 8496, 6032, 4768], // 26 => 121
67
+		[11744, 9024, 6464, 5024], // 27 => 125
68
+		[12248, 9544, 6968, 5288], // 28 => 129
69
+		[13048, 10136, 7288, 5608], // 29 => 133
70
+		[13880, 10984, 7880, 5960], // 30 => 137
71
+		[14744, 11640, 8264, 6344], // 31 => 141
72
+		[15640, 12328, 8920, 6760], // 32 => 145
73
+		[16568, 13048, 9368, 7208], // 33 => 149
74
+		[17528, 13800, 9848, 7688], // 34 => 153
75
+		[18448, 14496, 10288, 7888], // 35 => 157
76
+		[19472, 15312, 10832, 8432], // 36 => 161
77
+		[20528, 15936, 11408, 8768], // 37 => 165
78
+		[21616, 16816, 12016, 9136], // 38 => 169
79
+		[22496, 17728, 12656, 9776], // 39 => 173
80 80
 		[23648, 18672, 13328, 10208], // 40 => 177
81 81
 	];
82 82
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * @var int[][]
89 89
 	 */
90 90
 	private const FORMAT_PATTERN = [
91
-		[ // L
91
+		[// L
92 92
 		  0b111011111000100,
93 93
 		  0b111001011110011,
94 94
 		  0b111110110101010,
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		  0b110110001000001,
99 99
 		  0b110100101110110,
100 100
 		],
101
-		[ // M
101
+		[// M
102 102
 		  0b101010000010010,
103 103
 		  0b101000100100101,
104 104
 		  0b101111001111100,
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		  0b100111110010111,
109 109
 		  0b100101010100000,
110 110
 		],
111
-		[ // Q
111
+		[// Q
112 112
 		  0b011010101011111,
113 113
 		  0b011000001101000,
114 114
 		  0b011111100110001,
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		  0b010111011011010,
119 119
 		  0b010101111101101,
120 120
 		],
121
-		[ // H
121
+		[// H
122 122
 		  0b001011010001001,
123 123
 		  0b001001110111110,
124 124
 		  0b001110011100111,
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	public function __construct(int $eccLevel){
152 152
 
153
-		if((0b11 & $eccLevel) !== $eccLevel){
153
+		if((0b11&$eccLevel) !== $eccLevel){
154 154
 			throw new QRCodeException('invalid ECC level');
155 155
 		}
156 156
 
Please login to merge, or discard this patch.
src/Data/QRMatrix.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	protected const neighbours = [
75 75
 		0b00000001 => [-1, -1],
76
-		0b00000010 => [ 0, -1],
77
-		0b00000100 => [ 1, -1],
78
-		0b00001000 => [ 1,  0],
79
-		0b00010000 => [ 1,  1],
80
-		0b00100000 => [ 0,  1],
81
-		0b01000000 => [-1,  1],
82
-		0b10000000 => [-1,  0],
76
+		0b00000010 => [0, -1],
77
+		0b00000100 => [1, -1],
78
+		0b00001000 => [1, 0],
79
+		0b00010000 => [1, 1],
80
+		0b00100000 => [0, 1],
81
+		0b01000000 => [-1, 1],
82
+		0b10000000 => [-1, 0],
83 83
 	];
84 84
 
85 85
 	/**
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	/**
179 179
 	 * Returns the current version number
180 180
 	 */
181
-	public function getVersion():?Version{
181
+	public function getVersion(): ?Version{
182 182
 		return $this->version;
183 183
 	}
184 184
 
@@ -187,14 +187,14 @@  discard block
 block discarded – undo
187 187
 	 * @see \chillerlan\QRCode\Data\QRMatrix::getVersion()
188 188
 	 * @codeCoverageIgnore
189 189
 	 */
190
-	public function version():?Version{
190
+	public function version(): ?Version{
191 191
 		return $this->getVersion();
192 192
 	}
193 193
 
194 194
 	/**
195 195
 	 * Returns the current ECC level
196 196
 	 */
197
-	public function getEccLevel():?EccLevel{
197
+	public function getEccLevel(): ?EccLevel{
198 198
 		return $this->eccLevel;
199 199
 	}
200 200
 
@@ -203,14 +203,14 @@  discard block
 block discarded – undo
203 203
 	 * @see \chillerlan\QRCode\Data\QRMatrix::getEccLevel()
204 204
 	 * @codeCoverageIgnore
205 205
 	 */
206
-	public function eccLevel():?EccLevel{
206
+	public function eccLevel(): ?EccLevel{
207 207
 		return $this->getEccLevel();
208 208
 	}
209 209
 
210 210
 	/**
211 211
 	 * Returns the current mask pattern
212 212
 	 */
213
-	public function getMaskPattern():?MaskPattern{
213
+	public function getMaskPattern(): ?MaskPattern{
214 214
 		return $this->maskPattern;
215 215
 	}
216 216
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 	 * @see \chillerlan\QRCode\Data\QRMatrix::getMaskPattern()
220 220
 	 * @codeCoverageIgnore
221 221
 	 */
222
-	public function maskPattern():?MaskPattern{
222
+	public function maskPattern(): ?MaskPattern{
223 223
 		return $this->getMaskPattern();
224 224
 	}
225 225
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	public function set(int $x, int $y, bool $value, int $M_TYPE):self{
263 263
 
264 264
 		if(isset($this->matrix[$y][$x])){
265
-			$this->matrix[$y][$x] = (($M_TYPE & ~$this::IS_DARK) | (($value) ? $this::IS_DARK : 0));
265
+			$this->matrix[$y][$x] = (($M_TYPE & ~$this::IS_DARK)|(($value) ? $this::IS_DARK : 0));
266 266
 		}
267 267
 
268 268
 		return $this;
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 			return false;
295 295
 		}
296 296
 
297
-		return ($val & $M_TYPE) === $M_TYPE;
297
+		return ($val&$M_TYPE) === $M_TYPE;
298 298
 	}
299 299
 
300 300
 	/**
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
 
408 408
 		for($c = 0; $c < 3; $c++){
409 409
 			for($i = 0; $i < 8; $i++){
410
-				$this->set($h[$c][0]     , ($h[$c][1] + $i), false, $this::M_SEPARATOR);
411
-				$this->set(($v[$c][0] - $i), $v[$c][1]     , false, $this::M_SEPARATOR);
410
+				$this->set($h[$c][0], ($h[$c][1] + $i), false, $this::M_SEPARATOR);
411
+				$this->set(($v[$c][0] - $i), $v[$c][1], false, $this::M_SEPARATOR);
412 412
 			}
413 413
 		}
414 414
 
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 		for($y = $startY; $y < $endY; $y++){
640 640
 			for($x = $startX; $x < $endX; $x++){
641 641
 				// out of bounds, skip
642
-				if($x < $start || $y < $start ||$x >= $end || $y >= $end){
642
+				if($x < $start || $y < $start || $x >= $end || $y >= $end){
643 643
 					continue;
644 644
 				}
645 645
 
@@ -707,12 +707,12 @@  discard block
 block discarded – undo
707 707
 		foreach($this->matrix as $y => $row){
708 708
 			foreach($row as $x => $val){
709 709
 				// skip non-data modules
710
-				if(($val & $this::M_DATA) !== $this::M_DATA){
710
+				if(($val&$this::M_DATA) !== $this::M_DATA){
711 711
 					continue;
712 712
 				}
713 713
 
714 714
 				if($mask($x, $y)){
715
-					$this->set($x, $y, ($val & $this::IS_DARK) !== $this::IS_DARK, $val);
715
+					$this->set($x, $y, ($val&$this::IS_DARK) !== $this::IS_DARK, $val);
716 716
 				}
717 717
 			}
718 718
 		}
Please login to merge, or discard this patch.