Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Fixed usage of imported namespace.#5507

Merged
Maks3w merged 1 commit into
zendframework:masterfrom
hinikato:patch-1
Nov 21, 2013
Merged

Fixed usage of imported namespace.#5507
Maks3w merged 1 commit into
zendframework:masterfrom
hinikato:patch-1

Conversation

@hinikato
Copy link
Copy Markdown
Contributor

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

The use statement imports \ArrayObject as PhpArrayObject so we need to use it here. In other case it will use of undefined constant.
@grizzm0
Copy link
Copy Markdown
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
@Maks3w
Copy link
Copy Markdown
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
This reverts commit 29443bd, reversing
changes made to 17779c3.
Maks3w added a commit that referenced this pull request Nov 21, 2013
This reverts commit 8753169, reversing
changes made to f976d54.
@jkavalik
Copy link
Copy Markdown

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

@grizzm0
Copy link
Copy Markdown
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.

@hinikato
Copy link
Copy Markdown
Contributor Author

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

@hinikato
Copy link
Copy Markdown
Contributor Author

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.

@Maks3w
Copy link
Copy Markdown
Member

Maks3w commented Nov 21, 2013

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
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
This reverts commit 87531698e7ef1cf3f6994cc8b8e35eb77c9636c0, reversing
changes made to f976d54b423ca669e906a09e019ae2979ac007b4.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants