@@ -142,7 +142,7 @@ public function __construct(int $version, int $eclevel){
142142 $ this ->version = $ version ;
143143 $ this ->eclevel = $ eclevel ;
144144 $ this ->moduleCount = $ this ->version * 4 + 17 ;
145- $ this ->matrix = array_fill (0 , $ this ->moduleCount , array_fill (0 , $ this ->moduleCount , self ::M_NULL ));
145+ $ this ->matrix = array_fill (0 , $ this ->moduleCount , array_fill (0 , $ this ->moduleCount , $ this ::M_NULL ));
146146 }
147147
148148 /**
@@ -240,7 +240,7 @@ public function check(int $x, int $y):bool{
240240 * @return \chillerlan\QRCode\Data\QRMatrix
241241 */
242242 public function setDarkModule ():QRMatrix {
243- $ this ->set (8 , 4 * $ this ->version + 9 , true , self ::M_DARKMODULE );
243+ $ this ->set (8 , 4 * $ this ->version + 9 , true , $ this ::M_DARKMODULE );
244244
245245 return $ this ;
246246 }
@@ -265,7 +265,7 @@ public function setFinderPattern():QRMatrix{
265265 $ c [0 ] + $ y ,
266266 $ c [1 ] + $ x ,
267267 !(($ x > 0 && $ x < 6 && ($ y === 1 || $ y === 5 )) || ($ y > 0 && $ y < 6 && ($ x === 1 || $ x === 5 ))),
268- self ::M_FINDER
268+ $ this ::M_FINDER
269269 );
270270 }
271271 }
@@ -293,7 +293,7 @@ public function setSeparators():QRMatrix{
293293 [7 , $ this ->moduleCount - 8 ],
294294 ];
295295
296- $ t = self ::M_SEPARATOR ;
296+ $ t = $ this ::M_SEPARATOR ;
297297
298298 for ($ c = 0 ; $ c < 3 ; $ c ++){
299299 for ($ i = 0 ; $ i < 8 ; $ i ++){
@@ -312,21 +312,21 @@ public function setSeparators():QRMatrix{
312312 * @return \chillerlan\QRCode\Data\QRMatrix
313313 */
314314 public function setAlignmentPattern ():QRMatrix {
315- $ pattern = self ::alignmentPattern[$ this ->version ];
315+ $ pattern = $ this ::alignmentPattern[$ this ->version ];
316316
317317 foreach ($ pattern as $ y ){
318318 foreach ($ pattern as $ x ){
319319
320320 // skip existing patterns
321- if ($ this ->matrix [$ y ][$ x ] !== self ::M_NULL ){
321+ if ($ this ->matrix [$ y ][$ x ] !== $ this ::M_NULL ){
322322 continue ;
323323 }
324324
325325 for ($ ry = -2 ; $ ry <= 2 ; $ ry ++){
326326 for ($ rx = -2 ; $ rx <= 2 ; $ rx ++){
327327 $ v = ($ ry === 0 && $ rx === 0 ) || $ ry === 2 || $ ry === -2 || $ rx === 2 || $ rx === -2 ;
328328
329- $ this ->set ($ x + $ rx , $ y + $ ry , $ v , self ::M_ALIGNMENT );
329+ $ this ->set ($ x + $ rx , $ y + $ ry , $ v , $ this ::M_ALIGNMENT );
330330 }
331331 }
332332
@@ -346,12 +346,12 @@ public function setTimingPattern():QRMatrix{
346346
347347 foreach (range (8 , $ this ->moduleCount - 8 - 1 ) as $ i ){
348348
349- if ($ this ->matrix [6 ][$ i ] !== self ::M_NULL || $ this ->matrix [$ i ][6 ] !== self ::M_NULL ){
349+ if ($ this ->matrix [6 ][$ i ] !== $ this ::M_NULL || $ this ->matrix [$ i ][6 ] !== $ this ::M_NULL ){
350350 continue ;
351351 }
352352
353353 $ v = $ i % 2 === 0 ;
354- $ t = self ::M_TIMING ;
354+ $ t = $ this ::M_TIMING ;
355355
356356 $ this ->set ($ i , 6 , $ v , $ t ); // h
357357 $ this ->set (6 , $ i , $ v , $ t ); // v
@@ -370,15 +370,15 @@ public function setTimingPattern():QRMatrix{
370370 public function setVersionNumber (bool $ test = null ):QRMatrix {
371371 $ test = $ test !== null ? $ test : false ;
372372
373- $ bits = self ::versionPattern[$ this ->version ] ?? false ;
373+ $ bits = $ this ::versionPattern[$ this ->version ] ?? false ;
374374
375375 if ($ bits !== false ){
376376
377377 for ($ i = 0 ; $ i < 18 ; $ i ++){
378378 $ a = (int )floor ($ i / 3 );
379379 $ b = $ i % 3 + $ this ->moduleCount - 8 - 3 ;
380380 $ v = !$ test && (($ bits >> $ i ) & 1 ) === 1 ;
381- $ t = self ::M_VERSION ;
381+ $ t = $ this ::M_VERSION ;
382382
383383 $ this ->set ($ b , $ a , $ v , $ t ); // ne
384384 $ this ->set ($ a , $ b , $ v , $ t ); // sw
@@ -399,8 +399,8 @@ public function setVersionNumber(bool $test = null):QRMatrix{
399399 */
400400 public function setFormatInfo (int $ maskPattern , bool $ test = null ):QRMatrix {
401401 $ test = $ test !== null ? $ test : false ;
402- $ bits = self ::formatPattern[QRCode::ECC_MODES [$ this ->eclevel ]][$ maskPattern ] ?? 0 ;
403- $ t = self ::M_FORMAT ;
402+ $ bits = $ this ::formatPattern[QRCode::ECC_MODES [$ this ->eclevel ]][$ maskPattern ] ?? 0 ;
403+ $ t = $ this ::M_FORMAT ;
404404
405405 for ($ i = 0 ; $ i < 15 ; $ i ++){
406406 $ v = !$ test && (($ bits >> $ i ) & 1 ) === 1 ;
@@ -441,12 +441,12 @@ public function setFormatInfo(int $maskPattern, bool $test = null):QRMatrix{
441441 */
442442 public function setQuietZone (int $ size = null ):QRMatrix {
443443
444- if ($ this ->matrix [$ this ->moduleCount - 1 ][$ this ->moduleCount - 1 ] === self ::M_NULL ){
444+ if ($ this ->matrix [$ this ->moduleCount - 1 ][$ this ->moduleCount - 1 ] === $ this ::M_NULL ){
445445 throw new QRCodeDataException ('use only after writing data ' );
446446 }
447447
448448 $ size = $ size !== null ? max (0 , min ($ size , floor ($ this ->moduleCount / 2 ))) : 4 ;
449- $ t = self ::M_QUIETZONE ;
449+ $ t = $ this ::M_QUIETZONE ;
450450
451451 for ($ y = 0 ; $ y < $ this ->moduleCount ; $ y ++){
452452 for ($ i = 0 ; $ i < $ size ; $ i ++){
@@ -491,7 +491,7 @@ public function mapData(array $data, int $maskPattern):QRMatrix{
491491 for ($ c = 0 ; $ c < 2 ; $ c ++){
492492 $ x = $ i - $ c ;
493493
494- if ($ this ->matrix [$ y ][$ x ] === self ::M_NULL ){
494+ if ($ this ->matrix [$ y ][$ x ] === $ this ::M_NULL ){
495495 $ v = false ;
496496
497497 if ($ byteIndex < $ byteCount ){
@@ -502,7 +502,7 @@ public function mapData(array $data, int $maskPattern):QRMatrix{
502502 $ v = !$ v ;
503503 }
504504
505- $ this ->matrix [$ y ][$ x ] = self ::M_DATA << ($ v ? 8 : 0 );
505+ $ this ->matrix [$ y ][$ x ] = $ this ::M_DATA << ($ v ? 8 : 0 );
506506 $ bitIndex --;
507507
508508 if ($ bitIndex === -1 ){
0 commit comments