Completed
Push — master ( 275bd9...714d02 )
by smiley
02:38
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
 	/**
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
 				$count = 0;
266 266
 
267 267
 				if(
268
-					   $this->matrix[$row    ][$col    ]
269
-					|| $this->matrix[$row    ][$col + 1]
270
-					|| $this->matrix[$row + 1][$col    ]
268
+					   $this->matrix[$row][$col]
269
+					|| $this->matrix[$row][$col + 1]
270
+					|| $this->matrix[$row + 1][$col]
271 271
 					|| $this->matrix[$row + 1][$col + 1]
272 272
 				){
273 273
 					$count++;
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 			foreach($range2 as $col){
293 293
 
294 294
 				if(
295
-					    $this->matrix[$row][$col    ]
295
+					    $this->matrix[$row][$col]
296 296
 					&& !$this->matrix[$row][$col + 1]
297 297
 					&&  $this->matrix[$row][$col + 2]
298 298
 					&&  $this->matrix[$row][$col + 3]
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 			foreach($range2 as $row){
311 311
 
312 312
 				if(
313
-					    $this->matrix[$row    ][$col]
313
+					    $this->matrix[$row][$col]
314 314
 					&& !$this->matrix[$row + 1][$col]
315 315
 					&&  $this->matrix[$row + 2][$col]
316 316
 					&&  $this->matrix[$row + 3][$col]
@@ -349,11 +349,11 @@  discard block
 block discarded – undo
349 349
 		$this->lostPoint = 0;
350 350
 		$this->darkCount = 0;
351 351
 
352
-		$range = range(0, $this->pixelCount-1);
352
+		$range = range(0, $this->pixelCount - 1);
353 353
 
354 354
 		$this->testLevel1($range);
355
-		$this->testLevel2(range(0, $this->pixelCount-2));
356
-		$this->testLevel3($range, range(0, $this->pixelCount-7));
355
+		$this->testLevel2(range(0, $this->pixelCount - 2));
356
+		$this->testLevel3($range, range(0, $this->pixelCount - 7));
357 357
 		$this->testLevel4($range);
358 358
 
359 359
 		$this->lostPoint += (abs(100 * $this->darkCount / $this->pixelCount / $this->pixelCount - 50) / 5) * 10;
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 			$a = (int)floor($i / 3);
376 376
 			$b = $i % 3 + $this->pixelCount - 8 - 3;
377 377
 
378
-			$this->matrix[$a][$b] = $this->matrix[$b][$a] = !$test && (($bits >> $i) & 1) === 1;
378
+			$this->matrix[$a][$b] = $this->matrix[$b][$a] = !$test && (($bits >> $i)&1) === 1;
379 379
 			$i++;
380 380
 		}
381 381
 
@@ -387,13 +387,13 @@  discard block
 block discarded – undo
387 387
 	 */
388 388
 	protected function setTypeInfo($test, $pattern){
389 389
 		$this->setPattern();
390
-		$bits = Util::getBCHTypeInfo(($this->errorCorrectLevel << 3) | $pattern);
390
+		$bits = Util::getBCHTypeInfo(($this->errorCorrectLevel << 3)|$pattern);
391 391
 		$i = 0;
392 392
 		while($i < 15){
393
-			$mod = !$test && (($bits >> $i) & 1) === 1;
393
+			$mod = !$test && (($bits >> $i)&1) === 1;
394 394
 
395 395
 			switch(true){
396
-				case $i < 6: $this->matrix[$i    ][8] = $mod; break;
396
+				case $i < 6: $this->matrix[$i][8] = $mod; break;
397 397
 				case $i < 8: $this->matrix[$i + 1][8] = $mod; break;
398 398
 				default:
399 399
 					$this->matrix[$this->pixelCount - 15 + $i][8] = $mod;
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 
402 402
 			switch(true){
403 403
 				case $i < 8: $this->matrix[8][$this->pixelCount - $i - 1] = $mod; break;
404
-				case $i < 9: $this->matrix[8][           15 + 1 - $i - 1] = $mod; break;
404
+				case $i < 9: $this->matrix[8][15 + 1 - $i - 1] = $mod; break;
405 405
 				default:
406 406
 					$this->matrix[8][15 - $i - 1] = $mod;
407 407
 			}
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 
482 482
 			foreach($dcdata[$key] as $i => &$_dcdata){
483 483
 				$bdata = $this->bitBuffer->buffer;
484
-				$_dcdata = 0xff & $bdata[$i + $offset];
484
+				$_dcdata = 0xff&$bdata[$i + $offset];
485 485
 			}
486 486
 
487 487
 			$offset += $rsBlockDataCount;
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 						$dark = false;
564 564
 
565 565
 						if($byteIndex < $dataCount){
566
-							$dark = (($data[$byteIndex] >> $bitIndex) & 1) === 1;
566
+							$dark = (($data[$byteIndex] >> $bitIndex)&1) === 1;
567 567
 						}
568 568
 
569 569
 						$a = $row + $_col;
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 					$this->matrix[$row + $r][$col + $c] =
627 627
 						(0 <= $r && $r <= 6 && ($c === 0 || $c === 6))
628 628
 						|| (0 <= $c && $c <= 6 && ($r === 0 || $r === 6))
629
-						|| (2 <= $c && $c <= 4 &&  2 <= $r && $r <= 4);
629
+						|| (2 <= $c && $c <= 4 && 2 <= $r && $r <= 4);
630 630
 				}
631 631
 				$r++;
632 632
 			}
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 				while($row < 3){
651 651
 					while($col < 3){
652 652
 						$this->matrix[$posI + $row][$posJ + $col] =
653
-							$row === -2 || $row ===  2 || $col === -2 || $col ===  2 ||($row ===  0 && $col === 0);
653
+							$row === -2 || $row === 2 || $col === -2 || $col === 2 || ($row === 0 && $col === 0);
654 654
 						$col++;
655 655
 					}
656 656
 					$row++;
Please login to merge, or discard this patch.