Skip to content

Commit

Permalink
Fix PHP 8.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
giggsey committed Oct 8, 2024
1 parent 5338f04 commit 3a06bf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/BuildMetadataFromXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ public static function setPossibleLengthsGeneralDesc(PhoneNumberDesc $generalDes
* @param int[] $lengths
* @param int[] $localOnlyLengths
*/
private static function setPossibleLengths(array $lengths, array $localOnlyLengths, PhoneNumberDesc $desc, PhoneNumberDesc $parentDesc = null): void
private static function setPossibleLengths(array $lengths, array $localOnlyLengths, PhoneNumberDesc $desc, ?PhoneNumberDesc $parentDesc = null): void
{
// We clear these fields since the metadata tends to inherit from the parent element for other
// fields (via a mergeFrom).
Expand Down
8 changes: 4 additions & 4 deletions src/PhoneNumberUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ protected function __construct(MetadataSourceInterface $metadataSource, array $c
*/
public static function getInstance(
string $baseFileLocation = self::META_DATA_FILE_PREFIX,
array $countryCallingCodeToRegionCodeMap = null,
MetadataLoaderInterface $metadataLoader = null,
MetadataSourceInterface $metadataSource = null
?array $countryCallingCodeToRegionCodeMap = null,
?MetadataLoaderInterface $metadataLoader = null,
?MetadataSourceInterface $metadataSource = null
): PhoneNumberUtil {
if (static::$instance === null) {
if ($countryCallingCodeToRegionCodeMap === null) {
Expand Down Expand Up @@ -2969,7 +2969,7 @@ public function isValidNumberForRegion(PhoneNumber $number, string $regionCode):
* and the number is not in international format (does not start
* with +)
*/
public function parse(string $numberToParse, ?string $defaultRegion = null, PhoneNumber $phoneNumber = null, bool $keepRawInput = false): PhoneNumber
public function parse(string $numberToParse, ?string $defaultRegion = null, ?PhoneNumber $phoneNumber = null, bool $keepRawInput = false): PhoneNumber
{
if ($phoneNumber === null) {
$phoneNumber = new PhoneNumber();
Expand Down

0 comments on commit 3a06bf9

Please sign in to comment.