| @@ 1478-1487 (lines=10) @@ | ||
| 1475 | * |
|
| 1476 | * @return Arrayy (Immutable) |
|
| 1477 | */ |
|
| 1478 | public function mergeAppendKeepIndex(array $array = array(), $recursive = false) |
|
| 1479 | { |
|
| 1480 | if (true === $recursive) { |
|
| 1481 | $result = array_replace_recursive($this->array, $array); |
|
| 1482 | } else { |
|
| 1483 | $result = array_replace($this->array, $array); |
|
| 1484 | } |
|
| 1485 | ||
| 1486 | return static::create($result); |
|
| 1487 | } |
|
| 1488 | ||
| 1489 | /** |
|
| 1490 | * Merge the new $array into the current array. |
|
| @@ 1500-1509 (lines=10) @@ | ||
| 1497 | * |
|
| 1498 | * @return Arrayy (Immutable) |
|
| 1499 | */ |
|
| 1500 | public function mergeAppendNewIndex(array $array = array(), $recursive = false) |
|
| 1501 | { |
|
| 1502 | if (true === $recursive) { |
|
| 1503 | $result = array_merge_recursive($this->array, $array); |
|
| 1504 | } else { |
|
| 1505 | $result = array_merge($this->array, $array); |
|
| 1506 | } |
|
| 1507 | ||
| 1508 | return static::create($result); |
|
| 1509 | } |
|
| 1510 | ||
| 1511 | /** |
|
| 1512 | * Merge the the current array into the $array. |
|
| @@ 1521-1530 (lines=10) @@ | ||
| 1518 | * |
|
| 1519 | * @return Arrayy (Immutable) |
|
| 1520 | */ |
|
| 1521 | public function mergePrependKeepIndex(array $array = array(), $recursive = false) |
|
| 1522 | { |
|
| 1523 | if (true === $recursive) { |
|
| 1524 | $result = array_replace_recursive($array, $this->array); |
|
| 1525 | } else { |
|
| 1526 | $result = array_replace($array, $this->array); |
|
| 1527 | } |
|
| 1528 | ||
| 1529 | return static::create($result); |
|
| 1530 | } |
|
| 1531 | ||
| 1532 | /** |
|
| 1533 | * Merge the current array into the new $array. |
|
| @@ 1543-1552 (lines=10) @@ | ||
| 1540 | * |
|
| 1541 | * @return Arrayy (Immutable) |
|
| 1542 | */ |
|
| 1543 | public function mergePrependNewIndex(array $array = array(), $recursive = false) |
|
| 1544 | { |
|
| 1545 | if (true === $recursive) { |
|
| 1546 | $result = array_merge_recursive($array, $this->array); |
|
| 1547 | } else { |
|
| 1548 | $result = array_merge($array, $this->array); |
|
| 1549 | } |
|
| 1550 | ||
| 1551 | return static::create($result); |
|
| 1552 | } |
|
| 1553 | ||
| 1554 | /** |
|
| 1555 | * Get the min value from an array. |
|