diff --git a/phpstan.neon.dist b/phpstan.neon.dist index e63b5ba61b4..4e81c0d6289 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -83,6 +83,7 @@ parameters: # Expected, due to backward compatibility - '#Access to an undefined property GraphQL\\Type\\Definition\\NamedType&GraphQL\\Type\\Definition\\Type::\$name\.#' + - "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\PropertyInfo\\\\\\\\PropertyInfoExtractor' and 'getType' will always evaluate to true\\.#" - "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\HttpFoundation\\\\\\\\Request' and 'getContentTypeFormat' will always evaluate to true\\.#" - '#Call to an undefined method Symfony\\Component\\HttpFoundation\\Request::getContentType\(\)\.#' - "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\Serializer\\\\\\\\Serializer' and 'getSupportedTypes' will always evaluate to true\\.#" diff --git a/src/GraphQl/Action/EntrypointAction.php b/src/GraphQl/Action/EntrypointAction.php index eb3a24cdb10..3be68bc68b1 100644 --- a/src/GraphQl/Action/EntrypointAction.php +++ b/src/GraphQl/Action/EntrypointAction.php @@ -100,7 +100,7 @@ private function parseRequest(Request $request): array return [$query, $operationName, $variables]; } - $contentType = method_exists(Request::class, 'getContentTypeFormat') ? $request->getContentTypeFormat() : $request->getContentType(); + $contentType = $request->getContentTypeFormat(); if ('json' === $contentType) { return $this->parseData($query, $operationName, $variables, $request->getContent()); } diff --git a/src/Serializer/SerializerContextBuilder.php b/src/Serializer/SerializerContextBuilder.php index b259e6015ea..bf0582b74fd 100644 --- a/src/Serializer/SerializerContextBuilder.php +++ b/src/Serializer/SerializerContextBuilder.php @@ -97,7 +97,7 @@ public function createFromRequest(Request $request, bool $normalization, ?array } } - if ('csv' === (method_exists(Request::class, 'getContentTypeFormat') ? $request->getContentTypeFormat() : $request->getContentType())) { + if ('csv' === $request->getContentTypeFormat()) { $context[CsvEncoder::AS_COLLECTION_KEY] = $context[CsvEncoder::AS_COLLECTION_KEY] ?? false; } }