Completed
Push — master ( 7ba8ec...9ff756 )
by smiley
02:49
created
src/QRCode.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -41,15 +41,15 @@  discard block
 block discarded – undo
41 41
 	const ERROR_CORRECT_LEVEL_H = 2; // 30%.
42 42
 
43 43
 	// max bits @ ec level L:07 M:15 Q:25 H:30 %
44
-	const TYPE_01 =  1; //  152  128  104   72
45
-	const TYPE_02 =  2; //  272  224  176  128
46
-	const TYPE_03 =  3; //  440  352  272  208
47
-	const TYPE_04 =  4; //  640  512  384  288
48
-	const TYPE_05 =  5; //  864  688  496  368
49
-	const TYPE_06 =  6; // 1088  864  608  480
50
-	const TYPE_07 =  7; // 1248  992  704  528
51
-	const TYPE_08 =  8; // 1552 1232  880  688
52
-	const TYPE_09 =  9; // 1856 1456 1056  800
44
+	const TYPE_01 = 1; //  152  128  104   72
45
+	const TYPE_02 = 2; //  272  224  176  128
46
+	const TYPE_03 = 3; //  440  352  272  208
47
+	const TYPE_04 = 4; //  640  512  384  288
48
+	const TYPE_05 = 5; //  864  688  496  368
49
+	const TYPE_06 = 6; // 1088  864  608  480
50
+	const TYPE_07 = 7; // 1248  992  704  528
51
+	const TYPE_08 = 8; // 1552 1232  880  688
52
+	const TYPE_09 = 9; // 1856 1456 1056  800
53 53
 	const TYPE_10 = 10; // 2192 1728 1232  976
54 54
 
55 55
 	/**
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 			$lostPoint = 0;
196 196
 			$darkCount = 0;
197 197
 
198
-			$range1 = range(0, $this->pixelCount-1);
199
-			$range2 = range(0, $this->pixelCount-2);
200
-			$range3 = range(0, $this->pixelCount-7);
198
+			$range1 = range(0, $this->pixelCount - 1);
199
+			$range2 = range(0, $this->pixelCount - 2);
200
+			$range3 = range(0, $this->pixelCount - 7);
201 201
 
202 202
 			// LEVEL1
203 203
 			foreach($range1 as $row){
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
 					$count = 0;
234 234
 
235 235
 					if(
236
-						   $this->matrix[$row    ][$col    ]
237
-						|| $this->matrix[$row    ][$col + 1]
238
-						|| $this->matrix[$row + 1][$col    ]
236
+						   $this->matrix[$row][$col]
237
+						|| $this->matrix[$row][$col + 1]
238
+						|| $this->matrix[$row + 1][$col]
239 239
 						|| $this->matrix[$row + 1][$col + 1]
240 240
 					){
241 241
 						$count++;
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 			foreach($range1 as $row){
252 252
 				foreach($range3 as $col){
253 253
 					if(
254
-						    $this->matrix[$row][$col    ]
254
+						    $this->matrix[$row][$col]
255 255
 						&& !$this->matrix[$row][$col + 1]
256 256
 						&&  $this->matrix[$row][$col + 2]
257 257
 						&&  $this->matrix[$row][$col + 3]
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 			foreach($range1 as $col){
268 268
 				foreach($range3 as $row){
269 269
 					if(
270
-						    $this->matrix[$row    ][$col]
270
+						    $this->matrix[$row][$col]
271 271
 						&& !$this->matrix[$row + 1][$col]
272 272
 						&&  $this->matrix[$row + 2][$col]
273 273
 						&&  $this->matrix[$row + 3][$col]
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 			$a = (int)floor($i / 3);
314 314
 			$b = $i % 3 + $this->pixelCount - 8 - 3;
315 315
 
316
-			$this->matrix[$a][$b] = $this->matrix[$b][$a] = !$test && (($bits >> $i) & 1) === 1;
316
+			$this->matrix[$a][$b] = $this->matrix[$b][$a] = !$test && (($bits >> $i)&1) === 1;
317 317
 			$i++;
318 318
 		}
319 319
 
@@ -325,13 +325,13 @@  discard block
 block discarded – undo
325 325
 	 */
326 326
 	protected function setTypeInfo($test, $pattern){
327 327
 		$this->setPattern();
328
-		$bits = Util::getBCHTypeInfo(($this->errorCorrectLevel << 3) | $pattern);
328
+		$bits = Util::getBCHTypeInfo(($this->errorCorrectLevel << 3)|$pattern);
329 329
 		$i = 0;
330 330
 		while($i < 15){
331
-			$mod = !$test && (($bits >> $i) & 1) === 1;
331
+			$mod = !$test && (($bits >> $i)&1) === 1;
332 332
 
333 333
 			switch(true){
334
-				case $i < 6: $this->matrix[$i    ][8] = $mod; break;
334
+				case $i < 6: $this->matrix[$i][8] = $mod; break;
335 335
 				case $i < 8: $this->matrix[$i + 1][8] = $mod; break;
336 336
 				default:
337 337
 					$this->matrix[$this->pixelCount - 15 + $i][8] = $mod;
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
 			switch(true){
341 341
 				case $i < 8: $this->matrix[8][$this->pixelCount - $i - 1] = $mod; break;
342
-				case $i < 9: $this->matrix[8][           15 + 1 - $i - 1] = $mod; break;
342
+				case $i < 9: $this->matrix[8][15 + 1 - $i - 1] = $mod; break;
343 343
 				default:
344 344
 					$this->matrix[8][15 - $i - 1] = $mod;
345 345
 			}
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 
420 420
 			foreach($dcdata[$key] as $i => &$_dcdata){
421 421
 				$bdata = $this->bitBuffer->buffer;
422
-				$_dcdata = 0xff & $bdata[$i + $offset];
422
+				$_dcdata = 0xff&$bdata[$i + $offset];
423 423
 			}
424 424
 
425 425
 			$offset += $rsBlockDataCount;
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 						$dark = false;
502 502
 
503 503
 						if($byteIndex < $dataCount){
504
-							$dark = (($data[$byteIndex] >> $bitIndex) & 1) === 1;
504
+							$dark = (($data[$byteIndex] >> $bitIndex)&1) === 1;
505 505
 						}
506 506
 
507 507
 						$a = $row + $_col;
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 					$this->matrix[$row + $r][$col + $c] =
565 565
 						(0 <= $r && $r <= 6 && ($c === 0 || $c === 6))
566 566
 						|| (0 <= $c && $c <= 6 && ($r === 0 || $r === 6))
567
-						|| (2 <= $c && $c <= 4 &&  2 <= $r && $r <= 4);
567
+						|| (2 <= $c && $c <= 4 && 2 <= $r && $r <= 4);
568 568
 				}
569 569
 				$r++;
570 570
 			}
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 				while($row < 3){
589 589
 					while($col < 3){
590 590
 						$this->matrix[$posI + $row][$posJ + $col] =
591
-							$row === -2 || $row ===  2 || $col === -2 || $col ===  2 ||($row ===  0 && $col === 0);
591
+							$row === -2 || $row === 2 || $col === -2 || $col === 2 || ($row === 0 && $col === 0);
592 592
 						$col++;
593 593
 					}
594 594
 					$row++;
Please login to merge, or discard this patch.