[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) {
|
foreach ($this->accessorPrefixes as $prefix) {
|
||||||
$methodName = $prefix.$camelProp;
|
$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);
|
$method = $reflClass->getMethod($methodName);
|
||||||
|
|
||||||
return new PropertyReadInfo(PropertyReadInfo::TYPE_METHOD, $methodName, $this->getReadVisiblityForMethod($method), $method->isStatic(), false);
|
return new PropertyReadInfo(PropertyReadInfo::TYPE_METHOD, $methodName, $this->getReadVisiblityForMethod($method), $method->isStatic(), false);
|
||||||
|
@ -75,6 +75,7 @@ class ReflectionExtractorTest extends TestCase
|
|||||||
'xTotals',
|
'xTotals',
|
||||||
'YT',
|
'YT',
|
||||||
'date',
|
'date',
|
||||||
|
'element',
|
||||||
'c',
|
'c',
|
||||||
'd',
|
'd',
|
||||||
'e',
|
'e',
|
||||||
@ -291,6 +292,7 @@ class ReflectionExtractorTest extends TestCase
|
|||||||
['id', true],
|
['id', true],
|
||||||
['Guid', true],
|
['Guid', true],
|
||||||
['guid', false],
|
['guid', false],
|
||||||
|
['element', false],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,6 +130,8 @@ class Dummy extends ParentDummy
|
|||||||
*/
|
*/
|
||||||
public $nestedIterators;
|
public $nestedIterators;
|
||||||
|
|
||||||
|
private $elements;
|
||||||
|
|
||||||
public static function getStatic()
|
public static function getStatic()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -218,4 +220,8 @@ class Dummy extends ParentDummy
|
|||||||
public function addDate(\DateTime $date)
|
public function addDate(\DateTime $date)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hasElement(string $element): bool
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user