2022-05-30 17:50:46 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Endroid\QrCode\Writer;
|
|
|
|
|
|
|
|
use Endroid\QrCode\Bacon\MatrixFactory;
|
|
|
|
use Endroid\QrCode\Label\LabelInterface;
|
|
|
|
use Endroid\QrCode\Logo\LogoInterface;
|
|
|
|
use Endroid\QrCode\QrCodeInterface;
|
|
|
|
use Endroid\QrCode\Writer\Result\BinaryResult;
|
|
|
|
use Endroid\QrCode\Writer\Result\ResultInterface;
|
|
|
|
|
|
|
|
final class BinaryWriter implements WriterInterface
|
|
|
|
{
|
2023-07-07 22:33:10 +02:00
|
|
|
public function write(QrCodeInterface $qrCode, LogoInterface|null $logo = null, LabelInterface|null $label = null, array $options = []): ResultInterface
|
2022-05-30 17:50:46 +02:00
|
|
|
{
|
|
|
|
$matrixFactory = new MatrixFactory();
|
|
|
|
$matrix = $matrixFactory->create($qrCode);
|
|
|
|
|
|
|
|
return new BinaryResult($matrix);
|
|
|
|
}
|
|
|
|
}
|