Skip to content

Commit

Permalink
[Serializer] Optimize GetSetMethodNormalizer and PropertyNormalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Mar 1, 2015
1 parent c498389 commit c41346b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -68,7 +68,7 @@ public function normalize($object, $format = null, array $context = array())
}

$attributeValue = $method->invoke($object);
if (array_key_exists($attributeName, $this->callbacks)) {
if (isset($this->callbacks[$attributeName])) {
$attributeValue = call_user_func($this->callbacks[$attributeName], $attributeValue);
}
if (null !== $attributeValue && !is_scalar($attributeValue)) {
Expand Down
Expand Up @@ -64,7 +64,7 @@ public function normalize($object, $format = null, array $context = array())

$attributeValue = $property->getValue($object);

if (array_key_exists($property->name, $this->callbacks)) {
if (isset($this->callbacks[$property->name])) {
$attributeValue = call_user_func($this->callbacks[$property->name], $attributeValue);
}
if (null !== $attributeValue && !is_scalar($attributeValue)) {
Expand Down

0 comments on commit c41346b

Please sign in to comment.