@@ -292,7 +292,7 @@ discard block |
||
| 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 |
||
| 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] |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | for($row = -2; $row <= 2; $row++){ |
| 650 | 650 | for($col = -2; $col <= 2; $col++){ |
| 651 | 651 | $this->matrix[$posI + $row][$posJ + $col] = |
| 652 | - $row === -2 || $row === 2 |
|
| 652 | + $row === -2 || $row === 2 |
|
| 653 | 653 | || $col === -2 || $col === 2 |
| 654 | 654 | || ($row === 0 && $col === 0); |
| 655 | 655 | } |
@@ -45,29 +45,29 @@ discard block |
||
| 45 | 45 | const ERROR_CORRECT_LEVEL_H = 2; // 30%. |
| 46 | 46 | |
| 47 | 47 | // max bits @ ec level L:07 M:15 Q:25 H:30 % |
| 48 | - const TYPE_01 = 1; // 152 128 104 72 |
|
| 49 | - const TYPE_02 = 2; // 272 224 176 128 |
|
| 50 | - const TYPE_03 = 3; // 440 352 272 208 |
|
| 51 | - const TYPE_04 = 4; // 640 512 384 288 |
|
| 52 | - const TYPE_05 = 5; // 864 688 496 368 |
|
| 53 | - const TYPE_06 = 6; // 1088 864 608 480 |
|
| 54 | - const TYPE_07 = 7; // 1248 992 704 528 |
|
| 55 | - const TYPE_08 = 8; // 1552 1232 880 688 |
|
| 56 | - const TYPE_09 = 9; // 1856 1456 1056 800 |
|
| 48 | + const TYPE_01 = 1; // 152 128 104 72 |
|
| 49 | + const TYPE_02 = 2; // 272 224 176 128 |
|
| 50 | + const TYPE_03 = 3; // 440 352 272 208 |
|
| 51 | + const TYPE_04 = 4; // 640 512 384 288 |
|
| 52 | + const TYPE_05 = 5; // 864 688 496 368 |
|
| 53 | + const TYPE_06 = 6; // 1088 864 608 480 |
|
| 54 | + const TYPE_07 = 7; // 1248 992 704 528 |
|
| 55 | + const TYPE_08 = 8; // 1552 1232 880 688 |
|
| 56 | + const TYPE_09 = 9; // 1856 1456 1056 800 |
|
| 57 | 57 | const TYPE_10 = 10; // 2192 1728 1232 976 |
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | const MAX_BITS = [ |
| 61 | - self::TYPE_01 => [ 128, 152, 72, 104], |
|
| 62 | - self::TYPE_02 => [ 224, 272, 128, 176], |
|
| 63 | - self::TYPE_03 => [ 352, 440, 208, 272], |
|
| 64 | - self::TYPE_04 => [ 512, 640, 288, 384], |
|
| 65 | - self::TYPE_05 => [ 688, 864, 368, 496], |
|
| 66 | - self::TYPE_06 => [ 864, 1088, 480, 608], |
|
| 67 | - self::TYPE_07 => [ 992, 1248, 528, 704], |
|
| 68 | - self::TYPE_08 => [1232, 1552, 688, 880], |
|
| 69 | - self::TYPE_09 => [1456, 1856, 800, 1056], |
|
| 70 | - self::TYPE_10 => [1728, 2192, 976, 1232], |
|
| 61 | + self::TYPE_01 => [128, 152, 72, 104], |
|
| 62 | + self::TYPE_02 => [224, 272, 128, 176], |
|
| 63 | + self::TYPE_03 => [352, 440, 208, 272], |
|
| 64 | + self::TYPE_04 => [512, 640, 288, 384], |
|
| 65 | + self::TYPE_05 => [688, 864, 368, 496], |
|
| 66 | + self::TYPE_06 => [864, 1088, 480, 608], |
|
| 67 | + self::TYPE_07 => [992, 1248, 528, 704], |
|
| 68 | + self::TYPE_08 => [1232, 1552, 688, 880], |
|
| 69 | + self::TYPE_09 => [1456, 1856, 800, 1056], |
|
| 70 | + self::TYPE_10 => [1728, 2192, 976, 1232], |
|
| 71 | 71 | ]; |
| 72 | 72 | |
| 73 | 73 | const RSBLOCK = [ |
@@ -337,9 +337,9 @@ discard block |
||
| 337 | 337 | $count = 0; |
| 338 | 338 | |
| 339 | 339 | if( |
| 340 | - $this->matrix[$row ][$col ] |
|
| 341 | - || $this->matrix[$row ][$col + 1] |
|
| 342 | - || $this->matrix[$row + 1][$col ] |
|
| 340 | + $this->matrix[$row][$col] |
|
| 341 | + || $this->matrix[$row][$col + 1] |
|
| 342 | + || $this->matrix[$row + 1][$col] |
|
| 343 | 343 | || $this->matrix[$row + 1][$col + 1] |
| 344 | 344 | ){ |
| 345 | 345 | $count++; |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | foreach($range2 as $col){ |
| 367 | 367 | |
| 368 | 368 | if( |
| 369 | - $this->matrix[$row][$col ] |
|
| 369 | + $this->matrix[$row][$col] |
|
| 370 | 370 | && !$this->matrix[$row][$col + 1] |
| 371 | 371 | && $this->matrix[$row][$col + 2] |
| 372 | 372 | && $this->matrix[$row][$col + 3] |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | foreach($range2 as $row){ |
| 385 | 385 | |
| 386 | 386 | if( |
| 387 | - $this->matrix[$row ][$col] |
|
| 387 | + $this->matrix[$row][$col] |
|
| 388 | 388 | && !$this->matrix[$row + 1][$col] |
| 389 | 389 | && $this->matrix[$row + 2][$col] |
| 390 | 390 | && $this->matrix[$row + 3][$col] |
@@ -427,11 +427,11 @@ discard block |
||
| 427 | 427 | $this->lostPoint = 0; |
| 428 | 428 | $this->darkCount = 0; |
| 429 | 429 | |
| 430 | - $range = range(0, $this->pixelCount-1); |
|
| 430 | + $range = range(0, $this->pixelCount - 1); |
|
| 431 | 431 | |
| 432 | 432 | $this->testLevel1($range); |
| 433 | - $this->testLevel2(range(0, $this->pixelCount-2)); |
|
| 434 | - $this->testLevel3($range, range(0, $this->pixelCount-7)); |
|
| 433 | + $this->testLevel2(range(0, $this->pixelCount - 2)); |
|
| 434 | + $this->testLevel3($range, range(0, $this->pixelCount - 7)); |
|
| 435 | 435 | $this->testLevel4($range); |
| 436 | 436 | |
| 437 | 437 | $this->lostPoint += (abs(100 * $this->darkCount / $this->pixelCount / $this->pixelCount - 50) / 5) * 10; |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | $a = (int)floor($i / 3); |
| 456 | 456 | $b = $i % 3 + $this->pixelCount - 8 - 3; |
| 457 | 457 | |
| 458 | - $this->matrix[$a][$b] = $this->matrix[$b][$a] = !$test && (($bits >> $i) & 1) === 1; |
|
| 458 | + $this->matrix[$a][$b] = $this->matrix[$b][$a] = !$test && (($bits >> $i)&1) === 1; |
|
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | } |
@@ -468,13 +468,13 @@ discard block |
||
| 468 | 468 | */ |
| 469 | 469 | protected function setTypeInfo(bool $test, int $pattern){ |
| 470 | 470 | $this->setPattern(); |
| 471 | - $bits = Util::getBCHTypeInfo(($this->errorCorrectLevel << 3) | $pattern); |
|
| 471 | + $bits = Util::getBCHTypeInfo(($this->errorCorrectLevel << 3)|$pattern); |
|
| 472 | 472 | |
| 473 | 473 | for($i = 0; $i < 15; $i++){ |
| 474 | - $mod = !$test && (($bits >> $i) & 1) === 1; |
|
| 474 | + $mod = !$test && (($bits >> $i)&1) === 1; |
|
| 475 | 475 | |
| 476 | 476 | switch(true){ |
| 477 | - case $i < 6: $this->matrix[$i ][8] = $mod; break; |
|
| 477 | + case $i < 6: $this->matrix[$i][8] = $mod; break; |
|
| 478 | 478 | case $i < 8: $this->matrix[$i + 1][8] = $mod; break; |
| 479 | 479 | default: |
| 480 | 480 | $this->matrix[$this->pixelCount - 15 + $i][8] = $mod; |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | |
| 483 | 483 | switch(true){ |
| 484 | 484 | case $i < 8: $this->matrix[8][$this->pixelCount - $i - 1] = $mod; break; |
| 485 | - case $i < 9: $this->matrix[8][ 15 + 1 - $i - 1] = $mod; break; |
|
| 485 | + case $i < 9: $this->matrix[8][15 + 1 - $i - 1] = $mod; break; |
|
| 486 | 486 | default: |
| 487 | 487 | $this->matrix[8][15 - $i - 1] = $mod; |
| 488 | 488 | } |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | |
| 566 | 566 | foreach($dcdata[$key] as $i => &$_dcdata){ |
| 567 | 567 | $bdata = $this->bitBuffer->buffer; |
| 568 | - $_dcdata = 0xff & $bdata[$i + $offset]; |
|
| 568 | + $_dcdata = 0xff&$bdata[$i + $offset]; |
|
| 569 | 569 | } |
| 570 | 570 | |
| 571 | 571 | $offset += $rsBlockDataCount; |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | $dark = false; |
| 642 | 642 | |
| 643 | 643 | if($byteIndex < $dataCount){ |
| 644 | - $dark = (($data[$byteIndex] >> $bitIndex) & 1) === 1; |
|
| 644 | + $dark = (($data[$byteIndex] >> $bitIndex)&1) === 1; |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | $a = $row + $_col; |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | $this->matrix[$row + $r][$col + $c] = |
| 703 | 703 | (0 <= $r && $r <= 6 && ($c === 0 || $c === 6)) |
| 704 | 704 | || (0 <= $c && $c <= 6 && ($r === 0 || $r === 6)) |
| 705 | - || (2 <= $c && $c <= 4 && 2 <= $r && $r <= 4); |
|
| 705 | + || (2 <= $c && $c <= 4 && 2 <= $r && $r <= 4); |
|
| 706 | 706 | } |
| 707 | 707 | } |
| 708 | 708 | } |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | $this->matrix[$posI + $row][$posJ + $col] = |
| 727 | 727 | $row === -2 || $row === 2 |
| 728 | 728 | || $col === -2 || $col === 2 |
| 729 | - || ($row === 0 && $col === 0); |
|
| 729 | + || ($row === 0 && $col === 0); |
|
| 730 | 730 | } |
| 731 | 731 | } |
| 732 | 732 | } |
@@ -63,8 +63,8 @@ |
||
| 63 | 63 | foreach($row as $c => $pixel){ |
| 64 | 64 | if($pixel){ |
| 65 | 65 | imagefilledrectangle($image, |
| 66 | - $this->options->marginSize + $c * $this->options->pixelSize, |
|
| 67 | - $this->options->marginSize + $r * $this->options->pixelSize, |
|
| 66 | + $this->options->marginSize + $c * $this->options->pixelSize, |
|
| 67 | + $this->options->marginSize + $r * $this->options->pixelSize, |
|
| 68 | 68 | $this->options->marginSize + ($c + 1) * $this->options->pixelSize - 1, |
| 69 | 69 | $this->options->marginSize + ($r + 1) * $this->options->pixelSize - 1, |
| 70 | 70 | $foreground); |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $this->options = new $this->optionsInterface; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - if(is_array($this->types) && !in_array($this->options->type, $this->types , true)){ |
|
| 56 | + if(is_array($this->types) && !in_array($this->options->type, $this->types, true)){ |
|
| 57 | 57 | throw new QRCodeOutputException('Invalid output type!'); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | // svg header |
| 84 | 84 | $svg = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'.$length.'" height="'.$length.'" viewBox="0 0 '.$length.' '.$length.'" style="background-color:'.$this->options->bgColor.'">'.$this->options->eol. |
| 85 | - '<defs><style>.'.$class.'{fill:'.$this->options->fgColor.'} rect{shape-rendering:crispEdges}</style></defs>'.$this->options->eol; |
|
| 85 | + '<defs><style>.'.$class.'{fill:'.$this->options->fgColor.'} rect{shape-rendering:crispEdges}</style></defs>'.$this->options->eol; |
|
| 86 | 86 | |
| 87 | 87 | // svg body |
| 88 | 88 | foreach($this->matrix as $r => $row){ |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | elseif($from >= 0){ |
| 102 | 102 | $svg .= '<rect x="'.($from * $this->options->pixelSize + $this->options->marginSize).'" y="'.($r * $this->options->pixelSize + $this->options->marginSize) |
| 103 | - .'" width="'.($this->options->pixelSize * $count).'" height="'.$this->options->pixelSize.'" class="'.$class.'" />'.$this->options->eol; |
|
| 103 | + .'" width="'.($this->options->pixelSize * $count).'" height="'.$this->options->pixelSize.'" class="'.$class.'" />'.$this->options->eol; |
|
| 104 | 104 | |
| 105 | 105 | // reset count |
| 106 | 106 | $from = -1; |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | // close off the row, if applicable |
| 112 | 112 | if($from >= 0){ |
| 113 | 113 | $svg .= '<rect x="'.($from * $this->options->pixelSize + $this->options->marginSize).'" y="'.($r * $this->options->pixelSize + $this->options->marginSize) |
| 114 | - .'" width="'.($this->options->pixelSize * $count).'" height="'.$this->options->pixelSize.'" class="'.$class.'" />'.$this->options->eol; |
|
| 114 | + .'" width="'.($this->options->pixelSize * $count).'" height="'.$this->options->pixelSize.'" class="'.$class.'" />'.$this->options->eol; |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * @param \chillerlan\QRCode\BitBuffer $buffer |
| 26 | 26 | * @return void |
| 27 | 27 | */ |
| 28 | - public function write(BitBuffer &$buffer); |
|
| 28 | + public function write(BitBuffer&$buffer); |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * @param $type |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | * @return void |
| 36 | 36 | * @throws \chillerlan\QRCode\Data\QRCodeDataException |
| 37 | 37 | */ |
| 38 | - public function write(BitBuffer &$buffer){ |
|
| 38 | + public function write(BitBuffer&$buffer){ |
|
| 39 | 39 | |
| 40 | 40 | $i = 0; |
| 41 | 41 | while($i + 1 < $this->dataLength){ |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | * |
| 47 | 47 | * @return void |
| 48 | 48 | */ |
| 49 | - public function write(BitBuffer &$buffer){ |
|
| 49 | + public function write(BitBuffer&$buffer){ |
|
| 50 | 50 | $i = 0; |
| 51 | 51 | |
| 52 | 52 | while($i + 1 < $this->dataLength){ |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * |
| 35 | 35 | * @return void |
| 36 | 36 | */ |
| 37 | - public function write(BitBuffer &$buffer){ |
|
| 37 | + public function write(BitBuffer&$buffer){ |
|
| 38 | 38 | $i = 0; |
| 39 | 39 | |
| 40 | 40 | while($i + 2 < $this->dataLength){ |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * |
| 35 | 35 | * @return void |
| 36 | 36 | */ |
| 37 | - public function write(BitBuffer &$buffer){ |
|
| 37 | + public function write(BitBuffer&$buffer){ |
|
| 38 | 38 | $i = 0; |
| 39 | 39 | while($i < $this->dataLength){ |
| 40 | 40 | $buffer->put(ord($this->data[$i]), 8); |