[serializer][ObjectNormalizer] fixed Undefined attributeName.
This commit is contained in:
parent
6fb9fee200
commit
ee087a109e
@ -57,6 +57,7 @@ class ObjectNormalizer extends AbstractObjectNormalizer
|
|||||||
}
|
}
|
||||||
|
|
||||||
$name = $reflMethod->name;
|
$name = $reflMethod->name;
|
||||||
|
$attributeName = null;
|
||||||
|
|
||||||
if (0 === strpos($name, 'get') || 0 === strpos($name, 'has')) {
|
if (0 === strpos($name, 'get') || 0 === strpos($name, 'has')) {
|
||||||
// getters and hassers
|
// getters and hassers
|
||||||
@ -66,7 +67,7 @@ class ObjectNormalizer extends AbstractObjectNormalizer
|
|||||||
$attributeName = lcfirst(substr($name, 2));
|
$attributeName = lcfirst(substr($name, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->isAllowedAttribute($object, $attributeName)) {
|
if (null !== $attributeName && $this->isAllowedAttribute($object, $attributeName)) {
|
||||||
$attributes[$attributeName] = true;
|
$attributes[$attributeName] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user