@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | */ |
60 | 60 | protected const neighbours = [ |
61 | 61 | 0b00000001 => [-1, -1], |
62 | - 0b00000010 => [ 0, -1], |
|
63 | - 0b00000100 => [ 1, -1], |
|
64 | - 0b00001000 => [ 1, 0], |
|
65 | - 0b00010000 => [ 1, 1], |
|
66 | - 0b00100000 => [ 0, 1], |
|
67 | - 0b01000000 => [-1, 1], |
|
68 | - 0b10000000 => [-1, 0] |
|
62 | + 0b00000010 => [0, -1], |
|
63 | + 0b00000100 => [1, -1], |
|
64 | + 0b00001000 => [1, 0], |
|
65 | + 0b00010000 => [1, 1], |
|
66 | + 0b00100000 => [0, 1], |
|
67 | + 0b01000000 => [-1, 1], |
|
68 | + 0b10000000 => [-1, 0] |
|
69 | 69 | ]; |
70 | 70 | |
71 | 71 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $matrix[$y] = []; |
139 | 139 | |
140 | 140 | foreach($row as $x => $val){ |
141 | - $matrix[$y][$x] = ($val & $this::IS_DARK) === $this::IS_DARK; |
|
141 | + $matrix[$y][$x] = ($val&$this::IS_DARK) === $this::IS_DARK; |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
@@ -148,21 +148,21 @@ discard block |
||
148 | 148 | /** |
149 | 149 | * Returns the current version number |
150 | 150 | */ |
151 | - public function version():?Version{ |
|
151 | + public function version(): ?Version{ |
|
152 | 152 | return $this->version; |
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
156 | 156 | * Returns the current ECC level |
157 | 157 | */ |
158 | - public function eccLevel():?EccLevel{ |
|
158 | + public function eccLevel(): ?EccLevel{ |
|
159 | 159 | return $this->eccLevel; |
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
163 | 163 | * Returns the current mask pattern |
164 | 164 | */ |
165 | - public function maskPattern():?MaskPattern{ |
|
165 | + public function maskPattern(): ?MaskPattern{ |
|
166 | 166 | return $this->maskPattern; |
167 | 167 | } |
168 | 168 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | public function set(int $x, int $y, bool $value, int $M_TYPE):self{ |
197 | 197 | |
198 | 198 | if(isset($this->matrix[$y][$x])){ |
199 | - $this->matrix[$y][$x] = $M_TYPE | ($value ? $this::IS_DARK : 0); |
|
199 | + $this->matrix[$y][$x] = $M_TYPE|($value ? $this::IS_DARK : 0); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | return $this; |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | return false; |
226 | 226 | } |
227 | 227 | |
228 | - return ($this->matrix[$y][$x] & $M_TYPE) === $M_TYPE; |
|
228 | + return ($this->matrix[$y][$x]&$M_TYPE) === $M_TYPE; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | [$ix, $iy] = $coord; |
271 | 271 | |
272 | 272 | // check if the field is the same type |
273 | - if($M_TYPE_VALUE !== null && ($this->get($x + $ix, $y + $iy) | $this::IS_DARK) !== ($M_TYPE_VALUE | $this::IS_DARK)){ |
|
273 | + if($M_TYPE_VALUE !== null && ($this->get($x + $ix, $y + $iy)|$this::IS_DARK) !== ($M_TYPE_VALUE|$this::IS_DARK)){ |
|
274 | 274 | continue; |
275 | 275 | } |
276 | 276 | |
@@ -349,8 +349,8 @@ discard block |
||
349 | 349 | |
350 | 350 | for($c = 0; $c < 3; $c++){ |
351 | 351 | for($i = 0; $i < 8; $i++){ |
352 | - $this->set($h[$c][0] , $h[$c][1] + $i, false, $this::M_SEPARATOR); |
|
353 | - $this->set($v[$c][0] - $i, $v[$c][1] , false, $this::M_SEPARATOR); |
|
352 | + $this->set($h[$c][0], $h[$c][1] + $i, false, $this::M_SEPARATOR); |
|
353 | + $this->set($v[$c][0] - $i, $v[$c][1], false, $this::M_SEPARATOR); |
|
354 | 354 | } |
355 | 355 | } |
356 | 356 | |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | foreach($this->matrix as $y => $row){ |
575 | 575 | foreach($row as $x => $val){ |
576 | 576 | // out of bounds, skip |
577 | - if($x < $start || $y < $start ||$x >= $end || $y >= $end){ |
|
577 | + if($x < $start || $y < $start || $x >= $end || $y >= $end){ |
|
578 | 578 | continue; |
579 | 579 | } |
580 | 580 | // a match |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | |
643 | 643 | foreach($this->matrix as $y => $row){ |
644 | 644 | foreach($row as $x => $val){ |
645 | - if($mask($x, $y) && ($val & $this::M_DATA) === $this::M_DATA){ |
|
645 | + if($mask($x, $y) && ($val&$this::M_DATA) === $this::M_DATA){ |
|
646 | 646 | $this->flip($x, $y); |
647 | 647 | } |
648 | 648 | } |
@@ -116,7 +116,7 @@ |
||
116 | 116 | |
117 | 117 | // scale down to the expected size |
118 | 118 | if($this->options->drawCircularModules && $this->options->scale <= 20){ |
119 | - $this->image = imagescale($this->image, $this->length/10, $this->length/10, IMG_BILINEAR_FIXED); |
|
119 | + $this->image = imagescale($this->image, $this->length / 10, $this->length / 10, IMG_BILINEAR_FIXED); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | if($this->options->returnResource){ |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @see \chillerlan\QRCode\Common\Version::AUTO |
34 | 34 | * @var int |
35 | 35 | */ |
36 | - public const VERSION_AUTO = Version::AUTO; |
|
36 | + public const VERSION_AUTO = Version::AUTO; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @deprecated 5.0.0 use MaskPattern::AUTO instead |
@@ -82,28 +82,28 @@ discard block |
||
82 | 82 | * @see \chillerlan\QRCode\Output\QROutputInterface::MARKUP_SVG |
83 | 83 | * @var string |
84 | 84 | */ |
85 | - public const OUTPUT_MARKUP_SVG = QROutputInterface::MARKUP_SVG; |
|
85 | + public const OUTPUT_MARKUP_SVG = QROutputInterface::MARKUP_SVG; |
|
86 | 86 | |
87 | 87 | /** |
88 | 88 | * @deprecated 5.0.0 use QROutputInterface::GDIMAGE_PNG instead |
89 | 89 | * @see \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_PNG |
90 | 90 | * @var string |
91 | 91 | */ |
92 | - public const OUTPUT_IMAGE_PNG = QROutputInterface::GDIMAGE_PNG; |
|
92 | + public const OUTPUT_IMAGE_PNG = QROutputInterface::GDIMAGE_PNG; |
|
93 | 93 | |
94 | 94 | /** |
95 | 95 | * @deprecated 5.0.0 use QROutputInterface::GDIMAGE_JPG instead |
96 | 96 | * @see \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_JPG |
97 | 97 | * @var string |
98 | 98 | */ |
99 | - public const OUTPUT_IMAGE_JPG = QROutputInterface::GDIMAGE_JPG; |
|
99 | + public const OUTPUT_IMAGE_JPG = QROutputInterface::GDIMAGE_JPG; |
|
100 | 100 | |
101 | 101 | /** |
102 | 102 | * @deprecated 5.0.0 use QROutputInterface::GDIMAGE_GIF instead |
103 | 103 | * @see \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_GIF |
104 | 104 | * @var string |
105 | 105 | */ |
106 | - public const OUTPUT_IMAGE_GIF = QROutputInterface::GDIMAGE_GIF; |
|
106 | + public const OUTPUT_IMAGE_GIF = QROutputInterface::GDIMAGE_GIF; |
|
107 | 107 | |
108 | 108 | /** |
109 | 109 | * @deprecated 5.0.0 use QROutputInterface::STRING_JSON instead |
@@ -124,35 +124,35 @@ discard block |
||
124 | 124 | * @see \chillerlan\QRCode\Output\QROutputInterface::IMAGICK |
125 | 125 | * @var string |
126 | 126 | */ |
127 | - public const OUTPUT_IMAGICK = QROutputInterface::IMAGICK; |
|
127 | + public const OUTPUT_IMAGICK = QROutputInterface::IMAGICK; |
|
128 | 128 | |
129 | 129 | /** |
130 | 130 | * @deprecated 5.0.0 use QROutputInterface::FPDF instead |
131 | 131 | * @see \chillerlan\QRCode\Output\QROutputInterface::FPDF |
132 | 132 | * @var string |
133 | 133 | */ |
134 | - public const OUTPUT_FPDF = QROutputInterface::FPDF; |
|
134 | + public const OUTPUT_FPDF = QROutputInterface::FPDF; |
|
135 | 135 | |
136 | 136 | /** |
137 | 137 | * @deprecated 5.0.0 use QROutputInterface::EPS instead |
138 | 138 | * @see \chillerlan\QRCode\Output\QROutputInterface::EPS |
139 | 139 | * @var string |
140 | 140 | */ |
141 | - public const OUTPUT_EPS = QROutputInterface::EPS; |
|
141 | + public const OUTPUT_EPS = QROutputInterface::EPS; |
|
142 | 142 | |
143 | 143 | /** |
144 | 144 | * @deprecated 5.0.0 use QROutputInterface::CUSTOM instead |
145 | 145 | * @see \chillerlan\QRCode\Output\QROutputInterface::CUSTOM |
146 | 146 | * @var string |
147 | 147 | */ |
148 | - public const OUTPUT_CUSTOM = QROutputInterface::CUSTOM; |
|
148 | + public const OUTPUT_CUSTOM = QROutputInterface::CUSTOM; |
|
149 | 149 | |
150 | 150 | /** |
151 | 151 | * @deprecated 5.0.0 use QROutputInterface::MODES instead |
152 | 152 | * @see \chillerlan\QRCode\Output\QROutputInterface::MODES |
153 | 153 | * @var string[] |
154 | 154 | */ |
155 | - public const OUTPUT_MODES = QROutputInterface::MODES; |
|
155 | + public const OUTPUT_MODES = QROutputInterface::MODES; |
|
156 | 156 | |
157 | 157 | /** |
158 | 158 | * The settings container |