zendframework / zend-stdlib

Stdlib component from Zend Framework
BSD 3-Clause "New" or "Revised" License
384 stars 76 forks source link

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

Open madrussa opened 8 years ago

madrussa commented 8 years ago

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.

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-stdlib; a new issue has been opened at https://github.com/laminas/laminas-stdlib/issues/4.