@@ -33,7 +33,7 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * @param \chillerlan\QRCode\BitBuffer $buffer |
| 35 | 35 | */ |
| 36 | - public function write(BitBuffer &$buffer){ |
|
| 36 | + public function write(BitBuffer&$buffer){ |
|
| 37 | 37 | $i = 0; |
| 38 | 38 | |
| 39 | 39 | while($i + 2 < $this->dataLength){ |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | /** |
| 23 | 23 | * @param \chillerlan\QRCode\BitBuffer $buffer |
| 24 | 24 | */ |
| 25 | - public function write(BitBuffer &$buffer); |
|
| 25 | + public function write(BitBuffer&$buffer); |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * @param $type |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | for($i = 8; $i < 256; $i++){ |
| 79 | - $this->EXP_TABLE[$i] = $this->EXP_TABLE[$i - 4] ^ $this->EXP_TABLE[$i - 5] ^ $this->EXP_TABLE[$i - 6] ^ $this->EXP_TABLE[$i - 8]; |
|
| 79 | + $this->EXP_TABLE[$i] = $this->EXP_TABLE[$i - 4]^$this->EXP_TABLE[$i - 5]^$this->EXP_TABLE[$i - 6]^$this->EXP_TABLE[$i - 8]; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | for($i = 0; $i < 255; $i++){ |
@@ -25,16 +25,16 @@ discard block |
||
| 25 | 25 | ]; |
| 26 | 26 | |
| 27 | 27 | const MAX_BITS = [ |
| 28 | - QRCode::TYPE_01 => [ 128, 152, 72, 104], |
|
| 29 | - QRCode::TYPE_02 => [ 224, 272, 128, 176], |
|
| 30 | - QRCode::TYPE_03 => [ 352, 440, 208, 272], |
|
| 31 | - QRCode::TYPE_04 => [ 512, 640, 288, 384], |
|
| 32 | - QRCode::TYPE_05 => [ 688, 864, 368, 496], |
|
| 33 | - QRCode::TYPE_06 => [ 864, 1088, 480, 608], |
|
| 34 | - QRCode::TYPE_07 => [ 992, 1248, 528, 704], |
|
| 35 | - QRCode::TYPE_08 => [1232, 1552, 688, 880], |
|
| 36 | - QRCode::TYPE_09 => [1456, 1856, 800, 1056], |
|
| 37 | - QRCode::TYPE_10 => [1728, 2192, 976, 1232], |
|
| 28 | + QRCode::TYPE_01 => [128, 152, 72, 104], |
|
| 29 | + QRCode::TYPE_02 => [224, 272, 128, 176], |
|
| 30 | + QRCode::TYPE_03 => [352, 440, 208, 272], |
|
| 31 | + QRCode::TYPE_04 => [512, 640, 288, 384], |
|
| 32 | + QRCode::TYPE_05 => [688, 864, 368, 496], |
|
| 33 | + QRCode::TYPE_06 => [864, 1088, 480, 608], |
|
| 34 | + QRCode::TYPE_07 => [992, 1248, 528, 704], |
|
| 35 | + QRCode::TYPE_08 => [1232, 1552, 688, 880], |
|
| 36 | + QRCode::TYPE_09 => [1456, 1856, 800, 1056], |
|
| 37 | + QRCode::TYPE_10 => [1728, 2192, 976, 1232], |
|
| 38 | 38 | ]; |
| 39 | 39 | |
| 40 | 40 | const MODE_NUMBER = 1 << 0; |
@@ -66,16 +66,16 @@ discard block |
||
| 66 | 66 | const PAD1 = 0x11; |
| 67 | 67 | |
| 68 | 68 | const MAX_LENGTH = [ |
| 69 | - [[ 41, 25, 17, 10], [ 34, 20, 14, 8], [ 27, 16, 11, 7], [ 17, 10, 7, 4]], |
|
| 70 | - [[ 77, 47, 32, 20], [ 63, 38, 26, 16], [ 48, 29, 20, 12], [ 34, 20, 14, 8]], |
|
| 71 | - [[127, 77, 53, 32], [101, 61, 42, 26], [ 77, 47, 32, 20], [ 58, 35, 24, 15]], |
|
| 72 | - [[187, 114, 78, 48], [149, 90, 62, 38], [111, 67, 46, 28], [ 82, 50, 34, 21]], |
|
| 73 | - [[255, 154, 106, 65], [202, 122, 84, 52], [144, 87, 60, 37], [106, 64, 44, 27]], |
|
| 74 | - [[322, 195, 134, 82], [255, 154, 106, 65], [178, 108, 74, 45], [139, 84, 58, 36]], |
|
| 75 | - [[370, 224, 154, 95], [293, 178, 122, 75], [207, 125, 86, 53], [154, 93, 64, 39]], |
|
| 76 | - [[461, 279, 192, 118], [365, 221, 152, 93], [259, 157, 108, 66], [202, 122, 84, 52]], |
|
| 77 | - [[552, 335, 230, 141], [432, 262, 180, 111], [312, 189, 130, 80], [235, 143, 98, 60]], |
|
| 78 | - [[652, 395, 271, 167], [513, 311, 213, 131], [364, 221, 151, 93], [288, 174, 119, 74]], |
|
| 69 | + [[41, 25, 17, 10], [34, 20, 14, 8], [27, 16, 11, 7], [17, 10, 7, 4]], |
|
| 70 | + [[77, 47, 32, 20], [63, 38, 26, 16], [48, 29, 20, 12], [34, 20, 14, 8]], |
|
| 71 | + [[127, 77, 53, 32], [101, 61, 42, 26], [77, 47, 32, 20], [58, 35, 24, 15]], |
|
| 72 | + [[187, 114, 78, 48], [149, 90, 62, 38], [111, 67, 46, 28], [82, 50, 34, 21]], |
|
| 73 | + [[255, 154, 106, 65], [202, 122, 84, 52], [144, 87, 60, 37], [106, 64, 44, 27]], |
|
| 74 | + [[322, 195, 134, 82], [255, 154, 106, 65], [178, 108, 74, 45], [139, 84, 58, 36]], |
|
| 75 | + [[370, 224, 154, 95], [293, 178, 122, 75], [207, 125, 86, 53], [154, 93, 64, 39]], |
|
| 76 | + [[461, 279, 192, 118], [365, 221, 152, 93], [259, 157, 108, 66], [202, 122, 84, 52]], |
|
| 77 | + [[552, 335, 230, 141], [432, 262, 180, 111], [312, 189, 130, 80], [235, 143, 98, 60]], |
|
| 78 | + [[652, 395, 271, 167], [513, 311, 213, 131], [364, 221, 151, 93], [288, 174, 119, 74]], |
|
| 79 | 79 | ]; |
| 80 | 80 | |
| 81 | 81 | const BLOCK_TABLE = [ |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | [1, 26, 19], // L |
| 84 | 84 | [1, 26, 16], // M |
| 85 | 85 | [1, 26, 13], // Q |
| 86 | - [1, 26, 9], // H |
|
| 86 | + [1, 26, 9], // H |
|
| 87 | 87 | // 2 |
| 88 | 88 | [1, 44, 34], |
| 89 | 89 | [1, 44, 28], |
@@ -96,14 +96,14 @@ discard block |
||
| 96 | 96 | [2, 35, 13], |
| 97 | 97 | // 4 |
| 98 | 98 | [1, 100, 80], |
| 99 | - [2, 50, 32], |
|
| 100 | - [2, 50, 24], |
|
| 101 | - [4, 25, 9], |
|
| 99 | + [2, 50, 32], |
|
| 100 | + [2, 50, 24], |
|
| 101 | + [4, 25, 9], |
|
| 102 | 102 | // 5 |
| 103 | 103 | [1, 134, 108], |
| 104 | - [2, 67, 43], |
|
| 105 | - [2, 33, 15, 2, 34, 16], |
|
| 106 | - [2, 33, 11, 2, 34, 12], |
|
| 104 | + [2, 67, 43], |
|
| 105 | + [2, 33, 15, 2, 34, 16], |
|
| 106 | + [2, 33, 11, 2, 34, 12], |
|
| 107 | 107 | // 6 |
| 108 | 108 | [2, 86, 68], |
| 109 | 109 | [4, 43, 27], |
@@ -116,14 +116,14 @@ discard block |
||
| 116 | 116 | [4, 39, 13, 1, 40, 14], |
| 117 | 117 | // 8 |
| 118 | 118 | [2, 121, 97], |
| 119 | - [2, 60, 38, 2, 61, 39], |
|
| 120 | - [4, 40, 18, 2, 41, 19], |
|
| 121 | - [4, 40, 14, 2, 41, 15], |
|
| 119 | + [2, 60, 38, 2, 61, 39], |
|
| 120 | + [4, 40, 18, 2, 41, 19], |
|
| 121 | + [4, 40, 14, 2, 41, 15], |
|
| 122 | 122 | // 9 |
| 123 | 123 | [2, 146, 116], |
| 124 | - [3, 58, 36, 2, 59, 37], |
|
| 125 | - [4, 36, 16, 4, 37, 17], |
|
| 126 | - [4, 36, 12, 4, 37, 13], |
|
| 124 | + [3, 58, 36, 2, 59, 37], |
|
| 125 | + [4, 36, 16, 4, 37, 17], |
|
| 126 | + [4, 36, 12, 4, 37, 13], |
|
| 127 | 127 | // 10 |
| 128 | 128 | [2, 86, 68, 2, 87, 69], |
| 129 | 129 | [4, 69, 43, 1, 70, 44], |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * @param \chillerlan\QRCode\BitBuffer $buffer |
| 35 | 35 | */ |
| 36 | - public function write(BitBuffer &$buffer){ |
|
| 36 | + public function write(BitBuffer&$buffer){ |
|
| 37 | 37 | $i = 0; |
| 38 | 38 | |
| 39 | 39 | while($i + 2 < $this->dataLength){ |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * @param \chillerlan\QRCode\BitBuffer $buffer |
| 35 | 35 | */ |
| 36 | - public function write(BitBuffer &$buffer){ |
|
| 36 | + public function write(BitBuffer&$buffer){ |
|
| 37 | 37 | $i = 0; |
| 38 | 38 | |
| 39 | 39 | while($i + 2 < $this->dataLength){ |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * @param \chillerlan\QRCode\BitBuffer $buffer |
| 35 | 35 | */ |
| 36 | - public function write(BitBuffer &$buffer){ |
|
| 36 | + public function write(BitBuffer&$buffer){ |
|
| 37 | 37 | $i = 0; |
| 38 | 38 | |
| 39 | 39 | while($i + 2 < $this->dataLength){ |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | foreach($row as $c => $pixel){ |
| 78 | 78 | if($pixel){ |
| 79 | 79 | imagefilledrectangle($image, |
| 80 | - $this->options->marginSize + $c * $this->options->pixelSize, |
|
| 81 | - $this->options->marginSize + $r * $this->options->pixelSize, |
|
| 80 | + $this->options->marginSize + $c * $this->options->pixelSize, |
|
| 81 | + $this->options->marginSize + $r * $this->options->pixelSize, |
|
| 82 | 82 | $this->options->marginSize + ($c + 1) * $this->options->pixelSize - 1, |
| 83 | 83 | $this->options->marginSize + ($r + 1) * $this->options->pixelSize - 1, |
| 84 | 84 | $foreground); |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | ob_start(); |
| 90 | 90 | |
| 91 | 91 | switch($this->options->type){ |
| 92 | - case QRCode::OUTPUT_IMAGE_PNG: imagepng ($image, $this->options->cachefile, (int)$this->options->pngCompression); break; |
|
| 92 | + case QRCode::OUTPUT_IMAGE_PNG: imagepng($image, $this->options->cachefile, (int)$this->options->pngCompression); break; |
|
| 93 | 93 | case QRCode::OUTPUT_IMAGE_JPG: imagejpeg($image, $this->options->cachefile, (int)$this->options->jpegQuality); break; |
| 94 | - case QRCode::OUTPUT_IMAGE_GIF: imagegif ($image, $this->options->cachefile); break; /** Actually, it's pronounced "DJIFF". *hides* */ |
|
| 94 | + case QRCode::OUTPUT_IMAGE_GIF: imagegif($image, $this->options->cachefile); break; /** Actually, it's pronounced "DJIFF". *hides* */ |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | $imageData = ob_get_contents(); |
@@ -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 | /** |
@@ -195,9 +195,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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++; |