@@ -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; |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | return false; |
307 | 307 | } |
308 | 308 | |
309 | - return ($val & $M_TYPE) === $M_TYPE; |
|
309 | + return ($val&$M_TYPE) === $M_TYPE; |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | /** |
@@ -419,8 +419,8 @@ discard block |
||
419 | 419 | |
420 | 420 | for($c = 0; $c < 3; $c++){ |
421 | 421 | for($i = 0; $i < 8; $i++){ |
422 | - $this->set($h[$c][0] , ($h[$c][1] + $i), false, $this::M_SEPARATOR); |
|
423 | - $this->set(($v[$c][0] - $i), $v[$c][1] , false, $this::M_SEPARATOR); |
|
422 | + $this->set($h[$c][0], ($h[$c][1] + $i), false, $this::M_SEPARATOR); |
|
423 | + $this->set(($v[$c][0] - $i), $v[$c][1], false, $this::M_SEPARATOR); |
|
424 | 424 | } |
425 | 425 | } |
426 | 426 | |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | for($y = $startY; $y < $endY; $y++){ |
652 | 652 | for($x = $startX; $x < $endX; $x++){ |
653 | 653 | // out of bounds, skip |
654 | - if($x < $start || $y < $start ||$x >= $end || $y >= $end){ |
|
654 | + if($x < $start || $y < $start || $x >= $end || $y >= $end){ |
|
655 | 655 | continue; |
656 | 656 | } |
657 | 657 | |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | |
719 | 719 | foreach($this->matrix as $y => $row){ |
720 | 720 | foreach($row as $x => $val){ |
721 | - if($mask($x, $y) && ($val & $this::M_DATA) === $this::M_DATA){ |
|
721 | + if($mask($x, $y) && ($val&$this::M_DATA) === $this::M_DATA){ |
|
722 | 722 | $this->flip($x, $y); |
723 | 723 | } |
724 | 724 | } |