getSize(); echo "Matrix: {$size}x{$size}\n\n"; // Count dark modules in matrix $darkCount = 0; for ($row = 0; $row < $size; $row++) { for ($col = 0; $col < $size; $col++) { if ($matrix->getModuleAt($row, $col)->isDark()) { $darkCount++; } } } echo "Dark modules in matrix: {$darkCount}\n"; // Render SVG $style = QrCodeStyle::large(); $renderer = new QrCodeRenderer(); $svg = $renderer->renderCustom($matrix, $style, false); // Count rectangles in SVG preg_match_all('/]*fill="black"/', $svg, $matches); $svgRectCount = count($matches[0]); echo "Black rectangles in SVG: {$svgRectCount}\n"; if ($darkCount === $svgRectCount) { echo "✅ All dark modules are rendered\n\n"; } else { echo "❌ Mismatch! Missing " . ($darkCount - $svgRectCount) . " rectangles\n\n"; } // Verify finder patterns are complete echo "=== Finder Pattern Completeness ===\n"; $finderPositions = [ ['name' => 'Top-Left', 'startRow' => 0, 'startCol' => 0], ['name' => 'Top-Right', 'startRow' => 0, 'startCol' => 14], ['name' => 'Bottom-Left', 'startRow' => 14, 'startCol' => 0], ]; foreach ($finderPositions as $finder) { $expectedDark = 0; $actualDark = 0; for ($r = 0; $r < 7; $r++) { for ($c = 0; $c < 7; $c++) { $row = $finder['startRow'] + $r; $col = $finder['startCol'] + $c; if ($matrix->getModuleAt($row, $col)->isDark()) { $expectedDark++; // Check if rendered in SVG $x = 80 + $col * 20; $y = 80 + $row * 20; if (preg_match('/getModuleAt(6, $col)->isDark()) { $timingDark++; $x = 80 + $col * 20; $y = 80 + 6 * 20; if (preg_match('/getModuleAt($row, 6)->isDark()) { $vTimingDark++; $x = 80 + 6 * 20; $y = 80 + $row * 20; if (preg_match('/getModuleAt(8, $col)->isDark()) { $formatDark++; $x = 80 + $col * 20; $y = 80 + 8 * 20; if (preg_match('/getModuleAt($row, 8)->isDark()) { $formatVDark++; $x = 80 + 8 * 20; $y = 80 + $row * 20; if (preg_match('/getModuleAt($row, $col)->isDark(); echo $isDark ? '█' : '░'; } echo "\n"; } // Save SVG for inspection $filepath = __DIR__ . '/test-qrcodes/complete-verification.svg'; file_put_contents($filepath, $svg); echo "\n✅ Saved complete SVG: {$filepath}\n";