1 | <?php |
||
26 | abstract class QRDataAbstract implements QRDataInterface{ |
||
27 | use ClassLoader; |
||
28 | |||
29 | /** |
||
30 | * @var int |
||
31 | */ |
||
32 | protected $strlen; |
||
33 | |||
34 | /** |
||
35 | * @var int |
||
36 | */ |
||
37 | protected $datamode; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $lengthBits = [0, 0, 0]; |
||
43 | |||
44 | /** |
||
45 | * @var int |
||
46 | */ |
||
47 | protected $version; |
||
48 | |||
49 | /** |
||
50 | * @var array |
||
51 | */ |
||
52 | protected $ecdata; |
||
53 | |||
54 | /** |
||
55 | * @var array |
||
56 | */ |
||
57 | protected $dcdata; |
||
58 | |||
59 | /** |
||
60 | * @var array |
||
61 | */ |
||
62 | protected $matrixdata; |
||
63 | |||
64 | /** |
||
65 | * @var \chillerlan\QRCode\QROptions |
||
66 | */ |
||
67 | protected $options; |
||
68 | |||
69 | /** |
||
70 | * @var \chillerlan\QRCode\Helpers\BitBuffer |
||
71 | */ |
||
72 | protected $bitBuffer; |
||
73 | |||
74 | /** |
||
75 | * QRDataInterface constructor. |
||
76 | * |
||
77 | * @param \chillerlan\QRCode\QROptions $options |
||
78 | * @param string|null $data |
||
79 | */ |
||
80 | public function __construct(QROptions $options, string $data = null){ |
||
87 | |||
88 | /** |
||
89 | * @param string $data |
||
90 | * |
||
91 | * @return \chillerlan\QRCode\Data\QRDataInterface |
||
92 | */ |
||
93 | public function setData(string $data):QRDataInterface{ |
||
111 | |||
112 | /** |
||
113 | * @param int $maskPattern |
||
114 | * @param bool $test |
||
|
|||
115 | * |
||
116 | * @return \chillerlan\QRCode\Data\QRMatrix |
||
117 | */ |
||
118 | public function initMatrix(int $maskPattern, bool $test = null):QRMatrix{ |
||
133 | |||
134 | /** |
||
135 | * @param int $version |
||
136 | * |
||
137 | * @return int |
||
138 | * @throws \chillerlan\QRCode\Data\QRCodeDataException |
||
139 | * @codeCoverageIgnore |
||
140 | */ |
||
141 | protected function getLengthBits(int $version):int { |
||
151 | |||
152 | /** |
||
153 | * returns the byte count of the string |
||
154 | * |
||
155 | * @param string $data |
||
156 | * |
||
157 | * @return int |
||
158 | */ |
||
159 | protected function getLength(string $data):int{ |
||
162 | |||
163 | /** |
||
164 | * @return int |
||
165 | * @throws \chillerlan\QRCode\Data\QRCodeDataException |
||
166 | */ |
||
167 | protected function getMinimumVersion():int{ |
||
180 | |||
181 | /** |
||
182 | * writes the $data bits to $this->bitBuffer |
||
183 | * |
||
184 | * @param string $data |
||
185 | * |
||
186 | * @return void |
||
187 | */ |
||
188 | abstract protected function write(string $data); |
||
189 | |||
190 | /** |
||
191 | * @param string $data |
||
192 | * |
||
193 | * @return \chillerlan\QRCode\Data\QRDataAbstract |
||
194 | * @throws \chillerlan\QRCode\QRCodeException |
||
195 | */ |
||
196 | protected function writeBitBuffer(string $data):QRDataInterface { |
||
242 | |||
243 | /** |
||
244 | * @link http://www.thonky.com/qr-code-tutorial/error-correction-coding |
||
245 | * |
||
246 | * @return array |
||
247 | */ |
||
248 | protected function maskECC():array { |
||
307 | |||
308 | /** |
||
309 | * @param int $key |
||
310 | * @param int $count |
||
311 | * |
||
312 | * @return int[] |
||
313 | */ |
||
314 | protected function poly(int $key, int $count):array{ |
||
338 | |||
339 | } |
||
340 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.