[PropertyInfo] Fix breaking change with has*(arguments...) methods
This commit is contained in:
parent
6510b047e6
commit
37cc16e3d8
@ -239,7 +239,7 @@ class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTyp
|
||||
foreach ($this->accessorPrefixes as $prefix) {
|
||||
$methodName = $prefix.$camelProp;
|
||||
|
||||
if ($reflClass->hasMethod($methodName) && ($reflClass->getMethod($methodName)->getModifiers() & $this->methodReflectionFlags)) {
|
||||
if ($reflClass->hasMethod($methodName) && $reflClass->getMethod($methodName)->getModifiers() & $this->methodReflectionFlags && !$reflClass->getMethod($methodName)->getNumberOfRequiredParameters()) {
|
||||
$method = $reflClass->getMethod($methodName);
|
||||
|
||||
return new PropertyReadInfo(PropertyReadInfo::TYPE_METHOD, $methodName, $this->getReadVisiblityForMethod($method), $method->isStatic(), false);
|
||||
|
@ -75,6 +75,7 @@ class ReflectionExtractorTest extends TestCase
|
||||
'xTotals',
|
||||
'YT',
|
||||
'date',
|
||||
'element',
|
||||
'c',
|
||||
'd',
|
||||
'e',
|
||||
@ -291,6 +292,7 @@ class ReflectionExtractorTest extends TestCase
|
||||
['id', true],
|
||||
['Guid', true],
|
||||
['guid', false],
|
||||
['element', false],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,8 @@ class Dummy extends ParentDummy
|
||||
*/
|
||||
public $nestedIterators;
|
||||
|
||||
private $elements;
|
||||
|
||||
public static function getStatic()
|
||||
{
|
||||
}
|
||||
@ -218,4 +220,8 @@ class Dummy extends ParentDummy
|
||||
public function addDate(\DateTime $date)
|
||||
{
|
||||
}
|
||||
|
||||
public function hasElement(string $element): bool
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user