Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stdlib\Parameters - References Stdlib\ArrayObject constant whilst extending PhpArrayObject #4

Open
weierophinney opened this issue Dec 31, 2019 · 0 comments

Comments

@weierophinney
Copy link
Member

Just to make the class more concrete and reference the same constants (even though they contain the same variable for now).

In the constructor you are using ArrayObject::ARRAY_AS_PROPS, whilst the class itself is extending the PHP Native ArrayObject:

use ArrayObject as PhpArrayObject;

Whilst this seems fine at the moment, if there is a future PHP change this could lead to a breakage.

I would propose line 29:

parent::__construct($values, ArrayObject::ARRAY_AS_PROPS);

be changed to:

parent::__construct($values, PhpArrayObject::ARRAY_AS_PROPS);

This also has the added benefit of making the Parameters class and subsequently Zend\Http\PhpEnvironment\Request more compatible with earlier versions of PHP.


Originally posted by @madrussa at zendframework/zend-stdlib#43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant