| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Endroid\QrCode\Writer; |
| 6 |
|
| 7 |
use Endroid\QrCode\Bacon\MatrixFactory; |
| 8 |
use Endroid\QrCode\Label\LabelInterface; |
| 9 |
use Endroid\QrCode\Logo\LogoInterface; |
| 10 |
use Endroid\QrCode\QrCodeInterface; |
| 11 |
use Endroid\QrCode\Writer\Result\BinaryResult; |
| 12 |
use Endroid\QrCode\Writer\Result\ResultInterface; |
| 13 |
|
| 14 |
final class BinaryWriter implements WriterInterface |
| 15 |
{ |
| 16 |
public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface |
| 17 |
{ |
| 18 |
$matrixFactory = new MatrixFactory(); |
| 19 |
$matrix = $matrixFactory->create($qrCode); |
| 20 |
|
| 21 |
return new BinaryResult($matrix); |
| 22 |
} |
| 23 |
} |