Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #58 from darenas31415/symfony-6-2-deprecation
Browse files Browse the repository at this point in the history
Fix Symfony 6.2 deprecation
  • Loading branch information
wjzijderveld committed Jan 16, 2023
2 parents 0fa2a21 + 2c74eb9 commit 5b2a4c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/JsonRequestTransformerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public function onKernelRequest(RequestEvent $event): void

private function isJsonRequest(Request $request): bool
{
return 'json' === $request->getContentType();
// Request::getContentType() is deprecated since Symfony 6.2
return 'json' === (method_exists($request, 'getContentTypeFormat') ? $request->getContentTypeFormat() : $request->getContentType());
}

private function transformJsonBody(Request $request): bool
Expand Down

0 comments on commit 5b2a4c3

Please # to comment.