@@ -42,15 +42,15 @@ discard block |
||
| 42 | 42 | const ERROR_CORRECT_LEVEL_H = 2; // 30%. |
| 43 | 43 | |
| 44 | 44 | // max bits @ ec level L:07 M:15 Q:25 H:30 % |
| 45 | - const TYPE_01 = 1; // 152 128 104 72 |
|
| 46 | - const TYPE_02 = 2; // 272 224 176 128 |
|
| 47 | - const TYPE_03 = 3; // 440 352 272 208 |
|
| 48 | - const TYPE_04 = 4; // 640 512 384 288 |
|
| 49 | - const TYPE_05 = 5; // 864 688 496 368 |
|
| 50 | - const TYPE_06 = 6; // 1088 864 608 480 |
|
| 51 | - const TYPE_07 = 7; // 1248 992 704 528 |
|
| 52 | - const TYPE_08 = 8; // 1552 1232 880 688 |
|
| 53 | - const TYPE_09 = 9; // 1856 1456 1056 800 |
|
| 45 | + const TYPE_01 = 1; // 152 128 104 72 |
|
| 46 | + const TYPE_02 = 2; // 272 224 176 128 |
|
| 47 | + const TYPE_03 = 3; // 440 352 272 208 |
|
| 48 | + const TYPE_04 = 4; // 640 512 384 288 |
|
| 49 | + const TYPE_05 = 5; // 864 688 496 368 |
|
| 50 | + const TYPE_06 = 6; // 1088 864 608 480 |
|
| 51 | + const TYPE_07 = 7; // 1248 992 704 528 |
|
| 52 | + const TYPE_08 = 8; // 1552 1232 880 688 |
|
| 53 | + const TYPE_09 = 9; // 1856 1456 1056 800 |
|
| 54 | 54 | const TYPE_10 = 10; // 2192 1728 1232 976 |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -201,9 +201,9 @@ discard block |
||
| 201 | 201 | $lostPoint = 0; |
| 202 | 202 | $darkCount = 0; |
| 203 | 203 | |
| 204 | - $range1 = range(0, $this->pixelCount-1); |
|
| 205 | - $range2 = range(0, $this->pixelCount-2); |
|
| 206 | - $range3 = range(0, $this->pixelCount-7); |
|
| 204 | + $range1 = range(0, $this->pixelCount - 1); |
|
| 205 | + $range2 = range(0, $this->pixelCount - 2); |
|
| 206 | + $range3 = range(0, $this->pixelCount - 7); |
|
| 207 | 207 | $range4 = range(-1, 1); |
| 208 | 208 | |
| 209 | 209 | // LEVEL1 |
@@ -240,9 +240,9 @@ discard block |
||
| 240 | 240 | $count = 0; |
| 241 | 241 | |
| 242 | 242 | if( |
| 243 | - $this->matrix[$row ][$col ] |
|
| 244 | - || $this->matrix[$row ][$col + 1] |
|
| 245 | - || $this->matrix[$row + 1][$col ] |
|
| 243 | + $this->matrix[$row][$col] |
|
| 244 | + || $this->matrix[$row][$col + 1] |
|
| 245 | + || $this->matrix[$row + 1][$col] |
|
| 246 | 246 | || $this->matrix[$row + 1][$col + 1] |
| 247 | 247 | ){ |
| 248 | 248 | $count++; |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | foreach($range1 as $row){ |
| 259 | 259 | foreach($range3 as $col){ |
| 260 | 260 | if( |
| 261 | - $this->matrix[$row][$col ] |
|
| 261 | + $this->matrix[$row][$col] |
|
| 262 | 262 | && !$this->matrix[$row][$col + 1] |
| 263 | 263 | && $this->matrix[$row][$col + 2] |
| 264 | 264 | && $this->matrix[$row][$col + 3] |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | foreach($range1 as $col){ |
| 275 | 275 | foreach($range3 as $row){ |
| 276 | 276 | if( |
| 277 | - $this->matrix[$row ][$col] |
|
| 277 | + $this->matrix[$row][$col] |
|
| 278 | 278 | && !$this->matrix[$row + 1][$col] |
| 279 | 279 | && $this->matrix[$row + 2][$col] |
| 280 | 280 | && $this->matrix[$row + 3][$col] |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | $a = (int)floor($i / 3); |
| 321 | 321 | $b = $i % 3 + $this->pixelCount - 8 - 3; |
| 322 | 322 | |
| 323 | - $this->matrix[$a][$b] = $this->matrix[$b][$a] = !$test && (($bits >> $i) & 1) === 1; |
|
| 323 | + $this->matrix[$a][$b] = $this->matrix[$b][$a] = !$test && (($bits >> $i)&1) === 1; |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | } |
@@ -331,13 +331,13 @@ discard block |
||
| 331 | 331 | */ |
| 332 | 332 | protected function setTypeInfo($test, $pattern){ |
| 333 | 333 | $this->setPattern(); |
| 334 | - $bits = Util::getBCHTypeInfo(($this->errorCorrectLevel << 3) | $pattern); |
|
| 334 | + $bits = Util::getBCHTypeInfo(($this->errorCorrectLevel << 3)|$pattern); |
|
| 335 | 335 | |
| 336 | 336 | for($i = 0; $i < 15; $i++){ |
| 337 | - $mod = !$test && (($bits >> $i) & 1) === 1; |
|
| 337 | + $mod = !$test && (($bits >> $i)&1) === 1; |
|
| 338 | 338 | |
| 339 | 339 | switch(true){ |
| 340 | - case $i < 6: $this->matrix[$i ][8] = $mod; break; |
|
| 340 | + case $i < 6: $this->matrix[$i][8] = $mod; break; |
|
| 341 | 341 | case $i < 8: $this->matrix[$i + 1][8] = $mod; break; |
| 342 | 342 | default: |
| 343 | 343 | $this->matrix[$this->pixelCount - 15 + $i][8] = $mod; |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | switch(true){ |
| 347 | 347 | case $i < 8: $this->matrix[8][$this->pixelCount - $i - 1] = $mod; break; |
| 348 | - case $i < 9: $this->matrix[8][ 15 + 1 - $i - 1] = $mod; break; |
|
| 348 | + case $i < 9: $this->matrix[8][15 + 1 - $i - 1] = $mod; break; |
|
| 349 | 349 | default: |
| 350 | 350 | $this->matrix[8][15 - $i - 1] = $mod; |
| 351 | 351 | } |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | |
| 428 | 428 | foreach($dcdata[$key] as $i => &$_dcdata){ |
| 429 | 429 | $bdata = $this->bitBuffer->buffer; |
| 430 | - $_dcdata = 0xff & $bdata[$i + $offset]; |
|
| 430 | + $_dcdata = 0xff&$bdata[$i + $offset]; |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | $offset += $rsBlockDataCount; |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | $dark = false; |
| 503 | 503 | |
| 504 | 504 | if($byteIndex < $dataCount){ |
| 505 | - $dark = (($data[$byteIndex] >> $bitIndex) & 1) === 1; |
|
| 505 | + $dark = (($data[$byteIndex] >> $bitIndex)&1) === 1; |
|
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | $a = $row + $_col; |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | $this->matrix[$posI + $row][$posJ + $col] = |
| 585 | 585 | $row === -2 || $row === 2 |
| 586 | 586 | || $col === -2 || $col === 2 |
| 587 | - ||($row === 0 && $col === 0); |
|
| 587 | + ||($row === 0 && $col === 0); |
|
| 588 | 588 | } |
| 589 | 589 | } |
| 590 | 590 | } |