diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d8e0a8..9aea3eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,6 +28,7 @@ jobs: php: - "8.2" - "8.3" + - "8.4" symfony: - "^6.4" - "^7.0" diff --git a/CHANGELOG.md b/CHANGELOG.md index af44628..413d38d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +* Added support for PHP 8.4 + ## 3.1.0 - 2023-12-17 * Added support for PHP 8.3 diff --git a/composer.json b/composer.json index d622194..2a6f80f 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "ramsey/uuid": "^4.7.5", "symfony/serializer": "^6.4 || ^7.0.1" }, diff --git a/src/Normalizer/UuidNormalizer.php b/src/Normalizer/UuidNormalizer.php index 1a40f37..341f3b4 100644 --- a/src/Normalizer/UuidNormalizer.php +++ b/src/Normalizer/UuidNormalizer.php @@ -13,7 +13,7 @@ class UuidNormalizer implements NormalizerInterface, DenormalizerInterface /** * @param array $context */ - public function denormalize(mixed $data, string $type, string $format = null, array $context = []): UuidInterface + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): UuidInterface { if (!is_string($data)) { throw NotNormalizableValueException::createForUnexpectedDataType(sprintf('The data is not a valid "%s" string representation.', $type), $data, ['string']); @@ -24,7 +24,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar /** * @param array $context */ - public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { return is_string($data) && is_a($type, UuidInterface::class, true) && Uuid::isValid($data); } @@ -33,7 +33,7 @@ public function supportsDenormalization(mixed $data, string $type, string $forma * @param UuidInterface $object * @param array $context */ - public function normalize(mixed $object, string $format = null, array $context = []): string + public function normalize(mixed $object, ?string $format = null, array $context = []): string { return $object->toString(); } @@ -41,7 +41,7 @@ public function normalize(mixed $object, string $format = null, array $context = /** * @param array $context */ - public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { return $data instanceof UuidInterface; }