Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
msmakouz committed Mar 20, 2024
1 parent a81c894 commit 9335ca2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
"spiral/config": "^3.7",
"doctrine/annotations": "^1.12 || ^2.0",
"spiral/serializer": "^3.7",
"symfony/serializer": "^5.4 || ^6.0 || ^7.0",
"symfony/property-access": "^5.4 || ^6.0 || ^7.0"
"symfony/serializer": "^6.4 || ^7.0",
"symfony/property-access": "^6.4 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^10.2",
"spiral/testing": "^2.7",
"symfony/yaml": "^5.4 || ^6.0 || ^7.0",
"symfony/yaml": "^5.4 || ^6.0",
"symfony/yaml": "^6.4 || ^7.0",
"vimeo/psalm": "^5.12",
"ramsey/uuid": "^4.7"
},
Expand Down
6 changes: 3 additions & 3 deletions src/Normalizer/RamseyUuidNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ final class RamseyUuidNormalizer implements NormalizerInterface, DenormalizerInt
* @param UuidInterface $object
* @psalm-suppress MoreSpecificImplementedParamType
*/
public function normalize(mixed $object, string $format = null, array $context = []): string
public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
return $object->toString();
}

public function supportsNormalization(mixed $data, string $format = null): bool
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof UuidInterface;
}
Expand All @@ -37,7 +37,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
}
}

public function supportsDenormalization(mixed $data, string $type, string $format = null): 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 Down

0 comments on commit 9335ca2

Please sign in to comment.