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 c99f391 commit b2f332cCopy full SHA for b2f332c
src/Structures/Collections/ArrayCollection.php
@@ -245,11 +245,12 @@ public function map(Closure $func): static
245
* Map the values into a new class.
246
*
247
* @param string $class
248
+ * @param mixed ...$params
249
* @return static
250
*/
- public function mapInto(string $class): static
251
+ public function mapInto(string $class, mixed ...$params): static
252
{
- return $this->map(static fn($value) => new $class($value));
253
+ return $this->map(static fn($value) => new $class($value, ...$params));
254
}
255
256
/**
0 commit comments