diff --git a/src/Builder/Builder.php b/src/Builder/Builder.php index 07703a8..89c6441 100644 --- a/src/Builder/Builder.php +++ b/src/Builder/Builder.php @@ -88,6 +88,9 @@ public function build( $writerOptions = $writerOptions ?? $this->writerOptions; $validateResult = $validateResult ?? $this->validateResult; + $createLabel = $this->labelText || $labelText; + $createLogo = $this->logoPath || $logoPath; + $qrCode = new QrCode( data: $data ?? $this->data, encoding: $encoding ?? $this->encoding, @@ -99,14 +102,14 @@ public function build( backgroundColor: $backgroundColor ?? $this->backgroundColor ); - $logo = $this->logoPath ? new Logo( + $logo = $createLogo ? new Logo( path: $logoPath ?? $this->logoPath, resizeToWidth: $logoResizeToWidth ?? $this->logoResizeToWidth, resizeToHeight: $logoResizeToHeight ?? $this->logoResizeToHeight, punchoutBackground: $logoPunchoutBackground ?? $this->logoPunchoutBackground ) : null; - $label = $this->labelText ? new Label( + $label = $createLabel ? new Label( text: $labelText ?? $this->labelText, font: $labelFont ?? $this->labelFont, alignment: $labelAlignment ?? $this->labelAlignment,