|
@@ 2440-2449 (lines=10) @@
|
| 2437 |
|
* @return static |
| 2438 |
|
* <p>(Immutable)</p> |
| 2439 |
|
*/ |
| 2440 |
|
public function mergeAppendKeepIndex(array $array = [], bool $recursive = false): self |
| 2441 |
|
{ |
| 2442 |
|
if ($recursive === true) { |
| 2443 |
|
$result = \array_replace_recursive($this->getArray(), $array); |
| 2444 |
|
} else { |
| 2445 |
|
$result = \array_replace($this->getArray(), $array); |
| 2446 |
|
} |
| 2447 |
|
|
| 2448 |
|
return static::create($result, $this->iteratorClass, false); |
| 2449 |
|
} |
| 2450 |
|
|
| 2451 |
|
/** |
| 2452 |
|
* Merge the new $array into the current array. |
|
@@ 2463-2472 (lines=10) @@
|
| 2460 |
|
* @return static |
| 2461 |
|
* <p>(Immutable)</p> |
| 2462 |
|
*/ |
| 2463 |
|
public function mergeAppendNewIndex(array $array = [], bool $recursive = false): self |
| 2464 |
|
{ |
| 2465 |
|
if ($recursive === true) { |
| 2466 |
|
$result = \array_merge_recursive($this->getArray(), $array); |
| 2467 |
|
} else { |
| 2468 |
|
$result = \array_merge($this->getArray(), $array); |
| 2469 |
|
} |
| 2470 |
|
|
| 2471 |
|
return static::create($result, $this->iteratorClass, false); |
| 2472 |
|
} |
| 2473 |
|
|
| 2474 |
|
/** |
| 2475 |
|
* Merge the the current array into the $array. |
|
@@ 2485-2494 (lines=10) @@
|
| 2482 |
|
* @return static |
| 2483 |
|
* <p>(Immutable)</p> |
| 2484 |
|
*/ |
| 2485 |
|
public function mergePrependKeepIndex(array $array = [], bool $recursive = false): self |
| 2486 |
|
{ |
| 2487 |
|
if ($recursive === true) { |
| 2488 |
|
$result = \array_replace_recursive($array, $this->getArray()); |
| 2489 |
|
} else { |
| 2490 |
|
$result = \array_replace($array, $this->getArray()); |
| 2491 |
|
} |
| 2492 |
|
|
| 2493 |
|
return static::create($result, $this->iteratorClass, false); |
| 2494 |
|
} |
| 2495 |
|
|
| 2496 |
|
/** |
| 2497 |
|
* Merge the current array into the new $array. |
|
@@ 2508-2517 (lines=10) @@
|
| 2505 |
|
* @return static |
| 2506 |
|
* <p>(Immutable)</p> |
| 2507 |
|
*/ |
| 2508 |
|
public function mergePrependNewIndex(array $array = [], bool $recursive = false): self |
| 2509 |
|
{ |
| 2510 |
|
if ($recursive === true) { |
| 2511 |
|
$result = \array_merge_recursive($array, $this->getArray()); |
| 2512 |
|
} else { |
| 2513 |
|
$result = \array_merge($array, $this->getArray()); |
| 2514 |
|
} |
| 2515 |
|
|
| 2516 |
|
return static::create($result, $this->iteratorClass, false); |
| 2517 |
|
} |
| 2518 |
|
|
| 2519 |
|
/** |
| 2520 |
|
* @return ArrayyMeta|static |