@@ -271,7 +271,7 @@ |
||
271 | 271 | $this->dcdata[$key] = array_fill(0, $dcCount, null); |
272 | 272 | |
273 | 273 | foreach($this->dcdata[$key] as $a => $_z){ |
274 | - $this->dcdata[$key][$a] = 0xff & $this->bitBuffer->buffer[$a + $offset]; |
|
274 | + $this->dcdata[$key][$a] = 0xff&$this->bitBuffer->buffer[$a + $offset]; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | list($num, $add) = $this->poly($key, $ecCount); |
@@ -23,38 +23,38 @@ |
||
23 | 23 | * @link http://www.thonky.com/qr-code-tutorial/log-antilog-table |
24 | 24 | */ |
25 | 25 | const table = [ |
26 | - [ 1, 0], [ 2, 0], [ 4, 1], [ 8, 25], [ 16, 2], [ 32, 50], [ 64, 26], [128, 198], |
|
27 | - [ 29, 3], [ 58, 223], [116, 51], [232, 238], [205, 27], [135, 104], [ 19, 199], [ 38, 75], |
|
28 | - [ 76, 4], [152, 100], [ 45, 224], [ 90, 14], [180, 52], [117, 141], [234, 239], [201, 129], |
|
29 | - [143, 28], [ 3, 193], [ 6, 105], [ 12, 248], [ 24, 200], [ 48, 8], [ 96, 76], [192, 113], |
|
30 | - [157, 5], [ 39, 138], [ 78, 101], [156, 47], [ 37, 225], [ 74, 36], [148, 15], [ 53, 33], |
|
31 | - [106, 53], [212, 147], [181, 142], [119, 218], [238, 240], [193, 18], [159, 130], [ 35, 69], |
|
32 | - [ 70, 29], [140, 181], [ 5, 194], [ 10, 125], [ 20, 106], [ 40, 39], [ 80, 249], [160, 185], |
|
33 | - [ 93, 201], [186, 154], [105, 9], [210, 120], [185, 77], [111, 228], [222, 114], [161, 166], |
|
34 | - [ 95, 6], [190, 191], [ 97, 139], [194, 98], [153, 102], [ 47, 221], [ 94, 48], [188, 253], |
|
35 | - [101, 226], [202, 152], [137, 37], [ 15, 179], [ 30, 16], [ 60, 145], [120, 34], [240, 136], |
|
36 | - [253, 54], [231, 208], [211, 148], [187, 206], [107, 143], [214, 150], [177, 219], [127, 189], |
|
37 | - [254, 241], [225, 210], [223, 19], [163, 92], [ 91, 131], [182, 56], [113, 70], [226, 64], |
|
38 | - [217, 30], [175, 66], [ 67, 182], [134, 163], [ 17, 195], [ 34, 72], [ 68, 126], [136, 110], |
|
39 | - [ 13, 107], [ 26, 58], [ 52, 40], [104, 84], [208, 250], [189, 133], [103, 186], [206, 61], |
|
40 | - [129, 202], [ 31, 94], [ 62, 155], [124, 159], [248, 10], [237, 21], [199, 121], [147, 43], |
|
41 | - [ 59, 78], [118, 212], [236, 229], [197, 172], [151, 115], [ 51, 243], [102, 167], [204, 87], |
|
42 | - [133, 7], [ 23, 112], [ 46, 192], [ 92, 247], [184, 140], [109, 128], [218, 99], [169, 13], |
|
43 | - [ 79, 103], [158, 74], [ 33, 222], [ 66, 237], [132, 49], [ 21, 197], [ 42, 254], [ 84, 24], |
|
44 | - [168, 227], [ 77, 165], [154, 153], [ 41, 119], [ 82, 38], [164, 184], [ 85, 180], [170, 124], |
|
45 | - [ 73, 17], [146, 68], [ 57, 146], [114, 217], [228, 35], [213, 32], [183, 137], [115, 46], |
|
46 | - [230, 55], [209, 63], [191, 209], [ 99, 91], [198, 149], [145, 188], [ 63, 207], [126, 205], |
|
47 | - [252, 144], [229, 135], [215, 151], [179, 178], [123, 220], [246, 252], [241, 190], [255, 97], |
|
48 | - [227, 242], [219, 86], [171, 211], [ 75, 171], [150, 20], [ 49, 42], [ 98, 93], [196, 158], |
|
49 | - [149, 132], [ 55, 60], [110, 57], [220, 83], [165, 71], [ 87, 109], [174, 65], [ 65, 162], |
|
50 | - [130, 31], [ 25, 45], [ 50, 67], [100, 216], [200, 183], [141, 123], [ 7, 164], [ 14, 118], |
|
51 | - [ 28, 196], [ 56, 23], [112, 73], [224, 236], [221, 127], [167, 12], [ 83, 111], [166, 246], |
|
52 | - [ 81, 108], [162, 161], [ 89, 59], [178, 82], [121, 41], [242, 157], [249, 85], [239, 170], |
|
53 | - [195, 251], [155, 96], [ 43, 134], [ 86, 177], [172, 187], [ 69, 204], [138, 62], [ 9, 90], |
|
54 | - [ 18, 203], [ 36, 89], [ 72, 95], [144, 176], [ 61, 156], [122, 169], [244, 160], [245, 81], |
|
55 | - [247, 11], [243, 245], [251, 22], [235, 235], [203, 122], [139, 117], [ 11, 44], [ 22, 215], |
|
56 | - [ 44, 79], [ 88, 174], [176, 213], [125, 233], [250, 230], [233, 231], [207, 173], [131, 232], |
|
57 | - [ 27, 116], [ 54, 214], [108, 244], [216, 234], [173, 168], [ 71, 80], [142, 88], [ 1, 175], |
|
26 | + [1, 0], [2, 0], [4, 1], [8, 25], [16, 2], [32, 50], [64, 26], [128, 198], |
|
27 | + [29, 3], [58, 223], [116, 51], [232, 238], [205, 27], [135, 104], [19, 199], [38, 75], |
|
28 | + [76, 4], [152, 100], [45, 224], [90, 14], [180, 52], [117, 141], [234, 239], [201, 129], |
|
29 | + [143, 28], [3, 193], [6, 105], [12, 248], [24, 200], [48, 8], [96, 76], [192, 113], |
|
30 | + [157, 5], [39, 138], [78, 101], [156, 47], [37, 225], [74, 36], [148, 15], [53, 33], |
|
31 | + [106, 53], [212, 147], [181, 142], [119, 218], [238, 240], [193, 18], [159, 130], [35, 69], |
|
32 | + [70, 29], [140, 181], [5, 194], [10, 125], [20, 106], [40, 39], [80, 249], [160, 185], |
|
33 | + [93, 201], [186, 154], [105, 9], [210, 120], [185, 77], [111, 228], [222, 114], [161, 166], |
|
34 | + [95, 6], [190, 191], [97, 139], [194, 98], [153, 102], [47, 221], [94, 48], [188, 253], |
|
35 | + [101, 226], [202, 152], [137, 37], [15, 179], [30, 16], [60, 145], [120, 34], [240, 136], |
|
36 | + [253, 54], [231, 208], [211, 148], [187, 206], [107, 143], [214, 150], [177, 219], [127, 189], |
|
37 | + [254, 241], [225, 210], [223, 19], [163, 92], [91, 131], [182, 56], [113, 70], [226, 64], |
|
38 | + [217, 30], [175, 66], [67, 182], [134, 163], [17, 195], [34, 72], [68, 126], [136, 110], |
|
39 | + [13, 107], [26, 58], [52, 40], [104, 84], [208, 250], [189, 133], [103, 186], [206, 61], |
|
40 | + [129, 202], [31, 94], [62, 155], [124, 159], [248, 10], [237, 21], [199, 121], [147, 43], |
|
41 | + [59, 78], [118, 212], [236, 229], [197, 172], [151, 115], [51, 243], [102, 167], [204, 87], |
|
42 | + [133, 7], [23, 112], [46, 192], [92, 247], [184, 140], [109, 128], [218, 99], [169, 13], |
|
43 | + [79, 103], [158, 74], [33, 222], [66, 237], [132, 49], [21, 197], [42, 254], [84, 24], |
|
44 | + [168, 227], [77, 165], [154, 153], [41, 119], [82, 38], [164, 184], [85, 180], [170, 124], |
|
45 | + [73, 17], [146, 68], [57, 146], [114, 217], [228, 35], [213, 32], [183, 137], [115, 46], |
|
46 | + [230, 55], [209, 63], [191, 209], [99, 91], [198, 149], [145, 188], [63, 207], [126, 205], |
|
47 | + [252, 144], [229, 135], [215, 151], [179, 178], [123, 220], [246, 252], [241, 190], [255, 97], |
|
48 | + [227, 242], [219, 86], [171, 211], [75, 171], [150, 20], [49, 42], [98, 93], [196, 158], |
|
49 | + [149, 132], [55, 60], [110, 57], [220, 83], [165, 71], [87, 109], [174, 65], [65, 162], |
|
50 | + [130, 31], [25, 45], [50, 67], [100, 216], [200, 183], [141, 123], [7, 164], [14, 118], |
|
51 | + [28, 196], [56, 23], [112, 73], [224, 236], [221, 127], [167, 12], [83, 111], [166, 246], |
|
52 | + [81, 108], [162, 161], [89, 59], [178, 82], [121, 41], [242, 157], [249, 85], [239, 170], |
|
53 | + [195, 251], [155, 96], [43, 134], [86, 177], [172, 187], [69, 204], [138, 62], [9, 90], |
|
54 | + [18, 203], [36, 89], [72, 95], [144, 176], [61, 156], [122, 169], [244, 160], [245, 81], |
|
55 | + [247, 11], [243, 245], [251, 22], [235, 235], [203, 122], [139, 117], [11, 44], [22, 215], |
|
56 | + [44, 79], [88, 174], [176, 213], [125, 233], [250, 230], [233, 231], [207, 173], [131, 232], |
|
57 | + [27, 116], [54, 214], [108, 244], [216, 234], [173, 168], [71, 80], [142, 88], [1, 175], |
|
58 | 58 | ]; |
59 | 59 | |
60 | 60 | /** |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | if($x <= $this->moduleCount - 7){ |
166 | 166 | if( |
167 | - $this->matrix->check($x , $y) |
|
167 | + $this->matrix->check($x , $y) |
|
168 | 168 | && !$this->matrix->check($x + 1, $y) |
169 | 169 | && $this->matrix->check($x + 2, $y) |
170 | 170 | && $this->matrix->check($x + 3, $y) |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | |
179 | 179 | if($y <= $this->moduleCount - 7){ |
180 | 180 | if( |
181 | - $this->matrix->check($x, $y) |
|
181 | + $this->matrix->check($x, $y) |
|
182 | 182 | && !$this->matrix->check($x, $y + 1) |
183 | 183 | && $this->matrix->check($x, $y + 2) |
184 | 184 | && $this->matrix->check($x, $y + 3) |
@@ -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) |
@@ -47,7 +47,7 @@ |
||
47 | 47 | if(preg_match('/[a-f\d]{6}/i', $v) === 1){ |
48 | 48 | return in_array($_POST['output_type'], ['png', 'jpg', 'gif']) |
49 | 49 | ? array_map('hexdec', str_split($v, 2)) |
50 | - : '#'.$v ; |
|
50 | + : '#'.$v; |
|
51 | 51 | } |
52 | 52 | return null; |
53 | 53 | }, $moduleValues); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $len = strlen($data); |
47 | 47 | |
48 | 48 | for($i = 0; $i + 1 < $len; $i += 2){ |
49 | - $c = ((0xff & ord($data[$i])) << 8) | (0xff & ord($data[$i + 1])); |
|
49 | + $c = ((0xff&ord($data[$i])) << 8)|(0xff&ord($data[$i + 1])); |
|
50 | 50 | |
51 | 51 | if(0x8140 <= $c && $c <= 0x9FFC){ |
52 | 52 | $c -= 0x8140; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | throw new QRCodeDataException('illegal char at '.($i + 1).' ['.$c.']'); |
59 | 59 | } |
60 | 60 | |
61 | - $this->bitBuffer->put((($c >> 8) & 0xff) * 0xC0 + ($c & 0xff), 13); |
|
61 | + $this->bitBuffer->put((($c >> 8)&0xff) * 0xC0 + ($c&0xff), 13); |
|
62 | 62 | |
63 | 63 | } |
64 | 64 |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | /** |
44 | 44 | * @var string |
45 | 45 | */ |
46 | - protected $authenticatorMode = Authenticator::DEFAULT_AUTH_MODE; |
|
46 | + protected $authenticatorMode = Authenticator::DEFAULT_AUTH_MODE; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * @var string |
50 | 50 | */ |
51 | - protected $authenticatorAlgo = Authenticator::DEFAULT_HASH_ALGO; |
|
51 | + protected $authenticatorAlgo = Authenticator::DEFAULT_HASH_ALGO; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * @param string $label |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @return mixed |
58 | 58 | */ |
59 | - protected function getURIQRCode(string $label, string $issuer) { |
|
59 | + protected function getURIQRCode(string $label, string $issuer){ |
|
60 | 60 | $uri = $this->getAuthenticator()->setSecret($this->authenticatorSecret)->getUri($label, $issuer); |
61 | 61 | |
62 | 62 | return (new QRCode($this->qrOptions))->render($uri); |
@@ -56,7 +56,7 @@ |
||
56 | 56 | * |
57 | 57 | * @return mixed |
58 | 58 | */ |
59 | - protected function getURIQRCode(string $label, string $issuer) { |
|
59 | + protected function getURIQRCode(string $label, string $issuer){ |
|
60 | 60 | $uri = $this->getAuthenticator()->setSecret($this->authenticatorSecret)->getUri($label, $issuer); |
61 | 61 | |
62 | 62 | return (new QRCode($this->qrOptions))->render($uri); |
@@ -74,9 +74,9 @@ |
||
74 | 74 | $matrix = $this->matrix->matrix(); |
75 | 75 | |
76 | 76 | $svg = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'.$length.'px" height="'.$length.'px">' |
77 | - .$this->options->eol |
|
78 | - .'<defs>'.$this->options->svgDefs.'</defs>' |
|
79 | - .$this->options->eol; |
|
77 | + .$this->options->eol |
|
78 | + .'<defs>'.$this->options->svgDefs.'</defs>' |
|
79 | + .$this->options->eol; |
|
80 | 80 | |
81 | 81 | foreach($this->options->moduleValues as $M_TYPE => $value){ |
82 | 82 |
@@ -108,7 +108,7 @@ |
||
108 | 108 | |
109 | 109 | if($count > 0){ |
110 | 110 | $len = $count * $scale; |
111 | - $path .= 'M' .$start. ' ' .($y * $scale). ' h'.$len.' v'.$scale.' h-'.$len.'Z '; |
|
111 | + $path .= 'M'.$start.' '.($y * $scale).' h'.$len.' v'.$scale.' h-'.$len.'Z '; |
|
112 | 112 | |
113 | 113 | // reset count |
114 | 114 | $count = 0; |
@@ -68,7 +68,7 @@ |
||
68 | 68 | * @return bool|int |
69 | 69 | * @throws \chillerlan\QRCode\Output\QRCodeOutputException |
70 | 70 | */ |
71 | - protected function saveToFile(string $data) { |
|
71 | + protected function saveToFile(string $data){ |
|
72 | 72 | |
73 | 73 | if(!is_writable(dirname($this->options->cachefile))){ |
74 | 74 | throw new QRCodeOutputException('Could not write data to cache file: '.$this->options->cachefile); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | * @return bool|int |
69 | 69 | * @throws \chillerlan\QRCode\Output\QRCodeOutputException |
70 | 70 | */ |
71 | - protected function saveToFile(string $data) { |
|
71 | + protected function saveToFile(string $data){ |
|
72 | 72 | |
73 | 73 | if(!is_writable(dirname($this->options->cachefile))){ |
74 | 74 | throw new QRCodeOutputException('Could not write data to cache file: '.$this->options->cachefile); |
@@ -241,14 +241,14 @@ |
||
241 | 241 | QRMatrix::M_QUIETZONE => false, // 18 |
242 | 242 | QRMatrix::M_TEST => false, // 255 |
243 | 243 | // dark |
244 | - QRMatrix::M_DARKMODULE << 8 => true, // 512 |
|
245 | - QRMatrix::M_DATA << 8 => true, // 1024 |
|
246 | - QRMatrix::M_FINDER << 8 => true, // 1536 |
|
247 | - QRMatrix::M_ALIGNMENT << 8 => true, // 2560 |
|
248 | - QRMatrix::M_TIMING << 8 => true, // 3072 |
|
249 | - QRMatrix::M_FORMAT << 8 => true, // 3584 |
|
250 | - QRMatrix::M_VERSION << 8 => true, // 4096 |
|
251 | - QRMatrix::M_TEST << 8 => true, // 65280 |
|
244 | + QRMatrix::M_DARKMODULE << 8 => true, // 512 |
|
245 | + QRMatrix::M_DATA << 8 => true, // 1024 |
|
246 | + QRMatrix::M_FINDER << 8 => true, // 1536 |
|
247 | + QRMatrix::M_ALIGNMENT << 8 => true, // 2560 |
|
248 | + QRMatrix::M_TIMING << 8 => true, // 3072 |
|
249 | + QRMatrix::M_FORMAT << 8 => true, // 3584 |
|
250 | + QRMatrix::M_VERSION << 8 => true, // 4096 |
|
251 | + QRMatrix::M_TEST << 8 => true, // 65280 |
|
252 | 252 | ]; |
253 | 253 | |
254 | 254 | } |