Skip to content

Commit 0720c5b

Browse files
committed
Merge branch '7.3' into 7.4
* 7.3: [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 5376261 + 4963257 commit 0720c5b

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
@@ -54,6 +54,21 @@ protected function setUp(): void
5454
$this->propertyAccessor = new PropertyAccessor();
5555
}
5656

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

0 commit comments

Comments
 (0)