Skip to content

Commit b2f332c

Browse files
author
Fureev Eugene
committed
fix
1 parent c99f391 commit b2f332c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Structures/Collections/ArrayCollection.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,12 @@ public function map(Closure $func): static
245245
* Map the values into a new class.
246246
*
247247
* @param string $class
248+
* @param mixed ...$params
248249
* @return static
249250
*/
250-
public function mapInto(string $class): static
251+
public function mapInto(string $class, mixed ...$params): static
251252
{
252-
return $this->map(static fn($value) => new $class($value));
253+
return $this->map(static fn($value) => new $class($value, ...$params));
253254
}
254255

255256
/**

0 commit comments

Comments
 (0)