From 3cdab3b158ba501fc06994bdad747b3b62137f52 Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Wed, 9 Sep 2026 14:36:24 +0200 Subject: [PATCH] refactor(jsonld): remove the unreachable getSupportedTypes guard --- phpstan.neon.dist | 1 - src/JsonLd/Serializer/ErrorNormalizer.php | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index ee3f9221f42..7ee3b594582 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -89,7 +89,6 @@ parameters: - "#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\\.#" - - "#Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Serializer\\\\Normalizer\\\\NormalizerInterface and 'getSupportedTypes' will always evaluate to true\\.#" - "#Call to function method_exists\\(\\) with Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\|Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata and 'isChangeTrackingDef…' will always evaluate to true\\.#" - "#Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Serializer\\\\Exception\\\\PartialDenormalizationException and 'getNotNormalizableV…' will always evaluate to true\\.#" diff --git a/src/JsonLd/Serializer/ErrorNormalizer.php b/src/JsonLd/Serializer/ErrorNormalizer.php index aa786d80b26..a99e6f02a60 100644 --- a/src/JsonLd/Serializer/ErrorNormalizer.php +++ b/src/JsonLd/Serializer/ErrorNormalizer.php @@ -70,10 +70,6 @@ public function supportsNormalization(mixed $data, ?string $format = null, array */ public function getSupportedTypes(?string $format): array { - if (method_exists($this->inner, 'getSupportedTypes')) { - return $this->inner->getSupportedTypes($format); - } - - return []; + return $this->inner->getSupportedTypes($format); } }