| @@ 4229-4243 (lines=15) @@ | ||
| 4226 | * @psalm-return static<int|TKey,T> |
|
| 4227 | * @psalm-mutation-free |
|
| 4228 | */ |
|
| 4229 | public function mergeAppendKeepIndex(array $array = [], bool $recursive = false): self |
|
| 4230 | { |
|
| 4231 | if ($recursive === true) { |
|
| 4232 | $array = $this->getArrayRecursiveHelperArrayy($array); |
|
| 4233 | $result = \array_replace_recursive($this->toArray(), $array); |
|
| 4234 | } else { |
|
| 4235 | $result = \array_replace($this->toArray(), $array); |
|
| 4236 | } |
|
| 4237 | ||
| 4238 | return static::create( |
|
| 4239 | $result, |
|
| 4240 | $this->iteratorClass, |
|
| 4241 | false |
|
| 4242 | ); |
|
| 4243 | } |
|
| 4244 | ||
| 4245 | /** |
|
| 4246 | * Merge the new $array into the current array. |
|
| @@ 4271-4285 (lines=15) @@ | ||
| 4268 | * @psalm-return static<TKey,T> |
|
| 4269 | * @psalm-mutation-free |
|
| 4270 | */ |
|
| 4271 | public function mergeAppendNewIndex(array $array = [], bool $recursive = false): self |
|
| 4272 | { |
|
| 4273 | if ($recursive === true) { |
|
| 4274 | $array = $this->getArrayRecursiveHelperArrayy($array); |
|
| 4275 | $result = \array_merge_recursive($this->toArray(), $array); |
|
| 4276 | } else { |
|
| 4277 | $result = \array_merge($this->toArray(), $array); |
|
| 4278 | } |
|
| 4279 | ||
| 4280 | return static::create( |
|
| 4281 | $result, |
|
| 4282 | $this->iteratorClass, |
|
| 4283 | false |
|
| 4284 | ); |
|
| 4285 | } |
|
| 4286 | ||
| 4287 | /** |
|
| 4288 | * Merge the the current array into the $array. |
|
| @@ 4312-4326 (lines=15) @@ | ||
| 4309 | * @psalm-return static<TKey,T> |
|
| 4310 | * @psalm-mutation-free |
|
| 4311 | */ |
|
| 4312 | public function mergePrependKeepIndex(array $array = [], bool $recursive = false): self |
|
| 4313 | { |
|
| 4314 | if ($recursive === true) { |
|
| 4315 | $array = $this->getArrayRecursiveHelperArrayy($array); |
|
| 4316 | $result = \array_replace_recursive($array, $this->toArray()); |
|
| 4317 | } else { |
|
| 4318 | $result = \array_replace($array, $this->toArray()); |
|
| 4319 | } |
|
| 4320 | ||
| 4321 | return static::create( |
|
| 4322 | $result, |
|
| 4323 | $this->iteratorClass, |
|
| 4324 | false |
|
| 4325 | ); |
|
| 4326 | } |
|
| 4327 | ||
| 4328 | /** |
|
| 4329 | * Merge the current array into the new $array. |
|
| @@ 4354-4368 (lines=15) @@ | ||
| 4351 | * @psalm-return static<TKey,T> |
|
| 4352 | * @psalm-mutation-free |
|
| 4353 | */ |
|
| 4354 | public function mergePrependNewIndex(array $array = [], bool $recursive = false): self |
|
| 4355 | { |
|
| 4356 | if ($recursive === true) { |
|
| 4357 | $array = $this->getArrayRecursiveHelperArrayy($array); |
|
| 4358 | $result = \array_merge_recursive($array, $this->toArray()); |
|
| 4359 | } else { |
|
| 4360 | $result = \array_merge($array, $this->toArray()); |
|
| 4361 | } |
|
| 4362 | ||
| 4363 | return static::create( |
|
| 4364 | $result, |
|
| 4365 | $this->iteratorClass, |
|
| 4366 | false |
|
| 4367 | ); |
|
| 4368 | } |
|
| 4369 | ||
| 4370 | /** |
|
| 4371 | * @return ArrayyMeta|static |
|