| @@ 1500-1509 (lines=10) @@ | ||
| 1497 | * |
|
| 1498 | * @return Arrayy (Immutable) |
|
| 1499 | */ |
|
| 1500 | public function mergeAppendKeepIndex(array $array = array(), $recursive = false) |
|
| 1501 | { |
|
| 1502 | if (true === $recursive) { |
|
| 1503 | $result = array_replace_recursive($this->array, $array); |
|
| 1504 | } else { |
|
| 1505 | $result = array_replace($this->array, $array); |
|
| 1506 | } |
|
| 1507 | ||
| 1508 | return static::create($result); |
|
| 1509 | } |
|
| 1510 | ||
| 1511 | /** |
|
| 1512 | * Merge the new $array into the current array. |
|
| @@ 1522-1531 (lines=10) @@ | ||
| 1519 | * |
|
| 1520 | * @return Arrayy (Immutable) |
|
| 1521 | */ |
|
| 1522 | public function mergeAppendNewIndex(array $array = array(), $recursive = false) |
|
| 1523 | { |
|
| 1524 | if (true === $recursive) { |
|
| 1525 | $result = array_merge_recursive($this->array, $array); |
|
| 1526 | } else { |
|
| 1527 | $result = array_merge($this->array, $array); |
|
| 1528 | } |
|
| 1529 | ||
| 1530 | return static::create($result); |
|
| 1531 | } |
|
| 1532 | ||
| 1533 | /** |
|
| 1534 | * Merge the the current array into the $array. |
|
| @@ 1543-1552 (lines=10) @@ | ||
| 1540 | * |
|
| 1541 | * @return Arrayy (Immutable) |
|
| 1542 | */ |
|
| 1543 | public function mergePrependKeepIndex(array $array = array(), $recursive = false) |
|
| 1544 | { |
|
| 1545 | if (true === $recursive) { |
|
| 1546 | $result = array_replace_recursive($array, $this->array); |
|
| 1547 | } else { |
|
| 1548 | $result = array_replace($array, $this->array); |
|
| 1549 | } |
|
| 1550 | ||
| 1551 | return static::create($result); |
|
| 1552 | } |
|
| 1553 | ||
| 1554 | /** |
|
| 1555 | * Merge the current array into the new $array. |
|
| @@ 1565-1574 (lines=10) @@ | ||
| 1562 | * |
|
| 1563 | * @return Arrayy (Immutable) |
|
| 1564 | */ |
|
| 1565 | public function mergePrependNewIndex(array $array = array(), $recursive = false) |
|
| 1566 | { |
|
| 1567 | if (true === $recursive) { |
|
| 1568 | $result = array_merge_recursive($array, $this->array); |
|
| 1569 | } else { |
|
| 1570 | $result = array_merge($array, $this->array); |
|
| 1571 | } |
|
| 1572 | ||
| 1573 | return static::create($result); |
|
| 1574 | } |
|
| 1575 | ||
| 1576 | /** |
|
| 1577 | * Get the min value from an array. |
|