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

Commit

Permalink
Fix Symfony 6.2 deprecation
Browse files Browse the repository at this point in the history
Request::getContentType is deprecated since Symfony 6.2
  • Loading branch information
darenas31415 committed Jan 14, 2023
1 parent 0fa2a21 commit 2c74eb9
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 2c74eb9

Please # to comment.