We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0df9752 commit 3a5e5caCopy full SHA for 3a5e5ca
src/Finder.php
@@ -36,14 +36,14 @@ public static function last(iterable $data, callable $filter): mixed
36
*/
37
private static function locateFirst(iterable $data, callable $filter, bool $isReverse = false): mixed
38
{
39
- // convert to array if $data is Traversable
40
- if ($data instanceof Traversable) {
41
- $data = iterator_to_array($data);
42
- }
+ if ($isReverse) {
+ // convert to array if $data is Traversable
+ if ($data instanceof Traversable) {
+ $data = iterator_to_array($data);
43
+ }
44
- Assert::isArray($data);
45
+ Assert::isArray($data);
46
- if ($isReverse) {
47
/** @var mixed[] $data */
48
$data = array_reverse($data);
49
}
0 commit comments