Skip to content
Draft
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/TingBundle/Serializer/SymfonySerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.');
}
}
}
}