|
@@ -38,10 +38,8 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer
|
|
|
/**
|
|
|
* {@inheritdoc}
|
|
|
*/
|
|
|
- public function normalize($object, $format, $properties = null)
|
|
|
+ public function normalize($object, $format)
|
|
|
{
|
|
|
- $propertyMap = (null === $properties) ? null : array_flip(array_map('strtolower', $properties));
|
|
|
-
|
|
|
$reflectionObject = new \ReflectionObject($object);
|
|
|
$reflectionMethods = $reflectionObject->getMethods(\ReflectionMethod::IS_PUBLIC);
|
|
|
|
|
@@ -50,14 +48,12 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer
|
|
|
if ($this->isGetMethod($method)) {
|
|
|
$attributeName = strtolower(substr($method->getName(), 3));
|
|
|
|
|
|
- if (null === $propertyMap || isset($propertyMap[$attributeName])) {
|
|
|
- $attributeValue = $method->invoke($object);
|
|
|
- if (null !== $attributeValue && !is_scalar($attributeValue)) {
|
|
|
- $attributeValue = $this->serializer->normalize($attributeValue, $format);
|
|
|
- }
|
|
|
-
|
|
|
- $attributes[$attributeName] = $attributeValue;
|
|
|
+ $attributeValue = $method->invoke($object);
|
|
|
+ if (null !== $attributeValue && !is_scalar($attributeValue)) {
|
|
|
+ $attributeValue = $this->serializer->normalize($attributeValue, $format);
|
|
|
}
|
|
|
+
|
|
|
+ $attributes[$attributeName] = $attributeValue;
|
|
|
}
|
|
|
}
|
|
|
|