Skip to content

Commit

Permalink
Clean Arr (#49530)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnabil230 authored Jan 1, 2024
1 parent a40c658 commit ae79bf0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Illuminate/Collections/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,7 @@ public static function keyBy($array, $keyBy)
*/
public static function prependKeysWith($array, $prependWith)
{
return Collection::make($array)->mapWithKeys(function ($item, $key) use ($prependWith) {
return [$prependWith.$key => $item];
})->all();
return static::mapWithKeys($array, fn ($item, $key) => [$prependWith.$key => $item]);
}

/**
Expand Down

0 comments on commit ae79bf0

Please sign in to comment.