Task #57993
Make package HHVM compatible - failing getPackageReturnsTheSpecifiedPackage test
Status: | Resolved | Start date: | 2014-04-16 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Tymoteusz Motylewski | % Done: | 100% |
|
Category: | - | Spent time: | - | |
Target version: | - | |||
TYPO3 Version: | 6.2 | Complexity: | ||
PHP Version: | Sprint Focus: |
Description
the PackageManagerTest::getPackageReturnsTheSpecifiedPackage is failing on hhvm, because it HHVM doesn't support calling key() on objects.
So it is failing now with "Fatal error: Cannot access empty property in..."
Responsible code is in Package->getNamespace()
$namespaces = $manifest->autoload->{'psr-0'}; if (count($namespaces) === 1) { $namespace = key($namespaces); }
it can be solved by first cast object to an array
$namespaces = (array)$manifest->autoload->{'psr-0'}; if (count($namespaces) === 1) { $namespace = key($namespaces); }
quote from
https://github.com/facebook/hhvm/blob/master/hphp/doc/inconsistencies#L90-95
about this inconsistency:
(5) Object internal cursors
Under Zend PHP, objects have an internal cursor (similar to the array internal
cursor) that can be used to iterate over the object's properties. Under HipHop
VM, objects do not have internal cursors, and the next(), prev(), current(),
key(), reset(), end(), and each() builtin functions do not support objects.
Related issues
Associated revisions
[TASK] Make Flow Package HHVM compatible
HHVM doesn't support calling array functions like key()
on objects, we need to cast object to array first.
Resolves: #57993
Related: #57992
Releases: 6.2
Change-Id: I8551860b103745622624dafd8f285db1a7b8f275
Reviewed-on: https://review.typo3.org/29508
Reviewed-by: Stefan Neufeind
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
History
#1 Updated by Gerrit Code Review over 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29508
#2 Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29508
#3 Updated by Tymoteusz Motylewski over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 06290480dc7dca7152d859a4cebc45131880011b.