Skip to content

Commit

Permalink
Replace the array_merge with spread array operator
Browse files Browse the repository at this point in the history
  • Loading branch information
peter279k committed Sep 19, 2023
1 parent 7e76fc2 commit d650c30
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/MichaelPetri/GenericList/ImmutableList.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ public function toArray(): array
*/
public function with(mixed $item): self
{
return self::of(...\array_merge(
$this->toArray(),
[$item]
));
return self::of(...[...$this->toArray(), $item]);
}

/** @psalm-return self<T> */
Expand Down

0 comments on commit d650c30

Please sign in to comment.