Skip to content

Commit

Permalink
Use an arrow function in chunk method
Browse files Browse the repository at this point in the history
  • Loading branch information
tdashton committed Nov 18, 2024
1 parent d323276 commit 2979365
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/CollectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ public function chunk(int $size): array
}

return array_map(
static function(array $chunk) {
return self::fromIterable($chunk);
},
static fn(array $chunk) => self::fromIterable($chunk),
array_chunk($this->toArray(), $size)
);
}
Expand Down

0 comments on commit 2979365

Please sign in to comment.