Skip to content

Commit

Permalink
handle (empty) phone elements
Browse files Browse the repository at this point in the history
  • Loading branch information
mathielen committed Jan 15, 2025
1 parent 4c5e565 commit 6891b1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CXml/Model/Phone.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public function getName(): ?string
public function getTelephoneNumberAsString(): ?string
{
$countryCode = $this->telephoneNumber->getCountryCode()->getDialCode() ?? '';
$areaOrCityCode = $this->telephoneNumber->getAreaOrCityCode() === null ? '' : ' (' . $this->telephoneNumber->getAreaOrCityCode() . ') ';
$areaOrCityCode = null === $this->telephoneNumber->getAreaOrCityCode() ? '' : ' (' . $this->telephoneNumber->getAreaOrCityCode() . ') ';

Check failure on line 35 in src/CXml/Model/Phone.php

View workflow job for this annotation

GitHub Actions / Static PHP Validation (8.2)

Strict comparison using === between null and string will always evaluate to false.

Check failure on line 35 in src/CXml/Model/Phone.php

View workflow job for this annotation

GitHub Actions / Static PHP Validation (8.3)

Strict comparison using === between null and string will always evaluate to false.

Check failure on line 35 in src/CXml/Model/Phone.php

View workflow job for this annotation

GitHub Actions / Static PHP Validation (8.4)

Strict comparison using === between null and string will always evaluate to false.
$telephoneNumber = $this->telephoneNumber->getNumber();
$extension = $this->telephoneNumber->getExtension() === null ? '' : ' -' . $this->telephoneNumber->getExtension();
$extension = null === $this->telephoneNumber->getExtension() ? '' : ' -' . $this->telephoneNumber->getExtension();

if (empty($telephoneNumber)) {

Check failure on line 39 in src/CXml/Model/Phone.php

View workflow job for this annotation

GitHub Actions / Static PHP Validation (8.2)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 39 in src/CXml/Model/Phone.php

View workflow job for this annotation

GitHub Actions / Static PHP Validation (8.3)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 39 in src/CXml/Model/Phone.php

View workflow job for this annotation

GitHub Actions / Static PHP Validation (8.4)

Construct empty() is not allowed. Use more strict comparison.
return null;
Expand Down

0 comments on commit 6891b1e

Please sign in to comment.