Skip to content

Commit 2889319

Browse files
committed
changed getName() to name on all Reflection* object calls (fixes #4555, refs https://bugs.php.net/bug.php?id=61384)
1 parent b719445 commit 2889319

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Normalizer/GetSetMethodNormalizer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function normalize($object, $format = null)
7474
$attributes = array();
7575
foreach ($reflectionMethods as $method) {
7676
if ($this->isGetMethod($method)) {
77-
$attributeName = lcfirst(substr($method->getName(), 3));
77+
$attributeName = lcfirst(substr($method->name, 3));
7878

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

109109
$params = array();
110110
foreach ($constructorParameters as $constructorParameter) {
111-
$paramName = lcfirst($constructorParameter->getName());
111+
$paramName = lcfirst($constructorParameter->name);
112112

113113
if (isset($data[$paramName])) {
114114
$params[] = $data[$paramName];
@@ -118,7 +118,7 @@ public function denormalize($data, $class, $format = null)
118118
throw new RuntimeException(
119119
'Cannot create an instance of '.$class.
120120
' from serialized data because its constructor requires '.
121-
'parameter "'.$constructorParameter->getName().
121+
'parameter "'.$constructorParameter->name.
122122
'" to be present.');
123123
}
124124
}
@@ -182,8 +182,8 @@ private function supports($class)
182182
private function isGetMethod(\ReflectionMethod $method)
183183
{
184184
return (
185-
0 === strpos($method->getName(), 'get') &&
186-
3 < strlen($method->getName()) &&
185+
0 === strpos($method->name, 'get') &&
186+
3 < strlen($method->name) &&
187187
0 === $method->getNumberOfRequiredParameters()
188188
);
189189
}

0 commit comments

Comments
 (0)