* @copyright 2022 smiley * @license MIT */ namespace chillerlan\QRCode\Output; use function implode, sprintf; /** * HTML output (a cheap markup substitute when SVG is not available or not an option) */ class QRMarkupHTML extends QRMarkup{ public const MIME_TYPE = 'text/html'; /** * @inheritDoc */ protected function createMarkup(bool $saveToFile):string{ $rows = []; $cssClass = $this->getCssClass(); foreach($this->matrix->getMatrix() as $row){ $element = ''; $modules = array_map(fn(int $M_TYPE):string => sprintf($element, $this->getModuleValue($M_TYPE)), $row); $rows[] = sprintf('