Skip to content

Commit

Permalink
fix: Compatibility with older Symfony versions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgrayston-paddle committed Oct 11, 2024
1 parent 02ae267 commit 6a209ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
use Psr\Http\Message\UriInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Symfony\Component\Serializer\Context\Normalizer\ObjectNormalizerContextBuilder;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter;
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
use Symfony\Component\Serializer\Normalizer\BackedEnumNormalizer;
use Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
Expand Down Expand Up @@ -178,9 +178,9 @@ private function requestRaw(string $method, string|UriInterface $uri, array|\Jso
new JsonSerializableNormalizer(),
new ObjectNormalizer(
nameConverter: new CamelCaseToSnakeCaseNameConverter(),
defaultContext: (new ObjectNormalizerContextBuilder())
->withPreserveEmptyObjects(true)
->toArray(),
defaultContext: [
AbstractObjectNormalizer::PRESERVE_EMPTY_OBJECTS => true,
],
),
],
[new JsonEncoder()],
Expand Down

0 comments on commit 6a209ef

Please sign in to comment.