Skip to content

Commit 40e029e

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 d4db7ab commit 40e029e

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
@@ -46,7 +46,7 @@ public function normalize($object, $format = null)
4646
$attributes = array();
4747
foreach ($reflectionMethods as $method) {
4848
if ($this->isGetMethod($method)) {
49-
$attributeName = strtolower(substr($method->getName(), 3));
49+
$attributeName = strtolower(substr($method->name, 3));
5050

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

7474
$params = array();
7575
foreach ($constructorParameters as $constructorParameter) {
76-
$paramName = strtolower($constructorParameter->getName());
76+
$paramName = strtolower($constructorParameter->name);
7777

7878
if (isset($data[$paramName])) {
7979
$params[] = $data[$paramName];
@@ -83,7 +83,7 @@ public function denormalize($data, $class, $format = null)
8383
throw new RuntimeException(
8484
'Cannot create an instance of '.$class.
8585
' from serialized data because its constructor requires '.
86-
'parameter "'.$constructorParameter->getName().
86+
'parameter "'.$constructorParameter->name.
8787
'" to be present.');
8888
}
8989
}
@@ -147,8 +147,8 @@ private function supports($class)
147147
private function isGetMethod(\ReflectionMethod $method)
148148
{
149149
return (
150-
0 === strpos($method->getName(), 'get') &&
151-
3 < strlen($method->getName()) &&
150+
0 === strpos($method->name, 'get') &&
151+
3 < strlen($method->name) &&
152152
0 === $method->getNumberOfRequiredParameters()
153153
);
154154
}

0 commit comments

Comments
 (0)