| @@ 2388-2397 (lines=10) @@ | ||
| 2385 | * |
|
| 2386 | * @return static <p>(Immutable)</p> |
|
| 2387 | */ |
|
| 2388 | public function mergeAppendKeepIndex(array $array = array(), $recursive = false) |
|
| 2389 | { |
|
| 2390 | if (true === $recursive) { |
|
| 2391 | $result = \array_replace_recursive($this->array, $array); |
|
| 2392 | } else { |
|
| 2393 | $result = \array_replace($this->array, $array); |
|
| 2394 | } |
|
| 2395 | ||
| 2396 | return static::create($result); |
|
| 2397 | } |
|
| 2398 | ||
| 2399 | /** |
|
| 2400 | * Merge the new $array into the current array. |
|
| @@ 2410-2419 (lines=10) @@ | ||
| 2407 | * |
|
| 2408 | * @return static <p>(Immutable)</p> |
|
| 2409 | */ |
|
| 2410 | public function mergeAppendNewIndex(array $array = array(), $recursive = false) |
|
| 2411 | { |
|
| 2412 | if (true === $recursive) { |
|
| 2413 | $result = \array_merge_recursive($this->array, $array); |
|
| 2414 | } else { |
|
| 2415 | $result = \array_merge($this->array, $array); |
|
| 2416 | } |
|
| 2417 | ||
| 2418 | return static::create($result); |
|
| 2419 | } |
|
| 2420 | ||
| 2421 | /** |
|
| 2422 | * Merge the the current array into the $array. |
|
| @@ 2431-2440 (lines=10) @@ | ||
| 2428 | * |
|
| 2429 | * @return static <p>(Immutable)</p> |
|
| 2430 | */ |
|
| 2431 | public function mergePrependKeepIndex(array $array = array(), $recursive = false) |
|
| 2432 | { |
|
| 2433 | if (true === $recursive) { |
|
| 2434 | $result = \array_replace_recursive($array, $this->array); |
|
| 2435 | } else { |
|
| 2436 | $result = \array_replace($array, $this->array); |
|
| 2437 | } |
|
| 2438 | ||
| 2439 | return static::create($result); |
|
| 2440 | } |
|
| 2441 | ||
| 2442 | /** |
|
| 2443 | * Merge the current array into the new $array. |
|
| @@ 2453-2462 (lines=10) @@ | ||
| 2450 | * |
|
| 2451 | * @return static <p>(Immutable)</p> |
|
| 2452 | */ |
|
| 2453 | public function mergePrependNewIndex(array $array = array(), $recursive = false) |
|
| 2454 | { |
|
| 2455 | if (true === $recursive) { |
|
| 2456 | $result = \array_merge_recursive($array, $this->array); |
|
| 2457 | } else { |
|
| 2458 | $result = \array_merge($array, $this->array); |
|
| 2459 | } |
|
| 2460 | ||
| 2461 | return static::create($result); |
|
| 2462 | } |
|
| 2463 | ||
| 2464 | /** |
|
| 2465 | * Get the min value from an array. |
|