From 2e53efff88c7dcbc9d2e3311630183afe359039c Mon Sep 17 00:00:00 2001 From: giauphan Date: Tue, 3 Oct 2023 11:35:43 +0700 Subject: [PATCH] fix default value vcard --- src/QRCodeFactory.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/QRCodeFactory.php b/src/QRCodeFactory.php index 6214a7c..970773e 100644 --- a/src/QRCodeFactory.php +++ b/src/QRCodeFactory.php @@ -59,7 +59,7 @@ public function calendar(\DateTime $start, \DateTime $end, string $summary, stri */ public function email(string $toEmail, string $body, string $subject): QR_EmailMessage { - if (trim($toEmail) === '') { + if (trim($toEmail) === null) { throw new EmptyTextException('Recipient email cannot be empty'); } @@ -117,7 +117,7 @@ public function sms(string $number, string $text): QR_Sms */ public function text(string $data): QR_Text { - if (trim($data) === '') { + if (trim($data) === null) { throw new EmptyTextException('Text cannot be empty'); } @@ -135,7 +135,7 @@ public function text(string $data): QR_Text */ public function url(string $url = null): QR_Url { - // if (trim($url) === '') { + // if (trim($url) === null) { // throw new EmptyTextException('Url cannot be empty'); // } @@ -167,7 +167,7 @@ public function url(string $url = null): QR_Url * @throws \QR_Code\Exceptions\InvalidVCardAddressEntryException * @throws \QR_Code\Exceptions\InvalidVCardPhoneEntryException */ - public function vCard(string $firstName = null, string $lastName = null, string $title = '', string $email = '', string $company = '',string $job = '',string $url = '', array $addresses = [], array $phones = []): QR_VCard + public function vCard(string $firstName = null, string $lastName = null, string $title = null, string $email = null, string $company = null,string $job = null,string $url = null, array $addresses = [], array $phones = []): QR_VCard { // $this->validateVCardAddresses($addresses); // $this->validatePrefAddresses($addresses);