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 ee087a1

Browse filesBrowse files
committed
[serializer][ObjectNormalizer] fixed Undefined attributeName.
1 parent 6fb9fee commit ee087a1
Copy full SHA for ee087a1

File tree

1 file changed

+2
-1
lines changed
Filter options

1 file changed

+2
-1
lines changed

‎src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ protected function extractAttributes($object, $format = null, array $context = a
5757
}
5858

5959
$name = $reflMethod->name;
60+
$attributeName = null;
6061

6162
if (0 === strpos($name, 'get') || 0 === strpos($name, 'has')) {
6263
// getters and hassers
@@ -66,7 +67,7 @@ protected function extractAttributes($object, $format = null, array $context = a
6667
$attributeName = lcfirst(substr($name, 2));
6768
}
6869

69-
if ($this->isAllowedAttribute($object, $attributeName)) {
70+
if (null !== $attributeName && $this->isAllowedAttribute($object, $attributeName)) {
7071
$attributes[$attributeName] = true;
7172
}
7273
}

0 commit comments

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