From d54b575f3c5a2c64003689d0718fd152b041a70b Mon Sep 17 00:00:00 2001 From: Antoine Bluchet Date: Sat, 26 Oct 2024 09:15:45 +0200 Subject: [PATCH] review --- .../ParameterValidationResourceMetadataCollectionFactory.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Validator/Metadata/Resource/Factory/ParameterValidationResourceMetadataCollectionFactory.php b/src/Validator/Metadata/Resource/Factory/ParameterValidationResourceMetadataCollectionFactory.php index f8bc274e785..e34124f08ec 100644 --- a/src/Validator/Metadata/Resource/Factory/ParameterValidationResourceMetadataCollectionFactory.php +++ b/src/Validator/Metadata/Resource/Factory/ParameterValidationResourceMetadataCollectionFactory.php @@ -91,9 +91,7 @@ public function create(string $resourceClass): ResourceMetadataCollection private function addSchemaValidation(Parameter $parameter, ?array $schema = null, ?bool $required = null, ?OpenApiParameter $openApi = null): Parameter { - $constraints = $parameter->getConstraints(); - - if (\is_array($constraints) && \count($constraints) > 0) { + if (null !== $parameter->getConstraints()) { return $parameter; }