Skip to content

Commit

Permalink
Make Address return values nullable to avoid breaking existing users.
Browse files Browse the repository at this point in the history
We can revert this in 2.x.
  • Loading branch information
bojanz committed Aug 9, 2022
1 parent 0478e60 commit 8b1bcd4
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ class Address implements ImmutableAddressInterface
* @param string $locale The locale. Defaults to 'und'.
*/
public function __construct(
string $countryCode = '',
string $administrativeArea = '',
string $locality = '',
string $dependentLocality = '',
string $postalCode = '',
string $sortingCode = '',
string $addressLine1 = '',
string $addressLine2 = '',
string $organization = '',
string $givenName = '',
string $additionalName = '',
string $familyName = '',
string $locale = 'und'
?string $countryCode = '',
?string $administrativeArea = '',
?string $locality = '',
?string $dependentLocality = '',
?string $postalCode = '',
?string $sortingCode = '',
?string $addressLine1 = '',
?string $addressLine2 = '',
?string $organization = '',
?string $givenName = '',
?string $additionalName = '',
?string $familyName = '',
?string $locale = 'und'
) {
$this->countryCode = $countryCode;
$this->administrativeArea = $administrativeArea;
Expand All @@ -150,7 +150,7 @@ public function __construct(
/**
* {@inheritdoc}
*/
public function getCountryCode(): string
public function getCountryCode(): ?string
{
return $this->countryCode;
}
Expand All @@ -177,7 +177,7 @@ public function getAdministrativeArea(): ?string
/**
* {@inheritdoc}
*/
public function withAdministrativeArea($administrativeArea): Address
public function withAdministrativeArea($administrativeArea)
{
$new = clone $this;
$new->administrativeArea = $administrativeArea;
Expand Down Expand Up @@ -207,7 +207,7 @@ public function withLocality($locality)
/**
* {@inheritdoc}
*/
public function getDependentLocality(): string
public function getDependentLocality(): ?string
{
return $this->dependentLocality;
}
Expand All @@ -226,7 +226,7 @@ public function withDependentLocality($dependentLocality)
/**
* {@inheritdoc}
*/
public function getPostalCode(): string
public function getPostalCode(): ?string
{
return $this->postalCode;
}
Expand All @@ -245,7 +245,7 @@ public function withPostalCode($postalCode)
/**
* {@inheritdoc}
*/
public function getSortingCode(): string
public function getSortingCode(): ?string
{
return $this->sortingCode;
}
Expand All @@ -264,7 +264,7 @@ public function withSortingCode($sortingCode)
/**
* {@inheritdoc}
*/
public function getAddressLine1(): string
public function getAddressLine1(): ?string
{
return $this->addressLine1;
}
Expand All @@ -283,7 +283,7 @@ public function withAddressLine1($addressLine1)
/**
* {@inheritdoc}
*/
public function getAddressLine2(): string
public function getAddressLine2(): ?string
{
return $this->addressLine2;
}
Expand All @@ -302,7 +302,7 @@ public function withAddressLine2($addressLine2)
/**
* {@inheritdoc}
*/
public function getOrganization(): string
public function getOrganization(): ?string
{
return $this->organization;
}
Expand All @@ -321,7 +321,7 @@ public function withOrganization($organization)
/**
* {@inheritdoc}
*/
public function getGivenName(): string
public function getGivenName(): ?string
{
return $this->givenName;
}
Expand All @@ -340,7 +340,7 @@ public function withGivenName($givenName)
/**
* {@inheritdoc}
*/
public function getAdditionalName(): string
public function getAdditionalName(): ?string
{
return $this->additionalName;
}
Expand All @@ -359,7 +359,7 @@ public function withAdditionalName($additionalName)
/**
* {@inheritdoc}
*/
public function getFamilyName(): string
public function getFamilyName(): ?string
{
return $this->familyName;
}
Expand All @@ -378,7 +378,7 @@ public function withFamilyName($familyName)
/**
* {@inheritdoc}
*/
public function getLocale(): string
public function getLocale(): ?string
{
return $this->locale;
}
Expand Down

0 comments on commit 8b1bcd4

Please sign in to comment.