@@ -104,7 +104,7 @@ public function __construct(SettingsContainerInterface $options, string $data =
104104 public function setData (string $ data ):QRDataInterface {
105105
106106 if ($ this ->datamode === QRCode::DATA_KANJI ){
107- $ data = mb_convert_encoding ($ data , 'SJIS ' , mb_detect_encoding ($ data ));
107+ $ data = \ mb_convert_encoding ($ data , 'SJIS ' , \ mb_detect_encoding ($ data ));
108108 }
109109
110110 $ this ->strlen = $ this ->getLength ($ data );
@@ -169,7 +169,7 @@ protected function getLengthBits():int{
169169 * @return int
170170 */
171171 protected function getLength (string $ data ):int {
172- return strlen ($ data );
172+ return \ strlen ($ data );
173173 }
174174
175175 /**
@@ -182,7 +182,7 @@ protected function getMinimumVersion():int{
182182 $ maxlength = 0 ;
183183
184184 // guess the version number within the given range
185- foreach (range ($ this ->options ->versionMin , $ this ->options ->versionMax ) as $ version ){
185+ foreach (\ range ($ this ->options ->versionMin , $ this ->options ->versionMax ) as $ version ){
186186 $ maxlength = $ this ::MAX_LENGTH [$ version ][QRCode::DATA_MODES [$ this ->datamode ]][QRCode::ECC_MODES [$ this ->options ->eccLevel ]];
187187
188188 if ($ this ->strlen <= $ maxlength ){
@@ -270,13 +270,13 @@ protected function writeBitBuffer(string $data):QRDataInterface{
270270 protected function maskECC ():array {
271271 [$ l1 , $ l2 , $ b1 , $ b2 ] = $ this ::RSBLOCKS [$ this ->version ][QRCode::ECC_MODES [$ this ->options ->eccLevel ]];
272272
273- $ rsBlocks = array_fill (0 , $ l1 , [$ b1 , $ b2 ]);
273+ $ rsBlocks = \ array_fill (0 , $ l1 , [$ b1 , $ b2 ]);
274274 $ rsCount = $ l1 + $ l2 ;
275- $ this ->ecdata = array_fill (0 , $ rsCount , null );
275+ $ this ->ecdata = \ array_fill (0 , $ rsCount , null );
276276 $ this ->dcdata = $ this ->ecdata ;
277277
278278 if ($ l2 > 0 ){
279- $ rsBlocks = array_merge ($ rsBlocks , array_fill (0 , $ l2 , [$ b1 + 1 , $ b2 + 1 ]));
279+ $ rsBlocks = \ array_merge ($ rsBlocks , \ array_fill (0 , $ l2 , [$ b1 + 1 , $ b2 + 1 ]));
280280 }
281281
282282 $ totalCodeCount = 0 ;
@@ -288,9 +288,9 @@ protected function maskECC():array{
288288 [$ rsBlockTotal , $ dcCount ] = $ block ;
289289
290290 $ ecCount = $ rsBlockTotal - $ dcCount ;
291- $ maxDcCount = max ($ maxDcCount , $ dcCount );
292- $ maxEcCount = max ($ maxEcCount , $ ecCount );
293- $ this ->dcdata [$ key ] = array_fill (0 , $ dcCount , null );
291+ $ maxDcCount = \ max ($ maxDcCount , $ dcCount );
292+ $ maxEcCount = \ max ($ maxEcCount , $ ecCount );
293+ $ this ->dcdata [$ key ] = \ array_fill (0 , $ dcCount , null );
294294
295295 foreach ($ this ->dcdata [$ key ] as $ a => $ _z ){
296296 $ this ->dcdata [$ key ][$ a ] = 0xff & $ this ->bitBuffer ->buffer [$ a + $ offset ];
@@ -307,13 +307,13 @@ protected function maskECC():array{
307307 $ totalCodeCount += $ rsBlockTotal ;
308308 }
309309
310- $ data = array_fill (0 , $ totalCodeCount , null );
310+ $ data = \ array_fill (0 , $ totalCodeCount , null );
311311 $ index = 0 ;
312312
313313 $ mask = function ($ arr , $ count ) use (&$ data , &$ index , $ rsCount ){
314314 for ($ x = 0 ; $ x < $ count ; $ x ++){
315315 for ($ y = 0 ; $ y < $ rsCount ; $ y ++){
316- if ($ x < count ($ arr [$ y ])){
316+ if ($ x < \ count ($ arr [$ y ])){
317317 $ data [$ index ] = $ arr [$ y ][$ x ];
318318 $ index ++;
319319 }
@@ -342,19 +342,19 @@ protected function poly(int $key, int $count):array{
342342 $ rsPoly ->multiply ($ modPoly ->getNum ());
343343 }
344344
345- $ rsPolyCount = count ($ rsPoly ->getNum ());
345+ $ rsPolyCount = \ count ($ rsPoly ->getNum ());
346346
347347 $ modPoly
348348 ->setNum ($ this ->dcdata [$ key ], $ rsPolyCount - 1 )
349349 ->mod ($ rsPoly ->getNum ())
350350 ;
351351
352- $ this ->ecdata [$ key ] = array_fill (0 , $ rsPolyCount - 1 , null );
352+ $ this ->ecdata [$ key ] = \ array_fill (0 , $ rsPolyCount - 1 , null );
353353 $ num = $ modPoly ->getNum ();
354354
355355 return [
356356 $ num ,
357- count ($ num ) - count ($ this ->ecdata [$ key ]),
357+ \ count ($ num ) - \ count ($ this ->ecdata [$ key ]),
358358 ];
359359 }
360360
0 commit comments