| @@ 2001-2010 (lines=10) @@ | ||
| 1998 | * |
|
| 1999 | * @return static <p>(Immutable)</p> |
|
| 2000 | */ |
|
| 2001 | public function mergeAppendKeepIndex(array $array = array(), $recursive = false) |
|
| 2002 | { |
|
| 2003 | if (true === $recursive) { |
|
| 2004 | $result = \array_replace_recursive($this->array, $array); |
|
| 2005 | } else { |
|
| 2006 | $result = \array_replace($this->array, $array); |
|
| 2007 | } |
|
| 2008 | ||
| 2009 | return static::create($result); |
|
| 2010 | } |
|
| 2011 | ||
| 2012 | /** |
|
| 2013 | * Merge the new $array into the current array. |
|
| @@ 2023-2032 (lines=10) @@ | ||
| 2020 | * |
|
| 2021 | * @return static <p>(Immutable)</p> |
|
| 2022 | */ |
|
| 2023 | public function mergeAppendNewIndex(array $array = array(), $recursive = false) |
|
| 2024 | { |
|
| 2025 | if (true === $recursive) { |
|
| 2026 | $result = \array_merge_recursive($this->array, $array); |
|
| 2027 | } else { |
|
| 2028 | $result = \array_merge($this->array, $array); |
|
| 2029 | } |
|
| 2030 | ||
| 2031 | return static::create($result); |
|
| 2032 | } |
|
| 2033 | ||
| 2034 | /** |
|
| 2035 | * Merge the the current array into the $array. |
|
| @@ 2044-2053 (lines=10) @@ | ||
| 2041 | * |
|
| 2042 | * @return static <p>(Immutable)</p> |
|
| 2043 | */ |
|
| 2044 | public function mergePrependKeepIndex(array $array = array(), $recursive = false) |
|
| 2045 | { |
|
| 2046 | if (true === $recursive) { |
|
| 2047 | $result = \array_replace_recursive($array, $this->array); |
|
| 2048 | } else { |
|
| 2049 | $result = \array_replace($array, $this->array); |
|
| 2050 | } |
|
| 2051 | ||
| 2052 | return static::create($result); |
|
| 2053 | } |
|
| 2054 | ||
| 2055 | /** |
|
| 2056 | * Merge the current array into the new $array. |
|
| @@ 2066-2075 (lines=10) @@ | ||
| 2063 | * |
|
| 2064 | * @return static <p>(Immutable)</p> |
|
| 2065 | */ |
|
| 2066 | public function mergePrependNewIndex(array $array = array(), $recursive = false) |
|
| 2067 | { |
|
| 2068 | if (true === $recursive) { |
|
| 2069 | $result = \array_merge_recursive($array, $this->array); |
|
| 2070 | } else { |
|
| 2071 | $result = \array_merge($array, $this->array); |
|
| 2072 | } |
|
| 2073 | ||
| 2074 | return static::create($result); |
|
| 2075 | } |
|
| 2076 | ||
| 2077 | /** |
|
| 2078 | * Get the min value from an array. |
|