[BUGFIX] Use reflection information in getGettablePropertyNames 97/50197/7
authorNicole Cordes <typo3@cordes.co>
Wed, 12 Oct 2016 15:55:27 +0000 (17:55 +0200)
committerPhilipp Gampe <philipp.gampe@typo3.org>
Thu, 19 Jan 2017 12:30:12 +0000 (13:30 +0100)
commit7adb722a100cc682b11d7baf7e8427cfae63643e
treeeae7940650fadc2c7a2718330c54f56f8ff16797
parentb63380469eda45f23a28dfe7a19c58c0b9b943c8
[BUGFIX] Use reflection information in getGettablePropertyNames

In \TYPO3\CMS\Extbase\Reflection\ObjectAccess there is a method to get
all available property names of an object. Currently all get/is/has
methods are joined as they can be fetch from Extbase as well. But for
those methods it is necessary to respect their arguments as Extbase
calls those functions without any argument. This can trigger PHP warnings.

The patch uses a class reflection to get public properties and inspect
the method arguments. Only those functions without arguments or only
optional arguments are considered as valid property name.

Resolves: #78270
Releases: master, 7.6
Change-Id: Ie286dca2a249b73d3dc58f7388dda593a678db3d
Reviewed-on: https://review.typo3.org/50197
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe <philipp.gampe@typo3.org>
typo3/sysext/extbase/Classes/Reflection/ObjectAccess.php
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyClassWithGettersAndSetters.php
typo3/sysext/extbase/Tests/Unit/Reflection/ObjectAccessTest.php