Bug #46491

ObjectAccess::getProperty() does not work for getters in ArrayAccess

Added by Bastian Waidelich over 2 years ago. Updated over 2 years ago.

Status:Resolved Start date:2013-03-21
Priority:Must have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:Reflection
Target version:-
PHP Version: Complexity:
Has patch:No Affected Flow version:Git master

Description

#42723 introduced a regression that prevents custom getters in ArrayAccess objects to be called via ObjectAccess::getProperty()

Code to reproduce the issue:

1$arrayObject = new \ArrayObject();
2var_dump($arrayObject->getIteratorClass());
3var_dump(\TYPO3\Flow\Reflection\ObjectAccess::getProperty($arrayObject, 'iteratorClass'));

Should output "ArrayIterator" twice, but the second time an exception #1263391473: The property "iteratorClass" on the subject was not accessible is thrown.


Related issues

related to TYPO3.Flow - Bug #42723: Reflection\ObjectAccess consumes to much processing time Resolved 2012-11-06

Associated revisions

Revision 392020a6
Added by Bastian Waidelich over 2 years ago

[BUGFIX] fix ObjectAccess::getProperty() for getters in ArrayAccess objects

With I2abbbd5924cd0177ad8a31cb01c2953dd5ba39fd a regression was introduced
that prevented ObjectAccess::getProperty() to work on objects implementing ArrayAccess
and providing custom getters.

Code to reproduce:
\TYPO3\Flow\Reflection\ObjectAccess::getProperty(new \ArrayObject(), 'iteratorClass')

expected: "ArrayIterator"
actual: Exception

This change fixes this by checking arrays and ArrayAccess objects separately.

Change-Id: I31355c9b4ace868cff7d5ea1c4e1b3735b1225f6
Fixes: #46491
Related: #42723
Releases: master

Revision cf1e9e3e
Added by Bastian Waidelich over 2 years ago

[BUGFIX] fix ObjectAccess::getProperty() for getters in ArrayAccess objects

With I2abbbd5924cd0177ad8a31cb01c2953dd5ba39fd a regression was introduced
that prevented ObjectAccess::getProperty() to work on objects implementing ArrayAccess
and providing custom getters.

Code to reproduce:
\TYPO3\Flow\Reflection\ObjectAccess::getProperty(new \ArrayObject(), 'iteratorClass')

expected: "ArrayIterator"
actual: Exception

This change fixes this by checking arrays and ArrayAccess objects separately.

Change-Id: I31355c9b4ace868cff7d5ea1c4e1b3735b1225f6
Fixes: #46491
Related: #42723
Releases: master

History

#1 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19129

#2 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19129

#3 Updated by Bastian Waidelich over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch composer has been pushed to the review server.
It is available at https://review.typo3.org/19375

#5 Updated by Bastian Waidelich over 2 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF