Skip to content

Commit 2f6eca1

Browse files
committed
fix: ensure lazy list trait type-hints a list not array
1 parent 4e648f4 commit 2f6eca1

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/Toolkit/Iterables/IsLazyList.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,16 @@ public function getIterator(): Generator
4040
}
4141

4242
/**
43-
* @return array<T>
43+
* @return list<T>
4444
*/
4545
public function all(): array
4646
{
47-
return iterator_to_array($this->getIterator());
47+
$all = [];
48+
49+
foreach ($this as $value) {
50+
$all[] = $value;
51+
}
52+
53+
return $all;
4854
}
4955
}

0 commit comments

Comments
 (0)