Skip to content

Commit

Permalink
changed getName() to name on all Reflection* object calls (fixes #455…
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jun 12, 2012
1 parent d4db7ab commit 40e029e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Normalizer/GetSetMethodNormalizer.php
Expand Up @@ -46,7 +46,7 @@ public function normalize($object, $format = null)
$attributes = array();
foreach ($reflectionMethods as $method) {
if ($this->isGetMethod($method)) {
$attributeName = strtolower(substr($method->getName(), 3));
$attributeName = strtolower(substr($method->name, 3));

$attributeValue = $method->invoke($object);
if (null !== $attributeValue && !is_scalar($attributeValue)) {
Expand All @@ -73,7 +73,7 @@ public function denormalize($data, $class, $format = null)

$params = array();
foreach ($constructorParameters as $constructorParameter) {
$paramName = strtolower($constructorParameter->getName());
$paramName = strtolower($constructorParameter->name);

if (isset($data[$paramName])) {
$params[] = $data[$paramName];
Expand All @@ -83,7 +83,7 @@ public function denormalize($data, $class, $format = null)
throw new RuntimeException(
'Cannot create an instance of '.$class.
' from serialized data because its constructor requires '.
'parameter "'.$constructorParameter->getName().
'parameter "'.$constructorParameter->name.
'" to be present.');
}
}
Expand Down Expand Up @@ -147,8 +147,8 @@ private function supports($class)
private function isGetMethod(\ReflectionMethod $method)
{
return (
0 === strpos($method->getName(), 'get') &&
3 < strlen($method->getName()) &&
0 === strpos($method->name, 'get') &&
3 < strlen($method->name) &&
0 === $method->getNumberOfRequiredParameters()
);
}
Expand Down

0 comments on commit 40e029e

Please sign in to comment.