Fixed usage of imported namespace. #5507

Merged
merged 1 commit into from Nov 21, 2013

Conversation

Projects
None yet
4 participants
Contributor

hinikato commented Nov 20, 2013

The use statement imports \ArrayObject as PhpArrayObject so we need to use it here. In other case it will use of undefined constant.

Fixed usage of imported namespace.
The use statement imports \ArrayObject as PhpArrayObject so we need to use it here. In other case it will use of undefined constant.
Contributor

grizzm0 commented Nov 21, 2013

Actually it uses the ArrayObject in the Zend\Stdlib namesapce which handles legacy comparability.

https://github.com/zendframework/zf2/blob/master/library/Zend/Stdlib/ArrayObject.php#L21-L25

@ghost ghost assigned Maks3w Nov 21, 2013

Maks3w added a commit that referenced this pull request Nov 21, 2013

Maks3w added a commit that referenced this pull request Nov 21, 2013

Maks3w added a commit that referenced this pull request Nov 21, 2013

@Maks3w Maks3w merged commit ebe629f into zendframework:master Nov 21, 2013

1 check passed

default The Travis CI build passed
Details
Member

Maks3w commented Nov 21, 2013

Oops. This was wrong, the code was good. ArrayObject is hacked for to have the same API along different PHP versions.

Reverting.

Maks3w added a commit that referenced this pull request Nov 21, 2013

Revert "Merge pull request #5507 in master"
This reverts commit 29443bd, reversing
changes made to 17779c3.

Maks3w added a commit that referenced this pull request Nov 21, 2013

Revert "Merge pull request #5507 in develop"
This reverts commit 8753169, reversing
changes made to f976d54.

Shouldn't it be
\ArrayObject::ARRAY_AS_PROPS
then? If we want that constant from default php version of ArrayObject and not imported one?

Contributor

grizzm0 commented Nov 21, 2013

The imported one is aliases PhpArrayObject as it would conflict with the ArrayObject that already exists in the current namespace. The ArrayObject in the current namespace fixes issues between different versions of PHP.

Contributor

hinikato commented Nov 21, 2013

Sorry it is my error, I should check the current namespace for ArrayObject first.

Contributor

hinikato commented Nov 21, 2013

But anyway the using of PhpArrayObject::ARRAY_AS_PROPS should not break anything, it will refer to \Zend\Stdlib\ArrayObject then, right? Then fix can be right.

gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015

gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015

gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015

gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015

Revert "Merge pull request zendframework/zendframework#5507 in master"
This reverts commit 29443bdadc884ef747b37143cf95b68d993f4f9c, reversing
changes made to 17779c3c29680be0a4fa401ca355a7e9de24c6c0.

gianarb pushed a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015

Revert "Merge pull request zendframework/zendframework#5507 in develop"
This reverts commit 87531698e7ef1cf3f6994cc8b8e35eb77c9636c0, reversing
changes made to f976d54b423ca669e906a09e019ae2979ac007b4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment