Closed gszy closed 6 years ago
:-1: from me on this change. Merging iterators has a potential for side effects. Not every iterable is a configuration provider. Merging traversable services in application configuration, for example, would be a bug.
If concrete consumer of array utils allows traversables, it should do conversion itself.
Alternative approach would be to fix SessionManager
so that it’ll pass array
to the ArrayUtils::merge
.
Update: see gscscnd/zend-session@393ef70f6416ecaaaa96c51999ac75a19e77cd13 zendframework/zend-session#93
It was fixed in session manager.
ArrayUtils::merge
should be capable of merging botharray
s andTraversable
s (that’s theiterable
typehint). Actually it’s used to mergearray|Traversable
inZend\Session\SessionManager
(see https://github.com/zendframework/zend-session/blob/release-2.8.0/src/SessionManager.php#L136).This patch removes
array
typehint fromArrayUtils::merge
parameters. Once at least PHP 7.1 iszend-stdlib
’s requirement,iterable
typehints should be added. I’ve also addedZend\Stdlib\Exception\InvalidArgumentException
“import”, because it’s used a few times in the code.