Skip to content

Commit 4963257

Browse files
committed
Merge branch '6.4' into 7.3
* 6.4: [Messenger] fix test file/class name [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 4a4389e + 44905cd commit 4963257

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Tests/PropertyAccessorTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@ protected function setUp(): void
5252
$this->propertyAccessor = new PropertyAccessor();
5353
}
5454

55+
public function testPrefersPropertyOverMethodWithSameNameAndRequiredArgs()
56+
{
57+
$obj = new class {
58+
public bool $loaded = true;
59+
60+
// Same name as property, but requires an argument: must NOT be called for reading
61+
public function loaded(string $arg): bool
62+
{
63+
throw new \RuntimeException('Method should not be invoked during property read');
64+
}
65+
};
66+
67+
$this->assertTrue($this->propertyAccessor->getValue($obj, 'loaded'));
68+
}
69+
5570
public static function getPathsWithMissingProperty()
5671
{
5772
return [

0 commit comments

Comments
 (0)