@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | foreach($range2 as $col){ |
292 | 292 | |
293 | 293 | if( |
294 | - $this->matrix[$row][$col ] |
|
294 | + $this->matrix[$row][$col ] |
|
295 | 295 | && !$this->matrix[$row][$col + 1] |
296 | 296 | && $this->matrix[$row][$col + 2] |
297 | 297 | && $this->matrix[$row][$col + 3] |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | foreach($range2 as $row){ |
310 | 310 | |
311 | 311 | if( |
312 | - $this->matrix[$row ][$col] |
|
312 | + $this->matrix[$row ][$col] |
|
313 | 313 | && !$this->matrix[$row + 1][$col] |
314 | 314 | && $this->matrix[$row + 2][$col] |
315 | 315 | && $this->matrix[$row + 3][$col] |
@@ -41,15 +41,15 @@ discard block |
||
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 | /** |
@@ -264,9 +264,9 @@ discard block |
||
264 | 264 | $count = 0; |
265 | 265 | |
266 | 266 | if( |
267 | - $this->matrix[$row ][$col ] |
|
268 | - || $this->matrix[$row ][$col + 1] |
|
269 | - || $this->matrix[$row + 1][$col ] |
|
267 | + $this->matrix[$row][$col] |
|
268 | + || $this->matrix[$row][$col + 1] |
|
269 | + || $this->matrix[$row + 1][$col] |
|
270 | 270 | || $this->matrix[$row + 1][$col + 1] |
271 | 271 | ){ |
272 | 272 | $count++; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | foreach($range2 as $col){ |
292 | 292 | |
293 | 293 | if( |
294 | - $this->matrix[$row][$col ] |
|
294 | + $this->matrix[$row][$col] |
|
295 | 295 | && !$this->matrix[$row][$col + 1] |
296 | 296 | && $this->matrix[$row][$col + 2] |
297 | 297 | && $this->matrix[$row][$col + 3] |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | foreach($range2 as $row){ |
310 | 310 | |
311 | 311 | if( |
312 | - $this->matrix[$row ][$col] |
|
312 | + $this->matrix[$row][$col] |
|
313 | 313 | && !$this->matrix[$row + 1][$col] |
314 | 314 | && $this->matrix[$row + 2][$col] |
315 | 315 | && $this->matrix[$row + 3][$col] |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | $this->lostPoint = 0; |
349 | 349 | $this->darkCount = 0; |
350 | 350 | |
351 | - $range1 = range(0, $this->pixelCount-1); |
|
352 | - $range2 = range(0, $this->pixelCount-2); |
|
353 | - $range3 = range(0, $this->pixelCount-7); |
|
351 | + $range1 = range(0, $this->pixelCount - 1); |
|
352 | + $range2 = range(0, $this->pixelCount - 2); |
|
353 | + $range3 = range(0, $this->pixelCount - 7); |
|
354 | 354 | |
355 | 355 | $this->testLevel1($range1); |
356 | 356 | $this->testLevel2($range2); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $a = (int)floor($i / 3); |
377 | 377 | $b = $i % 3 + $this->pixelCount - 8 - 3; |
378 | 378 | |
379 | - $this->matrix[$a][$b] = $this->matrix[$b][$a] = !$test && (($bits >> $i) & 1) === 1; |
|
379 | + $this->matrix[$a][$b] = $this->matrix[$b][$a] = !$test && (($bits >> $i)&1) === 1; |
|
380 | 380 | $i++; |
381 | 381 | } |
382 | 382 | |
@@ -388,13 +388,13 @@ discard block |
||
388 | 388 | */ |
389 | 389 | protected function setTypeInfo($test, $pattern){ |
390 | 390 | $this->setPattern(); |
391 | - $bits = Util::getBCHTypeInfo(($this->errorCorrectLevel << 3) | $pattern); |
|
391 | + $bits = Util::getBCHTypeInfo(($this->errorCorrectLevel << 3)|$pattern); |
|
392 | 392 | $i = 0; |
393 | 393 | while($i < 15){ |
394 | - $mod = !$test && (($bits >> $i) & 1) === 1; |
|
394 | + $mod = !$test && (($bits >> $i)&1) === 1; |
|
395 | 395 | |
396 | 396 | switch(true){ |
397 | - case $i < 6: $this->matrix[$i ][8] = $mod; break; |
|
397 | + case $i < 6: $this->matrix[$i][8] = $mod; break; |
|
398 | 398 | case $i < 8: $this->matrix[$i + 1][8] = $mod; break; |
399 | 399 | default: |
400 | 400 | $this->matrix[$this->pixelCount - 15 + $i][8] = $mod; |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | |
403 | 403 | switch(true){ |
404 | 404 | case $i < 8: $this->matrix[8][$this->pixelCount - $i - 1] = $mod; break; |
405 | - case $i < 9: $this->matrix[8][ 15 + 1 - $i - 1] = $mod; break; |
|
405 | + case $i < 9: $this->matrix[8][15 + 1 - $i - 1] = $mod; break; |
|
406 | 406 | default: |
407 | 407 | $this->matrix[8][15 - $i - 1] = $mod; |
408 | 408 | } |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | |
483 | 483 | foreach($dcdata[$key] as $i => &$_dcdata){ |
484 | 484 | $bdata = $this->bitBuffer->buffer; |
485 | - $_dcdata = 0xff & $bdata[$i + $offset]; |
|
485 | + $_dcdata = 0xff&$bdata[$i + $offset]; |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | $offset += $rsBlockDataCount; |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | $dark = false; |
565 | 565 | |
566 | 566 | if($byteIndex < $dataCount){ |
567 | - $dark = (($data[$byteIndex] >> $bitIndex) & 1) === 1; |
|
567 | + $dark = (($data[$byteIndex] >> $bitIndex)&1) === 1; |
|
568 | 568 | } |
569 | 569 | |
570 | 570 | $a = $row + $_col; |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | $this->matrix[$row + $r][$col + $c] = |
628 | 628 | (0 <= $r && $r <= 6 && ($c === 0 || $c === 6)) |
629 | 629 | || (0 <= $c && $c <= 6 && ($r === 0 || $r === 6)) |
630 | - || (2 <= $c && $c <= 4 && 2 <= $r && $r <= 4); |
|
630 | + || (2 <= $c && $c <= 4 && 2 <= $r && $r <= 4); |
|
631 | 631 | } |
632 | 632 | $r++; |
633 | 633 | } |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | while($row < 3){ |
652 | 652 | while($col < 3){ |
653 | 653 | $this->matrix[$posI + $row][$posJ + $col] = |
654 | - $row === -2 || $row === 2 || $col === -2 || $col === 2 ||($row === 0 && $col === 0); |
|
654 | + $row === -2 || $row === 2 || $col === -2 || $col === 2 || ($row === 0 && $col === 0); |
|
655 | 655 | $col++; |
656 | 656 | } |
657 | 657 | $row++; |