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 b719445 commit 2889319
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Normalizer/GetSetMethodNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function normalize($object, $format = null)
$attributes = array();
foreach ($reflectionMethods as $method) {
if ($this->isGetMethod($method)) {
$attributeName = lcfirst(substr($method->getName(), 3));
$attributeName = lcfirst(substr($method->name, 3));

if (in_array($attributeName, $this->ignoredAttributes)) {
continue;
Expand Down Expand Up @@ -108,7 +108,7 @@ public function denormalize($data, $class, $format = null)

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

if (isset($data[$paramName])) {
$params[] = $data[$paramName];
Expand All @@ -118,7 +118,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 @@ -182,8 +182,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 2889319

Please sign in to comment.