Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cb935e7

Browse filesBrowse files
mdeboerogizanagi
authored andcommitted
[Serializer] Getter for extra attributes in ExtraAttributesException
1 parent 701d41c commit cb935e7
Copy full SHA for cb935e7

File tree

Expand file treeCollapse file tree

2 files changed

+15
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-0
lines changed

‎src/Symfony/Component/Serializer/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CHANGELOG
77
* added `AbstractObjectNormalizer::DISABLE_TYPE_ENFORCEMENT` context option
88
to disable throwing an `UnexpectedValueException` on a type mismatch
99
* added support for serializing `DateInterval` objects
10+
* added getter for extra attributes in `ExtraAttributesException`
1011

1112
3.3.0
1213
-----

‎src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Exception/ExtraAttributesException.php
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,24 @@
1818
*/
1919
class ExtraAttributesException extends RuntimeException
2020
{
21+
private $extraAttributes;
22+
2123
public function __construct(array $extraAttributes, \Exception $previous = null)
2224
{
2325
$msg = sprintf('Extra attributes are not allowed ("%s" are unknown).', implode('", "', $extraAttributes));
2426

27+
$this->extraAttributes = $extraAttributes;
28+
2529
parent::__construct($msg, 0, $previous);
2630
}
31+
32+
/**
33+
* Get the extra attributes that are not allowed.
34+
*
35+
* @return array
36+
*/
37+
public function getExtraAttributes()
38+
{
39+
return $this->extraAttributes;
40+
}
2741
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.