Skip to content

Commit

Permalink
Fix creation detection
Browse files Browse the repository at this point in the history
  • Loading branch information
endroid committed Oct 21, 2024
1 parent 08dc844 commit 86f264a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Builder/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 86f264a

Please sign in to comment.