laminas / laminas-stdlib

SPL extensions, array utilities, error handlers, and more
https://docs.laminas.dev/laminas-stdlib/
BSD 3-Clause "New" or "Revised" License
190 stars 40 forks source link

Fix #18 call `->toArray()` on `Traversable` instances given to `ArrayUtils::iteratorToArray()` only for instances which are **not** `Iterator` implementations #42

Closed garygitton closed 2 years ago

garygitton commented 2 years ago
Q A
Bugfix yes

Description

Fix of the issue #18 (ArrayUtils::iteratorToArray() different behaviour when recursive is false)

No when we use ArrayUtils::iteratorToArray with recursive = true

A new test is added in the class ArrayUtilsTest under the method testIteratorToArrayWithIteratorHavingMethodToArrayAndRecursiveIsFalse

Fixes #18