diff --git a/composer.json b/composer.json index bd97aec..c244510 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "require": { "php": ">=8.1", - "ccmbenchmark/ting": "^3.11", + "ccmbenchmark/ting": "^3.11 || ^4.0", "doctrine/cache": "^1.10", "symfony/validator": "^4.4 || ^5.0 || ^6.0 || ^7.0", "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0", diff --git a/src/TingBundle/Serializer/SymfonySerializer.php b/src/TingBundle/Serializer/SymfonySerializer.php index cc3fdb8..6b9dd6d 100644 --- a/src/TingBundle/Serializer/SymfonySerializer.php +++ b/src/TingBundle/Serializer/SymfonySerializer.php @@ -8,13 +8,13 @@ class SymfonySerializer implements SerializerInterface { public function __construct(private readonly ?\Symfony\Component\Serializer\SerializerInterface $serializer = null) {} - public function serialize($toSerialize, array $options = []) + public function serialize($toSerialize, array $options = []): mixed { $this->throwOnNullSerializer(); return $this->serializer->serialize($toSerialize, 'json', $options['context'] ?? []); } - public function unserialize($serialized, array $options = []) + public function unserialize($serialized, array $options = []): mixed { if ($serialized === null) { return null; @@ -32,4 +32,4 @@ private function throwOnNullSerializer() throw new \RuntimeException('SymfonySerializer requires symfony/serializer to be installed. Use composer require symfony/serializer to add it.'); } } -} \ No newline at end of file +}