From 1f3b5e430949104c691c3f0a859273cd10d163c4 Mon Sep 17 00:00:00 2001 From: Tobias Feijten Date: Tue, 29 Oct 2024 20:01:56 +0100 Subject: [PATCH] Add optional arguments to interface, to enhance compatibility --- src/Builder/BuilderInterface.php | 34 +++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/Builder/BuilderInterface.php b/src/Builder/BuilderInterface.php index 84f4303..e71288e 100644 --- a/src/Builder/BuilderInterface.php +++ b/src/Builder/BuilderInterface.php @@ -4,9 +4,41 @@ namespace Endroid\QrCode\Builder; +use Endroid\QrCode\Color\ColorInterface; +use Endroid\QrCode\Encoding\EncodingInterface; +use Endroid\QrCode\ErrorCorrectionLevel; +use Endroid\QrCode\Label\Font\FontInterface; +use Endroid\QrCode\Label\LabelAlignment; +use Endroid\QrCode\Label\Margin\MarginInterface; +use Endroid\QrCode\RoundBlockSizeMode; use Endroid\QrCode\Writer\Result\ResultInterface; +use Endroid\QrCode\Writer\WriterInterface; interface BuilderInterface { - public function build(): ResultInterface; + public function build( + ?WriterInterface $writer = null, + ?array $writerOptions = null, + ?bool $validateResult = null, + // QrCode options + ?string $data = null, + ?EncodingInterface $encoding = null, + ?ErrorCorrectionLevel $errorCorrectionLevel = null, + ?int $size = null, + ?int $margin = null, + ?RoundBlockSizeMode $roundBlockSizeMode = null, + ?ColorInterface $foregroundColor = null, + ?ColorInterface $backgroundColor = null, + // Label options + ?string $labelText = null, + ?FontInterface $labelFont = null, + ?LabelAlignment $labelAlignment = null, + ?MarginInterface $labelMargin = null, + ?ColorInterface $labelTextColor = null, + // Logo options + ?string $logoPath = null, + ?int $logoResizeToWidth = null, + ?int $logoResizeToHeight = null, + ?bool $logoPunchoutBackground = null, + ): ResultInterface; }