Skip to content

Commit

Permalink
Merge pull request #3 from giauphan/default/value
Browse files Browse the repository at this point in the history
fix default value vcard
  • Loading branch information
giauphan committed Oct 3, 2023
2 parents 7d62bc6 + 2e53eff commit d7ab562
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/QRCodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down Expand Up @@ -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');
}

Expand All @@ -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');
// }

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d7ab562

Please sign in to comment.