From 9a4eddd5c6f08932467b3862f191389db5f2fcb5 Mon Sep 17 00:00:00 2001 From: peter279k Date: Tue, 19 Sep 2023 15:15:51 +0800 Subject: [PATCH] Replace the array_merge with spread array operator --- src/MichaelPetri/GenericList/ImmutableList.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/MichaelPetri/GenericList/ImmutableList.php b/src/MichaelPetri/GenericList/ImmutableList.php index 86c8def..faf18d5 100644 --- a/src/MichaelPetri/GenericList/ImmutableList.php +++ b/src/MichaelPetri/GenericList/ImmutableList.php @@ -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 */