getMatrix(); $width = $matrix->getWidth(); // Four modules is the specified minimum quiet zone. Less than that and // some readers fail to find the symbol at all against a bordered card. $quiet = 4; $total = $width + 2 * $quiet; $cells = ''; for ($y = 0; $y < $width; $y++) { for ($x = 0; $x < $width; $x++) { if ($matrix->get($x, $y) === 1) { $cells .= sprintf('', $x + $quiet, $y + $quiet); } } } return sprintf( '' .'%3$s', $total, $size, $cells, ); } }