Closed
Description
The ReflectionExtractor
sees a public property as separate from its accessor/mutator methods. For example:
class Website
{
public $domainName;
public $author;
public function getDomainName()
{
return $this->domainName;
}
public function getAuthor()
{
return $this->author;
}
}
var_dump($reflectionExtractor->getProperties());
/*
array (size=4)
0 => string 'domainName' (length=10)
1 => string 'author' (length=6)
2 => string 'DomainName' (length=10)
3 => string 'Author' (length=6)
*/
The easiest fix would be to lowercase the first letter of the property name determined from a method, though this would cause problems with properties that actually do start with an uppercase letter.
Keeping in mind that it's likely that this component will be used in conjunction with the PropertyAccess component, would it be suitable for a naming strategy to be added (the most obvious being the underscore naming strategy used in both PropertyAccess and Doctrine)?
/cc @dunglas