We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4383709 commit b07e6d3Copy full SHA for b07e6d3
1 file changed
src/JarJak/Collection/Collection.php
@@ -10,18 +10,15 @@ public function __construct(...$items)
10
{
11
parent::__construct(\count($items));
12
13
- foreach (array_values($items) as $i => $item) {
14
- $this[$i] = $item;
+ $i = 0;
+ foreach ($items as $item) {
15
+ $this[$i++] = $item;
16
}
17
18
- public static function from(iterable $array)
19
+ public static function from(iterable $iterable)
20
- if (\is_array($array) || $array instanceof \ArrayAccess) {
21
- return new static(...$array);
22
- }
23
-
24
+ return new static(...$iterable);
25
26
27
public function isEmpty(): bool
0 commit comments