@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | */ |
74 | 74 | protected const neighbours = [ |
75 | 75 | 0b00000001 => [-1, -1], |
76 | - 0b00000010 => [ 0, -1], |
|
77 | - 0b00000100 => [ 1, -1], |
|
78 | - 0b00001000 => [ 1, 0], |
|
79 | - 0b00010000 => [ 1, 1], |
|
80 | - 0b00100000 => [ 0, 1], |
|
81 | - 0b01000000 => [-1, 1], |
|
82 | - 0b10000000 => [-1, 0], |
|
76 | + 0b00000010 => [0, -1], |
|
77 | + 0b00000100 => [1, -1], |
|
78 | + 0b00001000 => [1, 0], |
|
79 | + 0b00010000 => [1, 1], |
|
80 | + 0b00100000 => [0, 1], |
|
81 | + 0b01000000 => [-1, 1], |
|
82 | + 0b10000000 => [-1, 0], |
|
83 | 83 | ]; |
84 | 84 | |
85 | 85 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | /** |
179 | 179 | * Returns the current version number |
180 | 180 | */ |
181 | - public function getVersion():?Version{ |
|
181 | + public function getVersion(): ?Version{ |
|
182 | 182 | return $this->version; |
183 | 183 | } |
184 | 184 | |
@@ -187,14 +187,14 @@ discard block |
||
187 | 187 | * @see \chillerlan\QRCode\Data\QRMatrix::getVersion() |
188 | 188 | * @codeCoverageIgnore |
189 | 189 | */ |
190 | - public function version():?Version{ |
|
190 | + public function version(): ?Version{ |
|
191 | 191 | return $this->getVersion(); |
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
195 | 195 | * Returns the current ECC level |
196 | 196 | */ |
197 | - public function getEccLevel():?EccLevel{ |
|
197 | + public function getEccLevel(): ?EccLevel{ |
|
198 | 198 | return $this->eccLevel; |
199 | 199 | } |
200 | 200 | |
@@ -203,14 +203,14 @@ discard block |
||
203 | 203 | * @see \chillerlan\QRCode\Data\QRMatrix::getEccLevel() |
204 | 204 | * @codeCoverageIgnore |
205 | 205 | */ |
206 | - public function eccLevel():?EccLevel{ |
|
206 | + public function eccLevel(): ?EccLevel{ |
|
207 | 207 | return $this->getEccLevel(); |
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
211 | 211 | * Returns the current mask pattern |
212 | 212 | */ |
213 | - public function getMaskPattern():?MaskPattern{ |
|
213 | + public function getMaskPattern(): ?MaskPattern{ |
|
214 | 214 | return $this->maskPattern; |
215 | 215 | } |
216 | 216 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * @see \chillerlan\QRCode\Data\QRMatrix::getMaskPattern() |
220 | 220 | * @codeCoverageIgnore |
221 | 221 | */ |
222 | - public function maskPattern():?MaskPattern{ |
|
222 | + public function maskPattern(): ?MaskPattern{ |
|
223 | 223 | return $this->getMaskPattern(); |
224 | 224 | } |
225 | 225 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | public function set(int $x, int $y, bool $value, int $M_TYPE):self{ |
263 | 263 | |
264 | 264 | if(isset($this->matrix[$y][$x])){ |
265 | - $this->matrix[$y][$x] = (($M_TYPE & ~$this::IS_DARK) | (($value) ? $this::IS_DARK : 0)); |
|
265 | + $this->matrix[$y][$x] = (($M_TYPE & ~$this::IS_DARK)|(($value) ? $this::IS_DARK : 0)); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | return $this; |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | return false; |
295 | 295 | } |
296 | 296 | |
297 | - return ($val & $M_TYPE) === $M_TYPE; |
|
297 | + return ($val&$M_TYPE) === $M_TYPE; |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | /** |
@@ -407,8 +407,8 @@ discard block |
||
407 | 407 | |
408 | 408 | for($c = 0; $c < 3; $c++){ |
409 | 409 | for($i = 0; $i < 8; $i++){ |
410 | - $this->set($h[$c][0] , ($h[$c][1] + $i), false, $this::M_SEPARATOR); |
|
411 | - $this->set(($v[$c][0] - $i), $v[$c][1] , false, $this::M_SEPARATOR); |
|
410 | + $this->set($h[$c][0], ($h[$c][1] + $i), false, $this::M_SEPARATOR); |
|
411 | + $this->set(($v[$c][0] - $i), $v[$c][1], false, $this::M_SEPARATOR); |
|
412 | 412 | } |
413 | 413 | } |
414 | 414 | |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | for($y = $startY; $y < $endY; $y++){ |
640 | 640 | for($x = $startX; $x < $endX; $x++){ |
641 | 641 | // out of bounds, skip |
642 | - if($x < $start || $y < $start ||$x >= $end || $y >= $end){ |
|
642 | + if($x < $start || $y < $start || $x >= $end || $y >= $end){ |
|
643 | 643 | continue; |
644 | 644 | } |
645 | 645 | |
@@ -707,12 +707,12 @@ discard block |
||
707 | 707 | foreach($this->matrix as $y => $row){ |
708 | 708 | foreach($row as $x => $val){ |
709 | 709 | // skip non-data modules |
710 | - if(($val & $this::M_DATA) !== $this::M_DATA){ |
|
710 | + if(($val&$this::M_DATA) !== $this::M_DATA){ |
|
711 | 711 | continue; |
712 | 712 | } |
713 | 713 | |
714 | 714 | if($mask($x, $y)){ |
715 | - $this->set($x, $y, ($val & $this::IS_DARK) !== $this::IS_DARK, $val); |
|
715 | + $this->set($x, $y, ($val&$this::IS_DARK) !== $this::IS_DARK, $val); |
|
716 | 716 | } |
717 | 717 | } |
718 | 718 | } |