@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @see \chillerlan\QRCode\Common\Version::AUTO |
36 | 36 | * @var int |
37 | 37 | */ |
38 | - public const VERSION_AUTO = Version::AUTO; |
|
38 | + public const VERSION_AUTO = Version::AUTO; |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * @deprecated 5.0.0 use MaskPattern::AUTO instead |
@@ -84,28 +84,28 @@ discard block |
||
84 | 84 | * @see \chillerlan\QRCode\Output\QROutputInterface::MARKUP_SVG |
85 | 85 | * @var string |
86 | 86 | */ |
87 | - public const OUTPUT_MARKUP_SVG = QROutputInterface::MARKUP_SVG; |
|
87 | + public const OUTPUT_MARKUP_SVG = QROutputInterface::MARKUP_SVG; |
|
88 | 88 | |
89 | 89 | /** |
90 | 90 | * @deprecated 5.0.0 use QROutputInterface::GDIMAGE_PNG instead |
91 | 91 | * @see \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_PNG |
92 | 92 | * @var string |
93 | 93 | */ |
94 | - public const OUTPUT_IMAGE_PNG = QROutputInterface::GDIMAGE_PNG; |
|
94 | + public const OUTPUT_IMAGE_PNG = QROutputInterface::GDIMAGE_PNG; |
|
95 | 95 | |
96 | 96 | /** |
97 | 97 | * @deprecated 5.0.0 use QROutputInterface::GDIMAGE_JPG instead |
98 | 98 | * @see \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_JPG |
99 | 99 | * @var string |
100 | 100 | */ |
101 | - public const OUTPUT_IMAGE_JPG = QROutputInterface::GDIMAGE_JPG; |
|
101 | + public const OUTPUT_IMAGE_JPG = QROutputInterface::GDIMAGE_JPG; |
|
102 | 102 | |
103 | 103 | /** |
104 | 104 | * @deprecated 5.0.0 use QROutputInterface::GDIMAGE_GIF instead |
105 | 105 | * @see \chillerlan\QRCode\Output\QROutputInterface::GDIMAGE_GIF |
106 | 106 | * @var string |
107 | 107 | */ |
108 | - public const OUTPUT_IMAGE_GIF = QROutputInterface::GDIMAGE_GIF; |
|
108 | + public const OUTPUT_IMAGE_GIF = QROutputInterface::GDIMAGE_GIF; |
|
109 | 109 | |
110 | 110 | /** |
111 | 111 | * @deprecated 5.0.0 use QROutputInterface::STRING_JSON instead |
@@ -126,35 +126,35 @@ discard block |
||
126 | 126 | * @see \chillerlan\QRCode\Output\QROutputInterface::IMAGICK |
127 | 127 | * @var string |
128 | 128 | */ |
129 | - public const OUTPUT_IMAGICK = QROutputInterface::IMAGICK; |
|
129 | + public const OUTPUT_IMAGICK = QROutputInterface::IMAGICK; |
|
130 | 130 | |
131 | 131 | /** |
132 | 132 | * @deprecated 5.0.0 use QROutputInterface::FPDF instead |
133 | 133 | * @see \chillerlan\QRCode\Output\QROutputInterface::FPDF |
134 | 134 | * @var string |
135 | 135 | */ |
136 | - public const OUTPUT_FPDF = QROutputInterface::FPDF; |
|
136 | + public const OUTPUT_FPDF = QROutputInterface::FPDF; |
|
137 | 137 | |
138 | 138 | /** |
139 | 139 | * @deprecated 5.0.0 use QROutputInterface::EPS instead |
140 | 140 | * @see \chillerlan\QRCode\Output\QROutputInterface::EPS |
141 | 141 | * @var string |
142 | 142 | */ |
143 | - public const OUTPUT_EPS = QROutputInterface::EPS; |
|
143 | + public const OUTPUT_EPS = QROutputInterface::EPS; |
|
144 | 144 | |
145 | 145 | /** |
146 | 146 | * @deprecated 5.0.0 use QROutputInterface::CUSTOM instead |
147 | 147 | * @see \chillerlan\QRCode\Output\QROutputInterface::CUSTOM |
148 | 148 | * @var string |
149 | 149 | */ |
150 | - public const OUTPUT_CUSTOM = QROutputInterface::CUSTOM; |
|
150 | + public const OUTPUT_CUSTOM = QROutputInterface::CUSTOM; |
|
151 | 151 | |
152 | 152 | /** |
153 | 153 | * @deprecated 5.0.0 use QROutputInterface::MODES instead |
154 | 154 | * @see \chillerlan\QRCode\Output\QROutputInterface::MODES |
155 | 155 | * @var string[] |
156 | 156 | */ |
157 | - public const OUTPUT_MODES = QROutputInterface::MODES; |
|
157 | + public const OUTPUT_MODES = QROutputInterface::MODES; |
|
158 | 158 | |
159 | 159 | /** |
160 | 160 | * The settings container |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | * @throws \chillerlan\QRCode\Output\QRCodeOutputException |
272 | 272 | */ |
273 | 273 | protected function initOutputInterface(QRMatrix $matrix):QROutputInterface{ |
274 | - $outputInterface =( QROutputInterface::MODES[$this->options->outputType] ?? null); |
|
274 | + $outputInterface = (QROutputInterface::MODES[$this->options->outputType] ?? null); |
|
275 | 275 | |
276 | 276 | if($this->options->outputType === QROutputInterface::CUSTOM){ |
277 | 277 | $outputInterface = $this->options->outputInterface; |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | // This class uses 5x5 blocks to compute local luminance, where each block is 8x8 pixels. |
37 | 37 | // So this is the smallest dimension in each axis we can accept. |
38 | 38 | private const BLOCK_SIZE_POWER = 3; |
39 | - private const BLOCK_SIZE = 8; // ...0100...00 |
|
40 | - private const BLOCK_SIZE_MASK = 7; // ...0011...11 |
|
39 | + private const BLOCK_SIZE = 8; // ...0100...00 |
|
40 | + private const BLOCK_SIZE_MASK = 7; // ...0011...11 |
|
41 | 41 | private const MINIMUM_DIMENSION = 40; |
42 | 42 | private const MIN_DYNAMIC_RANGE = 24; |
43 | 43 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | for($xx = 0; $xx < self::BLOCK_SIZE; $xx++){ |
236 | 236 | $pixel = ((int)($this->luminances[(int)($offset + $xx)]) & 0xff); |
237 | - $sum += $pixel; |
|
237 | + $sum += $pixel; |
|
238 | 238 | // still looking for good contrast |
239 | 239 | if($pixel < $min){ |
240 | 240 | $min = $pixel; |
@@ -163,7 +163,8 @@ |
||
163 | 163 | $str = AlphaNum::decodeSegment($this->bitBuffer, $versionNumber); |
164 | 164 | |
165 | 165 | // See section 6.4.8.1, 6.4.8.2 |
166 | - if($fc1InEffect){ // ??? |
|
166 | + if($fc1InEffect){ |
|
167 | +// ??? |
|
167 | 168 | // We need to massage the result a bit if in an FNC1 mode: |
168 | 169 | $str = str_replace(chr(0x1d), '%', $str); |
169 | 170 | $str = str_replace('%%', '%', $str); |
@@ -220,8 +220,8 @@ discard block |
||
220 | 220 | // Should return null, but, some QR codes apparently do not mask this info. |
221 | 221 | // Try again by actually masking the pattern first. |
222 | 222 | $formatInfo = $this->doDecodeFormatInformation( |
223 | - ($formatInfoBits1 ^ $this::FORMAT_INFO_MASK_QR), |
|
224 | - ($formatInfoBits2 ^ $this::FORMAT_INFO_MASK_QR) |
|
223 | + ($formatInfoBits1^$this::FORMAT_INFO_MASK_QR), |
|
224 | + ($formatInfoBits2^$this::FORMAT_INFO_MASK_QR) |
|
225 | 225 | ); |
226 | 226 | |
227 | 227 | // still nothing??? |
@@ -246,13 +246,13 @@ discard block |
||
246 | 246 | ? $this->check($j, $i) |
247 | 247 | : $this->check($i, $j); |
248 | 248 | |
249 | - return ($bit) ? (($versionBits << 1) | 0x1) : ($versionBits << 1); |
|
249 | + return ($bit) ? (($versionBits << 1)|0x1) : ($versionBits << 1); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
253 | 253 | * Returns information about the format it specifies, or null if it doesn't seem to match any known pattern |
254 | 254 | */ |
255 | - private function doDecodeFormatInformation(int $maskedFormatInfo1, int $maskedFormatInfo2):?int{ |
|
255 | + private function doDecodeFormatInformation(int $maskedFormatInfo1, int $maskedFormatInfo2): ?int{ |
|
256 | 256 | $bestDifference = PHP_INT_MAX; |
257 | 257 | $bestFormatInfo = 0; |
258 | 258 | |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | /** |
349 | 349 | * Decodes the version information from the given bit sequence, returns null if no valid match is found. |
350 | 350 | */ |
351 | - private function decodeVersionInformation(int $versionBits):?Version{ |
|
351 | + private function decodeVersionInformation(int $versionBits): ?Version{ |
|
352 | 352 | $bestDifference = PHP_INT_MAX; |
353 | 353 | $bestVersion = 0; |
354 | 354 |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | 18 => [6, 30, 56, 82], |
55 | 55 | 19 => [6, 30, 58, 86], |
56 | 56 | 20 => [6, 34, 62, 90], |
57 | - 21 => [6, 28, 50, 72, 94], |
|
58 | - 22 => [6, 26, 50, 74, 98], |
|
57 | + 21 => [6, 28, 50, 72, 94], |
|
58 | + 22 => [6, 26, 50, 74, 98], |
|
59 | 59 | 23 => [6, 30, 54, 78, 102], |
60 | 60 | 24 => [6, 28, 54, 80, 106], |
61 | 61 | 25 => [6, 32, 58, 84, 110], |
62 | 62 | 26 => [6, 30, 58, 86, 114], |
63 | 63 | 27 => [6, 34, 62, 90, 118], |
64 | - 28 => [6, 26, 50, 74, 98, 122], |
|
64 | + 28 => [6, 26, 50, 74, 98, 122], |
|
65 | 65 | 29 => [6, 30, 54, 78, 102, 126], |
66 | 66 | 30 => [6, 26, 52, 78, 104, 130], |
67 | 67 | 31 => [6, 30, 56, 82, 108, 134], |
@@ -126,46 +126,46 @@ discard block |
||
126 | 126 | * @see http://www.thonky.com/qr-code-tutorial/error-correction-table |
127 | 127 | */ |
128 | 128 | private const RSBLOCKS = [ |
129 | - 1 => [[ 7, [[ 1, 19], [ 0, 0]]], [10, [[ 1, 16], [ 0, 0]]], [13, [[ 1, 13], [ 0, 0]]], [17, [[ 1, 9], [ 0, 0]]]], |
|
130 | - 2 => [[10, [[ 1, 34], [ 0, 0]]], [16, [[ 1, 28], [ 0, 0]]], [22, [[ 1, 22], [ 0, 0]]], [28, [[ 1, 16], [ 0, 0]]]], |
|
131 | - 3 => [[15, [[ 1, 55], [ 0, 0]]], [26, [[ 1, 44], [ 0, 0]]], [18, [[ 2, 17], [ 0, 0]]], [22, [[ 2, 13], [ 0, 0]]]], |
|
132 | - 4 => [[20, [[ 1, 80], [ 0, 0]]], [18, [[ 2, 32], [ 0, 0]]], [26, [[ 2, 24], [ 0, 0]]], [16, [[ 4, 9], [ 0, 0]]]], |
|
133 | - 5 => [[26, [[ 1, 108], [ 0, 0]]], [24, [[ 2, 43], [ 0, 0]]], [18, [[ 2, 15], [ 2, 16]]], [22, [[ 2, 11], [ 2, 12]]]], |
|
134 | - 6 => [[18, [[ 2, 68], [ 0, 0]]], [16, [[ 4, 27], [ 0, 0]]], [24, [[ 4, 19], [ 0, 0]]], [28, [[ 4, 15], [ 0, 0]]]], |
|
135 | - 7 => [[20, [[ 2, 78], [ 0, 0]]], [18, [[ 4, 31], [ 0, 0]]], [18, [[ 2, 14], [ 4, 15]]], [26, [[ 4, 13], [ 1, 14]]]], |
|
136 | - 8 => [[24, [[ 2, 97], [ 0, 0]]], [22, [[ 2, 38], [ 2, 39]]], [22, [[ 4, 18], [ 2, 19]]], [26, [[ 4, 14], [ 2, 15]]]], |
|
137 | - 9 => [[30, [[ 2, 116], [ 0, 0]]], [22, [[ 3, 36], [ 2, 37]]], [20, [[ 4, 16], [ 4, 17]]], [24, [[ 4, 12], [ 4, 13]]]], |
|
138 | - 10 => [[18, [[ 2, 68], [ 2, 69]]], [26, [[ 4, 43], [ 1, 44]]], [24, [[ 6, 19], [ 2, 20]]], [28, [[ 6, 15], [ 2, 16]]]], |
|
139 | - 11 => [[20, [[ 4, 81], [ 0, 0]]], [30, [[ 1, 50], [ 4, 51]]], [28, [[ 4, 22], [ 4, 23]]], [24, [[ 3, 12], [ 8, 13]]]], |
|
140 | - 12 => [[24, [[ 2, 92], [ 2, 93]]], [22, [[ 6, 36], [ 2, 37]]], [26, [[ 4, 20], [ 6, 21]]], [28, [[ 7, 14], [ 4, 15]]]], |
|
141 | - 13 => [[26, [[ 4, 107], [ 0, 0]]], [22, [[ 8, 37], [ 1, 38]]], [24, [[ 8, 20], [ 4, 21]]], [22, [[12, 11], [ 4, 12]]]], |
|
142 | - 14 => [[30, [[ 3, 115], [ 1, 116]]], [24, [[ 4, 40], [ 5, 41]]], [20, [[11, 16], [ 5, 17]]], [24, [[11, 12], [ 5, 13]]]], |
|
143 | - 15 => [[22, [[ 5, 87], [ 1, 88]]], [24, [[ 5, 41], [ 5, 42]]], [30, [[ 5, 24], [ 7, 25]]], [24, [[11, 12], [ 7, 13]]]], |
|
144 | - 16 => [[24, [[ 5, 98], [ 1, 99]]], [28, [[ 7, 45], [ 3, 46]]], [24, [[15, 19], [ 2, 20]]], [30, [[ 3, 15], [13, 16]]]], |
|
145 | - 17 => [[28, [[ 1, 107], [ 5, 108]]], [28, [[10, 46], [ 1, 47]]], [28, [[ 1, 22], [15, 23]]], [28, [[ 2, 14], [17, 15]]]], |
|
146 | - 18 => [[30, [[ 5, 120], [ 1, 121]]], [26, [[ 9, 43], [ 4, 44]]], [28, [[17, 22], [ 1, 23]]], [28, [[ 2, 14], [19, 15]]]], |
|
147 | - 19 => [[28, [[ 3, 113], [ 4, 114]]], [26, [[ 3, 44], [11, 45]]], [26, [[17, 21], [ 4, 22]]], [26, [[ 9, 13], [16, 14]]]], |
|
148 | - 20 => [[28, [[ 3, 107], [ 5, 108]]], [26, [[ 3, 41], [13, 42]]], [30, [[15, 24], [ 5, 25]]], [28, [[15, 15], [10, 16]]]], |
|
149 | - 21 => [[28, [[ 4, 116], [ 4, 117]]], [26, [[17, 42], [ 0, 0]]], [28, [[17, 22], [ 6, 23]]], [30, [[19, 16], [ 6, 17]]]], |
|
150 | - 22 => [[28, [[ 2, 111], [ 7, 112]]], [28, [[17, 46], [ 0, 0]]], [30, [[ 7, 24], [16, 25]]], [24, [[34, 13], [ 0, 0]]]], |
|
151 | - 23 => [[30, [[ 4, 121], [ 5, 122]]], [28, [[ 4, 47], [14, 48]]], [30, [[11, 24], [14, 25]]], [30, [[16, 15], [14, 16]]]], |
|
152 | - 24 => [[30, [[ 6, 117], [ 4, 118]]], [28, [[ 6, 45], [14, 46]]], [30, [[11, 24], [16, 25]]], [30, [[30, 16], [ 2, 17]]]], |
|
153 | - 25 => [[26, [[ 8, 106], [ 4, 107]]], [28, [[ 8, 47], [13, 48]]], [30, [[ 7, 24], [22, 25]]], [30, [[22, 15], [13, 16]]]], |
|
154 | - 26 => [[28, [[10, 114], [ 2, 115]]], [28, [[19, 46], [ 4, 47]]], [28, [[28, 22], [ 6, 23]]], [30, [[33, 16], [ 4, 17]]]], |
|
155 | - 27 => [[30, [[ 8, 122], [ 4, 123]]], [28, [[22, 45], [ 3, 46]]], [30, [[ 8, 23], [26, 24]]], [30, [[12, 15], [28, 16]]]], |
|
156 | - 28 => [[30, [[ 3, 117], [10, 118]]], [28, [[ 3, 45], [23, 46]]], [30, [[ 4, 24], [31, 25]]], [30, [[11, 15], [31, 16]]]], |
|
157 | - 29 => [[30, [[ 7, 116], [ 7, 117]]], [28, [[21, 45], [ 7, 46]]], [30, [[ 1, 23], [37, 24]]], [30, [[19, 15], [26, 16]]]], |
|
158 | - 30 => [[30, [[ 5, 115], [10, 116]]], [28, [[19, 47], [10, 48]]], [30, [[15, 24], [25, 25]]], [30, [[23, 15], [25, 16]]]], |
|
159 | - 31 => [[30, [[13, 115], [ 3, 116]]], [28, [[ 2, 46], [29, 47]]], [30, [[42, 24], [ 1, 25]]], [30, [[23, 15], [28, 16]]]], |
|
160 | - 32 => [[30, [[17, 115], [ 0, 0]]], [28, [[10, 46], [23, 47]]], [30, [[10, 24], [35, 25]]], [30, [[19, 15], [35, 16]]]], |
|
161 | - 33 => [[30, [[17, 115], [ 1, 116]]], [28, [[14, 46], [21, 47]]], [30, [[29, 24], [19, 25]]], [30, [[11, 15], [46, 16]]]], |
|
162 | - 34 => [[30, [[13, 115], [ 6, 116]]], [28, [[14, 46], [23, 47]]], [30, [[44, 24], [ 7, 25]]], [30, [[59, 16], [ 1, 17]]]], |
|
163 | - 35 => [[30, [[12, 121], [ 7, 122]]], [28, [[12, 47], [26, 48]]], [30, [[39, 24], [14, 25]]], [30, [[22, 15], [41, 16]]]], |
|
164 | - 36 => [[30, [[ 6, 121], [14, 122]]], [28, [[ 6, 47], [34, 48]]], [30, [[46, 24], [10, 25]]], [30, [[ 2, 15], [64, 16]]]], |
|
165 | - 37 => [[30, [[17, 122], [ 4, 123]]], [28, [[29, 46], [14, 47]]], [30, [[49, 24], [10, 25]]], [30, [[24, 15], [46, 16]]]], |
|
166 | - 38 => [[30, [[ 4, 122], [18, 123]]], [28, [[13, 46], [32, 47]]], [30, [[48, 24], [14, 25]]], [30, [[42, 15], [32, 16]]]], |
|
167 | - 39 => [[30, [[20, 117], [ 4, 118]]], [28, [[40, 47], [ 7, 48]]], [30, [[43, 24], [22, 25]]], [30, [[10, 15], [67, 16]]]], |
|
168 | - 40 => [[30, [[19, 118], [ 6, 119]]], [28, [[18, 47], [31, 48]]], [30, [[34, 24], [34, 25]]], [30, [[20, 15], [61, 16]]]], |
|
129 | + 1 => [[7, [[1, 19], [0, 0]]], [10, [[1, 16], [0, 0]]], [13, [[1, 13], [0, 0]]], [17, [[1, 9], [0, 0]]]], |
|
130 | + 2 => [[10, [[1, 34], [0, 0]]], [16, [[1, 28], [0, 0]]], [22, [[1, 22], [0, 0]]], [28, [[1, 16], [0, 0]]]], |
|
131 | + 3 => [[15, [[1, 55], [0, 0]]], [26, [[1, 44], [0, 0]]], [18, [[2, 17], [0, 0]]], [22, [[2, 13], [0, 0]]]], |
|
132 | + 4 => [[20, [[1, 80], [0, 0]]], [18, [[2, 32], [0, 0]]], [26, [[2, 24], [0, 0]]], [16, [[4, 9], [0, 0]]]], |
|
133 | + 5 => [[26, [[1, 108], [0, 0]]], [24, [[2, 43], [0, 0]]], [18, [[2, 15], [2, 16]]], [22, [[2, 11], [2, 12]]]], |
|
134 | + 6 => [[18, [[2, 68], [0, 0]]], [16, [[4, 27], [0, 0]]], [24, [[4, 19], [0, 0]]], [28, [[4, 15], [0, 0]]]], |
|
135 | + 7 => [[20, [[2, 78], [0, 0]]], [18, [[4, 31], [0, 0]]], [18, [[2, 14], [4, 15]]], [26, [[4, 13], [1, 14]]]], |
|
136 | + 8 => [[24, [[2, 97], [0, 0]]], [22, [[2, 38], [2, 39]]], [22, [[4, 18], [2, 19]]], [26, [[4, 14], [2, 15]]]], |
|
137 | + 9 => [[30, [[2, 116], [0, 0]]], [22, [[3, 36], [2, 37]]], [20, [[4, 16], [4, 17]]], [24, [[4, 12], [4, 13]]]], |
|
138 | + 10 => [[18, [[2, 68], [2, 69]]], [26, [[4, 43], [1, 44]]], [24, [[6, 19], [2, 20]]], [28, [[6, 15], [2, 16]]]], |
|
139 | + 11 => [[20, [[4, 81], [0, 0]]], [30, [[1, 50], [4, 51]]], [28, [[4, 22], [4, 23]]], [24, [[3, 12], [8, 13]]]], |
|
140 | + 12 => [[24, [[2, 92], [2, 93]]], [22, [[6, 36], [2, 37]]], [26, [[4, 20], [6, 21]]], [28, [[7, 14], [4, 15]]]], |
|
141 | + 13 => [[26, [[4, 107], [0, 0]]], [22, [[8, 37], [1, 38]]], [24, [[8, 20], [4, 21]]], [22, [[12, 11], [4, 12]]]], |
|
142 | + 14 => [[30, [[3, 115], [1, 116]]], [24, [[4, 40], [5, 41]]], [20, [[11, 16], [5, 17]]], [24, [[11, 12], [5, 13]]]], |
|
143 | + 15 => [[22, [[5, 87], [1, 88]]], [24, [[5, 41], [5, 42]]], [30, [[5, 24], [7, 25]]], [24, [[11, 12], [7, 13]]]], |
|
144 | + 16 => [[24, [[5, 98], [1, 99]]], [28, [[7, 45], [3, 46]]], [24, [[15, 19], [2, 20]]], [30, [[3, 15], [13, 16]]]], |
|
145 | + 17 => [[28, [[1, 107], [5, 108]]], [28, [[10, 46], [1, 47]]], [28, [[1, 22], [15, 23]]], [28, [[2, 14], [17, 15]]]], |
|
146 | + 18 => [[30, [[5, 120], [1, 121]]], [26, [[9, 43], [4, 44]]], [28, [[17, 22], [1, 23]]], [28, [[2, 14], [19, 15]]]], |
|
147 | + 19 => [[28, [[3, 113], [4, 114]]], [26, [[3, 44], [11, 45]]], [26, [[17, 21], [4, 22]]], [26, [[9, 13], [16, 14]]]], |
|
148 | + 20 => [[28, [[3, 107], [5, 108]]], [26, [[3, 41], [13, 42]]], [30, [[15, 24], [5, 25]]], [28, [[15, 15], [10, 16]]]], |
|
149 | + 21 => [[28, [[4, 116], [4, 117]]], [26, [[17, 42], [0, 0]]], [28, [[17, 22], [6, 23]]], [30, [[19, 16], [6, 17]]]], |
|
150 | + 22 => [[28, [[2, 111], [7, 112]]], [28, [[17, 46], [0, 0]]], [30, [[7, 24], [16, 25]]], [24, [[34, 13], [0, 0]]]], |
|
151 | + 23 => [[30, [[4, 121], [5, 122]]], [28, [[4, 47], [14, 48]]], [30, [[11, 24], [14, 25]]], [30, [[16, 15], [14, 16]]]], |
|
152 | + 24 => [[30, [[6, 117], [4, 118]]], [28, [[6, 45], [14, 46]]], [30, [[11, 24], [16, 25]]], [30, [[30, 16], [2, 17]]]], |
|
153 | + 25 => [[26, [[8, 106], [4, 107]]], [28, [[8, 47], [13, 48]]], [30, [[7, 24], [22, 25]]], [30, [[22, 15], [13, 16]]]], |
|
154 | + 26 => [[28, [[10, 114], [2, 115]]], [28, [[19, 46], [4, 47]]], [28, [[28, 22], [6, 23]]], [30, [[33, 16], [4, 17]]]], |
|
155 | + 27 => [[30, [[8, 122], [4, 123]]], [28, [[22, 45], [3, 46]]], [30, [[8, 23], [26, 24]]], [30, [[12, 15], [28, 16]]]], |
|
156 | + 28 => [[30, [[3, 117], [10, 118]]], [28, [[3, 45], [23, 46]]], [30, [[4, 24], [31, 25]]], [30, [[11, 15], [31, 16]]]], |
|
157 | + 29 => [[30, [[7, 116], [7, 117]]], [28, [[21, 45], [7, 46]]], [30, [[1, 23], [37, 24]]], [30, [[19, 15], [26, 16]]]], |
|
158 | + 30 => [[30, [[5, 115], [10, 116]]], [28, [[19, 47], [10, 48]]], [30, [[15, 24], [25, 25]]], [30, [[23, 15], [25, 16]]]], |
|
159 | + 31 => [[30, [[13, 115], [3, 116]]], [28, [[2, 46], [29, 47]]], [30, [[42, 24], [1, 25]]], [30, [[23, 15], [28, 16]]]], |
|
160 | + 32 => [[30, [[17, 115], [0, 0]]], [28, [[10, 46], [23, 47]]], [30, [[10, 24], [35, 25]]], [30, [[19, 15], [35, 16]]]], |
|
161 | + 33 => [[30, [[17, 115], [1, 116]]], [28, [[14, 46], [21, 47]]], [30, [[29, 24], [19, 25]]], [30, [[11, 15], [46, 16]]]], |
|
162 | + 34 => [[30, [[13, 115], [6, 116]]], [28, [[14, 46], [23, 47]]], [30, [[44, 24], [7, 25]]], [30, [[59, 16], [1, 17]]]], |
|
163 | + 35 => [[30, [[12, 121], [7, 122]]], [28, [[12, 47], [26, 48]]], [30, [[39, 24], [14, 25]]], [30, [[22, 15], [41, 16]]]], |
|
164 | + 36 => [[30, [[6, 121], [14, 122]]], [28, [[6, 47], [34, 48]]], [30, [[46, 24], [10, 25]]], [30, [[2, 15], [64, 16]]]], |
|
165 | + 37 => [[30, [[17, 122], [4, 123]]], [28, [[29, 46], [14, 47]]], [30, [[49, 24], [10, 25]]], [30, [[24, 15], [46, 16]]]], |
|
166 | + 38 => [[30, [[4, 122], [18, 123]]], [28, [[13, 46], [32, 47]]], [30, [[48, 24], [14, 25]]], [30, [[42, 15], [32, 16]]]], |
|
167 | + 39 => [[30, [[20, 117], [4, 118]]], [28, [[40, 47], [7, 48]]], [30, [[43, 24], [22, 25]]], [30, [[10, 15], [67, 16]]]], |
|
168 | + 40 => [[30, [[19, 118], [6, 119]]], [28, [[18, 47], [31, 48]]], [30, [[34, 24], [34, 25]]], [30, [[20, 15], [61, 16]]]], |
|
169 | 169 | ]; |
170 | 170 | |
171 | 171 | /** |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | /** |
258 | 258 | * the version pattern for the given version |
259 | 259 | */ |
260 | - public function getVersionPattern():?int{ |
|
260 | + public function getVersionPattern(): ?int{ |
|
261 | 261 | return (self::VERSION_PATTERN[$this->version] ?? null); |
262 | 262 | } |
263 | 263 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | [$numEccCodewords, $eccBlocks] = $this->version->getRSBlocks($this->eccLevel); |
79 | 79 | |
80 | 80 | // Now establish DataBlocks of the appropriate size and number of data codewords |
81 | - $result = [];//new DataBlock[$totalBlocks]; |
|
81 | + $result = []; //new DataBlock[$totalBlocks]; |
|
82 | 82 | $numResultBlocks = 0; |
83 | 83 | |
84 | 84 | foreach($eccBlocks as $blockData){ |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | // Above should work but fails on some Apple and Linux JDKs due to a Hotspot bug. |
305 | 305 | // Below is a funny-looking workaround from Steven Parkes |
306 | 306 | $term = GF256::multiply($errorLocations[$j], $xiInverse); |
307 | - $denominator = GF256::multiply($denominator, ((($term & 0x1) === 0) ? ($term | 1) : ($term & ~1))); |
|
307 | + $denominator = GF256::multiply($denominator, ((($term & 0x1) === 0) ? ($term|1) : ($term & ~1))); |
|
308 | 308 | } |
309 | 309 | } |
310 | 310 |
@@ -36,41 +36,41 @@ discard block |
||
36 | 36 | |
37 | 37 | private const logTable = [ |
38 | 38 | 0, // the first value is never returned, index starts at 1 |
39 | - 0, 1, 25, 2, 50, 26, 198, 3, 223, 51, 238, 27, 104, 199, 75, |
|
40 | - 4, 100, 224, 14, 52, 141, 239, 129, 28, 193, 105, 248, 200, 8, 76, 113, |
|
41 | - 5, 138, 101, 47, 225, 36, 15, 33, 53, 147, 142, 218, 240, 18, 130, 69, |
|
42 | - 29, 181, 194, 125, 106, 39, 249, 185, 201, 154, 9, 120, 77, 228, 114, 166, |
|
43 | - 6, 191, 139, 98, 102, 221, 48, 253, 226, 152, 37, 179, 16, 145, 34, 136, |
|
44 | - 54, 208, 148, 206, 143, 150, 219, 189, 241, 210, 19, 92, 131, 56, 70, 64, |
|
45 | - 30, 66, 182, 163, 195, 72, 126, 110, 107, 58, 40, 84, 250, 133, 186, 61, |
|
46 | - 202, 94, 155, 159, 10, 21, 121, 43, 78, 212, 229, 172, 115, 243, 167, 87, |
|
47 | - 7, 112, 192, 247, 140, 128, 99, 13, 103, 74, 222, 237, 49, 197, 254, 24, |
|
48 | - 227, 165, 153, 119, 38, 184, 180, 124, 17, 68, 146, 217, 35, 32, 137, 46, |
|
49 | - 55, 63, 209, 91, 149, 188, 207, 205, 144, 135, 151, 178, 220, 252, 190, 97, |
|
50 | - 242, 86, 211, 171, 20, 42, 93, 158, 132, 60, 57, 83, 71, 109, 65, 162, |
|
51 | - 31, 45, 67, 216, 183, 123, 164, 118, 196, 23, 73, 236, 127, 12, 111, 246, |
|
52 | - 108, 161, 59, 82, 41, 157, 85, 170, 251, 96, 134, 177, 187, 204, 62, 90, |
|
53 | - 203, 89, 95, 176, 156, 169, 160, 81, 11, 245, 22, 235, 122, 117, 44, 215, |
|
54 | - 79, 174, 213, 233, 230, 231, 173, 232, 116, 214, 244, 234, 168, 80, 88, 175, |
|
39 | + 0, 1, 25, 2, 50, 26, 198, 3, 223, 51, 238, 27, 104, 199, 75, |
|
40 | + 4, 100, 224, 14, 52, 141, 239, 129, 28, 193, 105, 248, 200, 8, 76, 113, |
|
41 | + 5, 138, 101, 47, 225, 36, 15, 33, 53, 147, 142, 218, 240, 18, 130, 69, |
|
42 | + 29, 181, 194, 125, 106, 39, 249, 185, 201, 154, 9, 120, 77, 228, 114, 166, |
|
43 | + 6, 191, 139, 98, 102, 221, 48, 253, 226, 152, 37, 179, 16, 145, 34, 136, |
|
44 | + 54, 208, 148, 206, 143, 150, 219, 189, 241, 210, 19, 92, 131, 56, 70, 64, |
|
45 | + 30, 66, 182, 163, 195, 72, 126, 110, 107, 58, 40, 84, 250, 133, 186, 61, |
|
46 | + 202, 94, 155, 159, 10, 21, 121, 43, 78, 212, 229, 172, 115, 243, 167, 87, |
|
47 | + 7, 112, 192, 247, 140, 128, 99, 13, 103, 74, 222, 237, 49, 197, 254, 24, |
|
48 | + 227, 165, 153, 119, 38, 184, 180, 124, 17, 68, 146, 217, 35, 32, 137, 46, |
|
49 | + 55, 63, 209, 91, 149, 188, 207, 205, 144, 135, 151, 178, 220, 252, 190, 97, |
|
50 | + 242, 86, 211, 171, 20, 42, 93, 158, 132, 60, 57, 83, 71, 109, 65, 162, |
|
51 | + 31, 45, 67, 216, 183, 123, 164, 118, 196, 23, 73, 236, 127, 12, 111, 246, |
|
52 | + 108, 161, 59, 82, 41, 157, 85, 170, 251, 96, 134, 177, 187, 204, 62, 90, |
|
53 | + 203, 89, 95, 176, 156, 169, 160, 81, 11, 245, 22, 235, 122, 117, 44, 215, |
|
54 | + 79, 174, 213, 233, 230, 231, 173, 232, 116, 214, 244, 234, 168, 80, 88, 175, |
|
55 | 55 | ]; |
56 | 56 | |
57 | 57 | private const expTable = [ |
58 | - 1, 2, 4, 8, 16, 32, 64, 128, 29, 58, 116, 232, 205, 135, 19, 38, |
|
59 | - 76, 152, 45, 90, 180, 117, 234, 201, 143, 3, 6, 12, 24, 48, 96, 192, |
|
60 | - 157, 39, 78, 156, 37, 74, 148, 53, 106, 212, 181, 119, 238, 193, 159, 35, |
|
61 | - 70, 140, 5, 10, 20, 40, 80, 160, 93, 186, 105, 210, 185, 111, 222, 161, |
|
62 | - 95, 190, 97, 194, 153, 47, 94, 188, 101, 202, 137, 15, 30, 60, 120, 240, |
|
63 | - 253, 231, 211, 187, 107, 214, 177, 127, 254, 225, 223, 163, 91, 182, 113, 226, |
|
64 | - 217, 175, 67, 134, 17, 34, 68, 136, 13, 26, 52, 104, 208, 189, 103, 206, |
|
65 | - 129, 31, 62, 124, 248, 237, 199, 147, 59, 118, 236, 197, 151, 51, 102, 204, |
|
66 | - 133, 23, 46, 92, 184, 109, 218, 169, 79, 158, 33, 66, 132, 21, 42, 84, |
|
67 | - 168, 77, 154, 41, 82, 164, 85, 170, 73, 146, 57, 114, 228, 213, 183, 115, |
|
68 | - 230, 209, 191, 99, 198, 145, 63, 126, 252, 229, 215, 179, 123, 246, 241, 255, |
|
69 | - 227, 219, 171, 75, 150, 49, 98, 196, 149, 55, 110, 220, 165, 87, 174, 65, |
|
70 | - 130, 25, 50, 100, 200, 141, 7, 14, 28, 56, 112, 224, 221, 167, 83, 166, |
|
71 | - 81, 162, 89, 178, 121, 242, 249, 239, 195, 155, 43, 86, 172, 69, 138, 9, |
|
72 | - 18, 36, 72, 144, 61, 122, 244, 245, 247, 243, 251, 235, 203, 139, 11, 22, |
|
73 | - 44, 88, 176, 125, 250, 233, 207, 131, 27, 54, 108, 216, 173, 71, 142, 1, |
|
58 | + 1, 2, 4, 8, 16, 32, 64, 128, 29, 58, 116, 232, 205, 135, 19, 38, |
|
59 | + 76, 152, 45, 90, 180, 117, 234, 201, 143, 3, 6, 12, 24, 48, 96, 192, |
|
60 | + 157, 39, 78, 156, 37, 74, 148, 53, 106, 212, 181, 119, 238, 193, 159, 35, |
|
61 | + 70, 140, 5, 10, 20, 40, 80, 160, 93, 186, 105, 210, 185, 111, 222, 161, |
|
62 | + 95, 190, 97, 194, 153, 47, 94, 188, 101, 202, 137, 15, 30, 60, 120, 240, |
|
63 | + 253, 231, 211, 187, 107, 214, 177, 127, 254, 225, 223, 163, 91, 182, 113, 226, |
|
64 | + 217, 175, 67, 134, 17, 34, 68, 136, 13, 26, 52, 104, 208, 189, 103, 206, |
|
65 | + 129, 31, 62, 124, 248, 237, 199, 147, 59, 118, 236, 197, 151, 51, 102, 204, |
|
66 | + 133, 23, 46, 92, 184, 109, 218, 169, 79, 158, 33, 66, 132, 21, 42, 84, |
|
67 | + 168, 77, 154, 41, 82, 164, 85, 170, 73, 146, 57, 114, 228, 213, 183, 115, |
|
68 | + 230, 209, 191, 99, 198, 145, 63, 126, 252, 229, 215, 179, 123, 246, 241, 255, |
|
69 | + 227, 219, 171, 75, 150, 49, 98, 196, 149, 55, 110, 220, 165, 87, 174, 65, |
|
70 | + 130, 25, 50, 100, 200, 141, 7, 14, 28, 56, 112, 224, 221, 167, 83, 166, |
|
71 | + 81, 162, 89, 178, 121, 242, 249, 239, 195, 155, 43, 86, 172, 69, 138, 9, |
|
72 | + 18, 36, 72, 144, 61, 122, 244, 245, 247, 243, 251, 235, 203, 139, 11, 22, |
|
73 | + 44, 88, 176, 125, 250, 233, 207, 131, 27, 54, 108, 216, 173, 71, 142, 1, |
|
74 | 74 | ]; |
75 | 75 | |
76 | 76 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @return int sum/difference of a and b |
80 | 80 | */ |
81 | 81 | public static function addOrSubtract(int $a, int $b):int{ |
82 | - return ($a ^ $b); |
|
82 | + return ($a^$b); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function __construct(int $maskPattern){ |
69 | 69 | |
70 | - if((0b111 & $maskPattern) !== $maskPattern){ |
|
70 | + if((0b111&$maskPattern) !== $maskPattern){ |
|
71 | 71 | throw new QRCodeException('invalid mask pattern'); |
72 | 72 | } |
73 | 73 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $penalty += (3 + ($numSameBitCells - 5)); |
162 | 162 | } |
163 | 163 | |
164 | - $numSameBitCells = 1; // Include the cell itself. |
|
164 | + $numSameBitCells = 1; // Include the cell itself. |
|
165 | 165 | $prevBit = $bit; |
166 | 166 | } |
167 | 167 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * Read count (bits) |
40 | 40 | */ |
41 | - private int $bitsRead = 0; |
|
41 | + private int $bitsRead = 0; |
|
42 | 42 | |
43 | 43 | /** |
44 | 44 | * BitBuffer constructor. |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $toRead = min($numBits, $bitsLeft); |
125 | 125 | $bitsToNotRead = ($bitsLeft - $toRead); |
126 | 126 | $mask = ((0xff >> (8 - $toRead)) << $bitsToNotRead); |
127 | - $result = (($this->buffer[$this->bytesRead] & $mask) >> $bitsToNotRead); |
|
127 | + $result = (($this->buffer[$this->bytesRead]&$mask) >> $bitsToNotRead); |
|
128 | 128 | $numBits -= $toRead; |
129 | 129 | $this->bitsRead += $toRead; |
130 | 130 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | if($numBits > 0){ |
139 | 139 | |
140 | 140 | while($numBits >= 8){ |
141 | - $result = (($result << 8) | ($this->buffer[$this->bytesRead] & 0xff)); |
|
141 | + $result = (($result << 8)|($this->buffer[$this->bytesRead] & 0xff)); |
|
142 | 142 | $this->bytesRead++; |
143 | 143 | $numBits -= 8; |
144 | 144 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | if($numBits > 0){ |
148 | 148 | $bitsToNotRead = (8 - $numBits); |
149 | 149 | $mask = ((0xff >> $bitsToNotRead) << $bitsToNotRead); |
150 | - $result = (($result << $numBits) | (($this->buffer[$this->bytesRead] & $mask) >> $bitsToNotRead)); |
|
150 | + $result = (($result << $numBits)|(($this->buffer[$this->bytesRead]&$mask) >> $bitsToNotRead)); |
|
151 | 151 | $this->bitsRead += $numBits; |
152 | 152 | } |
153 | 153 | } |