Skip to content

Commit e3c3358

Browse files
committed
refactor: Modify setNote to accept nullable values and remove empty string validation
1 parent 429fd59 commit e3c3358

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Invoice.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -365,16 +365,14 @@ public function setInvoiceType(InvoiceType $invoiceType): self
365365
/**
366366
* Set note.
367367
*
368-
* @param string $note
368+
* @param string|null $note
369369
* @return self
370-
* @throws InvalidArgumentException if note is empty.
371370
*/
372-
public function setNote(string $note): self
371+
public function setNote(?string $note): self
373372
{
374-
if (trim($note) === '') {
375-
throw new InvalidArgumentException('Note cannot be empty.');
373+
if ($note !== null) {
374+
$this->note = $note;
376375
}
377-
$this->note = $note;
378376
return $this;
379377
}
380378
public function setlanguageID(string $languageID = 'en'): self

0 commit comments

Comments
 (0)