| @@ 2167-2176 (lines=10) @@ | ||
| 2164 | * |
|
| 2165 | * @return static <p>(Immutable)</p> |
|
| 2166 | */ |
|
| 2167 | public function mergeAppendKeepIndex(array $array = array(), $recursive = false) |
|
| 2168 | { |
|
| 2169 | if (true === $recursive) { |
|
| 2170 | $result = \array_replace_recursive($this->array, $array); |
|
| 2171 | } else { |
|
| 2172 | $result = \array_replace($this->array, $array); |
|
| 2173 | } |
|
| 2174 | ||
| 2175 | return static::create($result); |
|
| 2176 | } |
|
| 2177 | ||
| 2178 | /** |
|
| 2179 | * Merge the new $array into the current array. |
|
| @@ 2189-2198 (lines=10) @@ | ||
| 2186 | * |
|
| 2187 | * @return static <p>(Immutable)</p> |
|
| 2188 | */ |
|
| 2189 | public function mergeAppendNewIndex(array $array = array(), $recursive = false) |
|
| 2190 | { |
|
| 2191 | if (true === $recursive) { |
|
| 2192 | $result = \array_merge_recursive($this->array, $array); |
|
| 2193 | } else { |
|
| 2194 | $result = \array_merge($this->array, $array); |
|
| 2195 | } |
|
| 2196 | ||
| 2197 | return static::create($result); |
|
| 2198 | } |
|
| 2199 | ||
| 2200 | /** |
|
| 2201 | * Merge the the current array into the $array. |
|
| @@ 2210-2219 (lines=10) @@ | ||
| 2207 | * |
|
| 2208 | * @return static <p>(Immutable)</p> |
|
| 2209 | */ |
|
| 2210 | public function mergePrependKeepIndex(array $array = array(), $recursive = false) |
|
| 2211 | { |
|
| 2212 | if (true === $recursive) { |
|
| 2213 | $result = \array_replace_recursive($array, $this->array); |
|
| 2214 | } else { |
|
| 2215 | $result = \array_replace($array, $this->array); |
|
| 2216 | } |
|
| 2217 | ||
| 2218 | return static::create($result); |
|
| 2219 | } |
|
| 2220 | ||
| 2221 | /** |
|
| 2222 | * Merge the current array into the new $array. |
|
| @@ 2232-2241 (lines=10) @@ | ||
| 2229 | * |
|
| 2230 | * @return static <p>(Immutable)</p> |
|
| 2231 | */ |
|
| 2232 | public function mergePrependNewIndex(array $array = array(), $recursive = false) |
|
| 2233 | { |
|
| 2234 | if (true === $recursive) { |
|
| 2235 | $result = \array_merge_recursive($array, $this->array); |
|
| 2236 | } else { |
|
| 2237 | $result = \array_merge($array, $this->array); |
|
| 2238 | } |
|
| 2239 | ||
| 2240 | return static::create($result); |
|
| 2241 | } |
|
| 2242 | ||
| 2243 | /** |
|
| 2244 | * Get the min value from an array. |
|