@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @return int |
58 | 58 | */ |
59 | 59 | public function testPattern():int{ |
60 | - $penalty = 0; |
|
60 | + $penalty = 0; |
|
61 | 61 | |
62 | 62 | for($level = 1; $level <= 4; $level++){ |
63 | 63 | $penalty += call_user_func([$this, 'testLevel'.$level]); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | if($x <= $this->moduleCount - 7){ |
170 | 170 | if( |
171 | - $this->matrix->check($x , $y) |
|
171 | + $this->matrix->check($x, $y) |
|
172 | 172 | && !$this->matrix->check($x + 1, $y) |
173 | 173 | && $this->matrix->check($x + 2, $y) |
174 | 174 | && $this->matrix->check($x + 3, $y) |
@@ -293,7 +293,7 @@ |
||
293 | 293 | $this->dcdata[$key] = array_fill(0, $dcCount, null); |
294 | 294 | |
295 | 295 | foreach($this->dcdata[$key] as $a => $_z){ |
296 | - $this->dcdata[$key][$a] = 0xff & $this->bitBuffer->buffer[$a + $offset]; |
|
296 | + $this->dcdata[$key][$a] = 0xff&$this->bitBuffer->buffer[$a + $offset]; |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | [$num, $add] = $this->poly($key, $ecCount); |
@@ -84,9 +84,9 @@ |
||
84 | 84 | $matrix = $this->matrix->matrix(); |
85 | 85 | |
86 | 86 | $svg = sprintf($this->svgHeader, $this->options->cssClass, $this->options->svgViewBoxSize ?? $this->moduleCount) |
87 | - .$this->options->eol |
|
88 | - .'<defs>'.$this->options->svgDefs.'</defs>' |
|
89 | - .$this->options->eol; |
|
87 | + .$this->options->eol |
|
88 | + .'<defs>'.$this->options->svgDefs.'</defs>' |
|
89 | + .$this->options->eol; |
|
90 | 90 | |
91 | 91 | foreach($this->moduleValues as $M_TYPE => $value){ |
92 | 92 | $path = ''; |
@@ -74,7 +74,7 @@ |
||
74 | 74 | // avoid: Indirect modification of overloaded property $imageTransparencyBG has no effect |
75 | 75 | // https://stackoverflow.com/a/10455217 |
76 | 76 | $tbg = $this->options->imageTransparencyBG; |
77 | - $background = imagecolorallocate($this->image, ...$tbg); |
|
77 | + $background = imagecolorallocate($this->image, ...$tbg); |
|
78 | 78 | |
79 | 79 | if((bool)$this->options->imageTransparent && in_array($this->options->outputType, $this::TRANSPARENCY_TYPES, true)){ |
80 | 80 | imagecolortransparent($this->image, $background); |
@@ -61,14 +61,14 @@ discard block |
||
61 | 61 | 18 => [6, 30, 56, 82], |
62 | 62 | 19 => [6, 30, 58, 86], |
63 | 63 | 20 => [6, 34, 62, 90], |
64 | - 21 => [6, 28, 50, 72, 94], |
|
65 | - 22 => [6, 26, 50, 74, 98], |
|
64 | + 21 => [6, 28, 50, 72, 94], |
|
65 | + 22 => [6, 26, 50, 74, 98], |
|
66 | 66 | 23 => [6, 30, 54, 78, 102], |
67 | 67 | 24 => [6, 28, 54, 80, 106], |
68 | 68 | 25 => [6, 32, 58, 84, 110], |
69 | 69 | 26 => [6, 30, 58, 86, 114], |
70 | 70 | 27 => [6, 34, 62, 90, 118], |
71 | - 28 => [6, 26, 50, 74, 98, 122], |
|
71 | + 28 => [6, 26, 50, 74, 98, 122], |
|
72 | 72 | 29 => [6, 30, 54, 78, 102, 126], |
73 | 73 | 30 => [6, 26, 52, 78, 104, 130], |
74 | 74 | 31 => [6, 30, 56, 82, 108, 134], |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | // ECC level -> mask pattern |
129 | 129 | protected const formatPattern = [ |
130 | - [ // L |
|
130 | + [// L |
|
131 | 131 | 0b111011111000100, |
132 | 132 | 0b111001011110011, |
133 | 133 | 0b111110110101010, |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | 0b110110001000001, |
138 | 138 | 0b110100101110110, |
139 | 139 | ], |
140 | - [ // M |
|
140 | + [// M |
|
141 | 141 | 0b101010000010010, |
142 | 142 | 0b101000100100101, |
143 | 143 | 0b101111001111100, |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | 0b100111110010111, |
148 | 148 | 0b100101010100000, |
149 | 149 | ], |
150 | - [ // Q |
|
150 | + [// Q |
|
151 | 151 | 0b011010101011111, |
152 | 152 | 0b011000001101000, |
153 | 153 | 0b011111100110001, |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | 0b010111011011010, |
158 | 158 | 0b010101111101101, |
159 | 159 | ], |
160 | - [ // H |
|
160 | + [// H |
|
161 | 161 | 0b001011010001001, |
162 | 162 | 0b001001110111110, |
163 | 163 | 0b001110011100111, |
@@ -368,8 +368,8 @@ discard block |
||
368 | 368 | |
369 | 369 | for($c = 0; $c < 3; $c++){ |
370 | 370 | for($i = 0; $i < 8; $i++){ |
371 | - $this->set($h[$c][0] , $h[$c][1] + $i, false, $this::M_SEPARATOR); |
|
372 | - $this->set($v[$c][0] - $i, $v[$c][1] , false, $this::M_SEPARATOR); |
|
371 | + $this->set($h[$c][0], $h[$c][1] + $i, false, $this::M_SEPARATOR); |
|
372 | + $this->set($v[$c][0] - $i, $v[$c][1], false, $this::M_SEPARATOR); |
|
373 | 373 | } |
374 | 374 | } |
375 | 375 | |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | for($i = 0; $i < 18; $i++){ |
445 | 445 | $a = (int)floor($i / 3); |
446 | 446 | $b = $i % 3 + $this->moduleCount - 8 - 3; |
447 | - $v = !$test && (($bits >> $i) & 1) === 1; |
|
447 | + $v = !$test && (($bits >> $i)&1) === 1; |
|
448 | 448 | |
449 | 449 | $this->set($b, $a, $v, $this::M_VERSION); // ne |
450 | 450 | $this->set($a, $b, $v, $this::M_VERSION); // sw |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | $bits = $this::formatPattern[QRCode::ECC_MODES[$this->eclevel]][$maskPattern] ?? 0; |
468 | 468 | |
469 | 469 | for($i = 0; $i < 15; $i++){ |
470 | - $v = !$test && (($bits >> $i) & 1) === 1; |
|
470 | + $v = !$test && (($bits >> $i)&1) === 1; |
|
471 | 471 | |
472 | 472 | if($i < 6){ |
473 | 473 | $this->set(8, $i, $v, $this::M_FORMAT); |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | $byteCount = count($data); |
549 | 549 | $size = $this->moduleCount - 1; |
550 | 550 | |
551 | - for($i = $size, $y = $size, $inc = -1, $byteIndex = 0, $bitIndex = 7; $i > 0; $i -= 2){ |
|
551 | + for($i = $size, $y = $size, $inc = -1, $byteIndex = 0, $bitIndex = 7; $i > 0; $i -= 2){ |
|
552 | 552 | |
553 | 553 | if($i === 6){ |
554 | 554 | $i--; |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | $v = false; |
563 | 563 | |
564 | 564 | if($byteIndex < $byteCount){ |
565 | - $v = (($data[$byteIndex] >> $bitIndex) & 1) === 1; |
|
565 | + $v = (($data[$byteIndex] >> $bitIndex)&1) === 1; |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | if($this->getMask($x, $y, $maskPattern) === 0){ |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | $y += $inc; |
584 | 584 | |
585 | 585 | if($y < 0 || $this->moduleCount <= $y){ |
586 | - $y -= $inc; |
|
586 | + $y -= $inc; |
|
587 | 587 | $inc = -$inc; |
588 | 588 | |
589 | 589 | break; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $len = strlen($data); |
49 | 49 | |
50 | 50 | for($i = 0; $i + 1 < $len; $i += 2){ |
51 | - $c = ((0xff & ord($data[$i])) << 8) | (0xff & ord($data[$i + 1])); |
|
51 | + $c = ((0xff&ord($data[$i])) << 8)|(0xff&ord($data[$i + 1])); |
|
52 | 52 | |
53 | 53 | if(0x8140 <= $c && $c <= 0x9FFC){ |
54 | 54 | $c -= 0x8140; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | throw new QRCodeDataException(sprintf('illegal char at %d [%d]', $i + 1, $c)); |
61 | 61 | } |
62 | 62 | |
63 | - $this->bitBuffer->put((($c >> 8) & 0xff) * 0xC0 + ($c & 0xff), 13); |
|
63 | + $this->bitBuffer->put((($c >> 8)&0xff) * 0xC0 + ($c&0xff), 13); |
|
64 | 64 | |
65 | 65 | } |
66 | 66 |
@@ -289,7 +289,7 @@ |
||
289 | 289 | $len = strlen($string); |
290 | 290 | |
291 | 291 | while($i + 1 < $len){ |
292 | - $c = ((0xff & ord($string[$i])) << 8) | (0xff & ord($string[$i + 1])); |
|
292 | + $c = ((0xff&ord($string[$i])) << 8)|(0xff&ord($string[$i + 1])); |
|
293 | 293 | |
294 | 294 | if(!($c >= 0x8140 && $c <= 0x9FFC) && !($c >= 0xE040 && $c <= 0xEBBF)){ |
295 | 295 | return false; |