Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PHP 8.4 #4

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
php:
- "8.2"
- "8.3"
- "8.4"
symfony:
- "^6.4"
- "^7.0"
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

* Added support for PHP 8.4

## 3.1.0 - 2023-12-17

* Added support for PHP 8.3
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
8 changes: 4 additions & 4 deletions src/Normalizer/UuidNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class UuidNormalizer implements NormalizerInterface, DenormalizerInterface
/**
* @param array<string, mixed> $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']);
Expand All @@ -24,7 +24,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
/**
* @param array<string, mixed> $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);
}
Expand All @@ -33,15 +33,15 @@ public function supportsDenormalization(mixed $data, string $type, string $forma
* @param UuidInterface $object
* @param array<string, mixed> $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();
}

/**
* @param array<string, mixed> $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;
}
Expand Down