aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php')
-rw-r--r--vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php b/vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php
index 959892b9b..7874cb53d 100644
--- a/vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php
+++ b/vendor/chillerlan/php-qrcode/src/Data/MaskPatternTester.php
@@ -130,7 +130,7 @@ final class MaskPatternTester{
}
if(
- $val === $row[$x + 1]
+ $val === $m[$y][$x + 1]
&& $val === $m[$y + 1][$x]
&& $val === $m[$y + 1][$x + 1]
){
@@ -154,12 +154,12 @@ final class MaskPatternTester{
if(
$x + 6 < $size
&& $val
- && !$row[$x + 1]
- && $row[$x + 2]
- && $row[$x + 3]
- && $row[$x + 4]
- && !$row[$x + 5]
- && $row[$x + 6]
+ && !$m[$y][$x + 1]
+ && $m[$y][$x + 2]
+ && $m[$y][$x + 3]
+ && $m[$y][$x + 4]
+ && !$m[$y][$x + 5]
+ && $m[$y][$x + 6]
){
$penalties++;
}
@@ -189,8 +189,8 @@ final class MaskPatternTester{
protected function testLevel4(array $m, int $size):float{
$count = 0;
- foreach($m as $row){
- foreach($row as $val){
+ foreach($m as $y => $row){
+ foreach($row as $x => $val){
if($val){
$count++;
}