Skip to content
This repository was archived by the owner on May 12, 2022. It is now read-only.

Commit c50a787

Browse files
author
Nik Barham
committed
Nik, you are a retard - array_map not array_walk...
1 parent e44e5e3 commit c50a787

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Automatorm/Orm/Collection.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,7 @@ public function remove($filter)
316316

317317
public function map(callable $function)
318318
{
319-
$copy = $this->container;
320-
array_walk($copy, $function);
321-
return new static($copy);
319+
return new static(array_map($function, $this->container));
322320
}
323321

324322
// Only keep items that match filter

0 commit comments

Comments
 (0)