[!!!][CLEANUP] ObjectAccess 85/39585/21
authorClaus Due <claus@namelesscoder.net>
Fri, 2 Sep 2016 09:58:35 +0000 (11:58 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 7 Oct 2016 11:07:52 +0000 (13:07 +0200)
commitddaa91c05d37d45d975eec660d4f2abfd46a1a6a
tree94697fc896350bad3920da53637c5786e99c0e8d
parente2597b25b2f23638757b99da573c906f03ce108b
[!!!][CLEANUP] ObjectAccess

This patch aims to clean up and improve the
ObjectAccess class which currently does a
*lot* of unnecessary operations, but is intended
for use in many places especially with repeated
use. Therefore, any even small optimisation in
this class would be a benefit.

* Uses more native PHP methods where reasonable
* Uses fewer method calls where reasonable
* Gets rid of a variable passed by reference
* More cases return NULL rather than throw Exceptions
* Fastest decisions and access methods come first
* Reflection-based access isolated to edge cases and
  access with the "force" flag being TRUE.
* Sacrifices ability to read objects of types other
  than persisted objects contained in an ObjectStorage
  or subclass of ObjectStorage.
* Changes verdict from FALSE to TRUE when determining
  if a dynamically added property exists on an object
  (these are, by definition, publicly accessible).

Change-Id: Ib17051a43f61bb73a1bd5a8a6c710f54eec8f769
Resolves: #66995
Releases: master
Reviewed-on: https://review.typo3.org/39585
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Breaking-66995-ObjectAccessbehaviorschanged.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/Reflection/ObjectAccess.php
typo3/sysext/extbase/Tests/Unit/Reflection/ObjectAccessTest.php