From bd41d26f1300665f4459f0d203c30b45e917acf6 Mon Sep 17 00:00:00 2001 From: Maksim Tiugaev Date: Mon, 4 Apr 2022 20:49:39 +0300 Subject: [PATCH] Minor fixes in partial denormalizing --- components/serializer.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/serializer.rst b/components/serializer.rst index 8cfbc5d4927..acd7de09d6a 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -1248,7 +1248,7 @@ collect all exceptions at once, and to get the object partially denormalized:: ]); } catch (PartialDenormalizationException $e) { $violations = new ConstraintViolationList(); - /** @var NotNormalizableValueException */ + /** @var NotNormalizableValueException $exception */ foreach ($e->getErrors() as $exception) { $message = sprintf('The type must be one of "%s" ("%s" given).', implode(', ', $exception->getExpectedTypes()), $exception->getCurrentType()); $parameters = []; @@ -1256,7 +1256,7 @@ collect all exceptions at once, and to get the object partially denormalized:: $parameters['hint'] = $exception->getMessage(); } $violations->add(new ConstraintViolation($message, '', $parameters, null, $exception->getPath(), null)); - }; + } return $this->json($violations, 400); }