[BUGFIX] Use reflection information in getGettablePropertyNames 61/51361/3
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 13:58:25 +0000 (14:58 +0100)
commit7efc092447487c9a8dab3dbd6970c4f5677fabc4
treefed32eb02a11e28eb27046f8b7515e137c633653
parentaa17d026a6757ffdd715dc1c37bcec94d7de4eed
[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/51361
Tested-by: TYPO3com <no-reply@typo3.com>
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