From 45512a87638479960730d20f14764d03c2712315 Mon Sep 17 00:00:00 2001 From: Maarten de Boer Date: Thu, 21 Sep 2017 14:46:00 +0200 Subject: [PATCH 1/4] Add getter for extra attributes in ExtraAttributesException --- .../Exception/ExtraAttributesException.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php b/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php index d321618b8eb11..ea4af8097848c 100644 --- a/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php +++ b/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php @@ -18,10 +18,32 @@ */ class ExtraAttributesException extends RuntimeException { + /** + * Extra attributes + * @var array + */ + private $extraAttributes; + + /** + * {@inheritDoc} + * @param array $extraAttributes Extra attributes that are not allowed + * @param \Exception $previous Previous exception + */ public function __construct(array $extraAttributes, \Exception $previous = null) { $msg = sprintf('Extra attributes are not allowed ("%s" are unknown).', implode('", "', $extraAttributes)); + + $this->extraAttributes = $extraAttributes; parent::__construct($msg, 0, $previous); } + + /** + * Get the extra attributes that are not allowed + * @return array + */ + public function getExtraAttributes() + { + return $this->extraAttributes; + } } From d4c782d013ce4163a96e895c01d8b309a4c1d46e Mon Sep 17 00:00:00 2001 From: Maarten de Boer Date: Thu, 21 Sep 2017 14:56:31 +0200 Subject: [PATCH 2/4] Update changelog --- src/Symfony/Component/Serializer/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/Serializer/CHANGELOG.md b/src/Symfony/Component/Serializer/CHANGELOG.md index ef59f22499264..9e48c5c41e927 100644 --- a/src/Symfony/Component/Serializer/CHANGELOG.md +++ b/src/Symfony/Component/Serializer/CHANGELOG.md @@ -7,6 +7,7 @@ CHANGELOG * added `AbstractObjectNormalizer::DISABLE_TYPE_ENFORCEMENT` context option to disable throwing an `UnexpectedValueException` on a type mismatch * added support for serializing `DateInterval` objects + * added getter for extra attributes in `ExtraAttributesException` 3.3.0 ----- From c7c982d661d328f853f1d073ce309e9f43fc2987 Mon Sep 17 00:00:00 2001 From: Maarten de Boer Date: Thu, 21 Sep 2017 15:02:06 +0200 Subject: [PATCH 3/4] Fix for coding standards --- .../Exception/ExtraAttributesException.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php b/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php index ea4af8097848c..9be1fd924ffd1 100644 --- a/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php +++ b/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php @@ -19,27 +19,30 @@ class ExtraAttributesException extends RuntimeException { /** - * Extra attributes + * Extra attributes. + * * @var array */ private $extraAttributes; - + /** - * {@inheritDoc} - * @param array $extraAttributes Extra attributes that are not allowed - * @param \Exception $previous Previous exception + * {@inheritdoc} + * + * @param array $extraAttributes Extra attributes that are not allowed + * @param \Exception $previous Previous exception */ public function __construct(array $extraAttributes, \Exception $previous = null) { $msg = sprintf('Extra attributes are not allowed ("%s" are unknown).', implode('", "', $extraAttributes)); - + $this->extraAttributes = $extraAttributes; parent::__construct($msg, 0, $previous); } - + /** - * Get the extra attributes that are not allowed + * Get the extra attributes that are not allowed. + * * @return array */ public function getExtraAttributes() From 2d8a7941cc0021840a2564e39eef7c55c25719c3 Mon Sep 17 00:00:00 2001 From: Maarten de Boer Date: Thu, 21 Sep 2017 23:06:14 +0200 Subject: [PATCH 4/4] Remove unneeded docblocks --- .../Serializer/Exception/ExtraAttributesException.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php b/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php index 9be1fd924ffd1..74d87f87f5e8d 100644 --- a/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php +++ b/src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php @@ -18,19 +18,8 @@ */ class ExtraAttributesException extends RuntimeException { - /** - * Extra attributes. - * - * @var array - */ private $extraAttributes; - /** - * {@inheritdoc} - * - * @param array $extraAttributes Extra attributes that are not allowed - * @param \Exception $previous Previous exception - */ public function __construct(array $extraAttributes, \Exception $previous = null) { $msg = sprintf('Extra attributes are not allowed ("%s" are unknown).', implode('", "', $extraAttributes)); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy