codemasher 5 лет назад
Родитель
Сommit
306ac0d587
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      src/Data/MaskPatternTester.php
  2. 2 2
      src/Data/QRDataAbstract.php

+ 2 - 2
src/Data/MaskPatternTester.php

@@ -88,7 +88,7 @@ final class MaskPatternTester{
 
 					for($rx = -1; $rx <= 1; $rx++){
 
-						if(($ry === 0 && $rx === 0) || ($x + $rx < 0 || $this->moduleCount <= $x + $rx)){
+						if(($ry === 0 && $rx === 0) || (($x + $rx) < 0 || $this->moduleCount <= ($x + $rx))){
 							continue;
 						}
 
@@ -206,7 +206,7 @@ final class MaskPatternTester{
 
 		foreach($this->matrix->matrix() as $y => $row){
 			foreach($row as $x => $val){
-				if($val >> 8 > 0){
+				if(($val >> 8) > 0){
 					$count++;
 				}
 			}

+ 2 - 2
src/Data/QRDataAbstract.php

@@ -252,7 +252,7 @@ abstract class QRDataAbstract implements QRDataInterface{
 
 			[$num, $add] = $this->poly($key, $ecCount);
 
-			foreach($this->ecdata[$key] as $c => $_z){
+			foreach($this->ecdata[$key] as $c => $_){
 				$modIndex               = $c + $add;
 				$this->ecdata[$key][$c] = $modIndex >= 0 ? $num[$modIndex] : 0;
 			}
@@ -264,7 +264,7 @@ abstract class QRDataAbstract implements QRDataInterface{
 		$data  = array_fill(0, $totalCodeCount, null);
 		$index = 0;
 
-		$mask = function(array $arr, int $count) use (&$data, &$index, $rsCount){
+		$mask = function(array $arr, int $count) use (&$data, &$index, $rsCount):void{
 			for($x = 0; $x < $count; $x++){
 				for($y = 0; $y < $rsCount; $y++){
 					if($x < count($arr[$y])){