[PropertyInfo] Update List Information from ReflectionExtractor
This commit is contained in:
parent
afc6ee42ca
commit
b2da76ce5b
@ -62,9 +62,13 @@ class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTyp
|
||||
|
||||
foreach ($reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflectionMethod) {
|
||||
$propertyName = $this->getPropertyName($reflectionMethod->name);
|
||||
if ($propertyName) {
|
||||
$properties[$propertyName] = true;
|
||||
if (!$propertyName || isset($properties[$propertyName])) {
|
||||
continue;
|
||||
}
|
||||
if (!preg_match('/^[A-Z]{2,}/', $propertyName)) {
|
||||
$propertyName = lcfirst($propertyName);
|
||||
}
|
||||
$properties[$propertyName] = true;
|
||||
}
|
||||
|
||||
return array_keys($properties);
|
||||
|
@ -36,18 +36,19 @@ class ReflectionExtractorTest extends \PHPUnit_Framework_TestCase
|
||||
'bal',
|
||||
'parent',
|
||||
'collection',
|
||||
'B',
|
||||
'foo',
|
||||
'foo2',
|
||||
'foo3',
|
||||
'foo4',
|
||||
'foo5',
|
||||
'files',
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F',
|
||||
'a',
|
||||
'DOB',
|
||||
'c',
|
||||
'd',
|
||||
'e',
|
||||
'f',
|
||||
),
|
||||
$this->extractor->getProperties('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy')
|
||||
);
|
||||
|
@ -46,6 +46,11 @@ class Dummy extends ParentDummy
|
||||
*/
|
||||
public $collection;
|
||||
|
||||
/**
|
||||
* @var ParentDummy
|
||||
*/
|
||||
public $B;
|
||||
|
||||
/**
|
||||
* A.
|
||||
*
|
||||
@ -63,4 +68,13 @@ class Dummy extends ParentDummy
|
||||
public function setB(ParentDummy $parent = null)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Date of Birth.
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getDOB()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user