diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8baff649..144597a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: [8.1, 8.2, 8.3] + php-version: [8.1, 8.2, 8.3, 8.4] composer: [highest, lowest] steps: diff --git a/build/BuildMetadataFromXml.php b/build/BuildMetadataFromXml.php index e22f8db1..09475778 100644 --- a/build/BuildMetadataFromXml.php +++ b/build/BuildMetadataFromXml.php @@ -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). diff --git a/src/PhoneNumberUtil.php b/src/PhoneNumberUtil.php index d043ce93..d8880db0 100644 --- a/src/PhoneNumberUtil.php +++ b/src/PhoneNumberUtil.php @@ -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) { @@ -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();