[PropertyInfo] Prevent returning int values in some cases.
This commit is contained in:
parent
d564c6ad7d
commit
b190ec241e
@ -64,7 +64,7 @@ class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTyp
|
|||||||
|
|
||||||
$properties = array();
|
$properties = array();
|
||||||
foreach ($reflectionClass->getProperties(\ReflectionProperty::IS_PUBLIC) as $reflectionProperty) {
|
foreach ($reflectionClass->getProperties(\ReflectionProperty::IS_PUBLIC) as $reflectionProperty) {
|
||||||
$properties[$reflectionProperty->name] = true;
|
$properties[$reflectionProperty->name] = $reflectionProperty->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflectionMethod) {
|
foreach ($reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflectionMethod) {
|
||||||
@ -79,10 +79,10 @@ class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTyp
|
|||||||
if (!$reflectionClass->hasProperty($propertyName) && !preg_match('/^[A-Z]{2,}/', $propertyName)) {
|
if (!$reflectionClass->hasProperty($propertyName) && !preg_match('/^[A-Z]{2,}/', $propertyName)) {
|
||||||
$propertyName = lcfirst($propertyName);
|
$propertyName = lcfirst($propertyName);
|
||||||
}
|
}
|
||||||
$properties[$propertyName] = true;
|
$properties[$propertyName] = $propertyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_keys($properties);
|
return array_values($properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ class ReflectionExtractorTest extends TestCase
|
|||||||
|
|
||||||
public function testGetProperties()
|
public function testGetProperties()
|
||||||
{
|
{
|
||||||
$this->assertEquals(
|
$this->assertSame(
|
||||||
array(
|
array(
|
||||||
'bal',
|
'bal',
|
||||||
'parent',
|
'parent',
|
||||||
@ -49,6 +49,7 @@ class ReflectionExtractorTest extends TestCase
|
|||||||
'a',
|
'a',
|
||||||
'DOB',
|
'DOB',
|
||||||
'Id',
|
'Id',
|
||||||
|
'123',
|
||||||
'c',
|
'c',
|
||||||
'd',
|
'd',
|
||||||
'e',
|
'e',
|
||||||
|
@ -116,4 +116,8 @@ class Dummy extends ParentDummy
|
|||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get123()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user