Skip to content

Commit a756f19

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: bump required PropertyInfo component patch version [VarDumper] Fix dumper selection for Accept: */* requests [Messenger] fix test file/class name src/Symfony/Component/JsonPath - fix [PropertyInfo] Fix calling same-named method with required args instead of reading public property [Serializer] Do not skip nested `null` values when denormalizing
2 parents 36f00b5 + ea62b28 commit a756f19

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Extractor/ReflectionExtractor.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,10 @@ public function getReadInfo(string $class, string $property, array $context = []
328328

329329
if ($allowGetterSetter && $reflClass->hasMethod($getsetter) && ($reflClass->getMethod($getsetter)->getModifiers() & $this->methodReflectionFlags)) {
330330
$method = $reflClass->getMethod($getsetter);
331-
332-
return new PropertyReadInfo(PropertyReadInfo::TYPE_METHOD, $getsetter, $this->getReadVisibilityForMethod($method), $method->isStatic(), false);
331+
// Only consider jQuery-style accessors when they don't require parameters
332+
if (!$method->getNumberOfRequiredParameters()) {
333+
return new PropertyReadInfo(PropertyReadInfo::TYPE_METHOD, $getsetter, $this->getReadVisibilityForMethod($method), $method->isStatic(), false);
334+
}
333335
}
334336

335337
if ($allowMagicGet && $reflClass->hasMethod('__get') && (($r = $reflClass->getMethod('__get'))->getModifiers() & $this->methodReflectionFlags)) {

0 commit comments

Comments
 (0)