| @@ 2202-2211 (lines=10) @@ | ||
| 2199 | * |
|
| 2200 | * @return static <p>(Immutable)</p> |
|
| 2201 | */ |
|
| 2202 | public function mergeAppendKeepIndex(array $array = array(), $recursive = false) |
|
| 2203 | { |
|
| 2204 | if (true === $recursive) { |
|
| 2205 | $result = \array_replace_recursive($this->array, $array); |
|
| 2206 | } else { |
|
| 2207 | $result = \array_replace($this->array, $array); |
|
| 2208 | } |
|
| 2209 | ||
| 2210 | return static::create($result); |
|
| 2211 | } |
|
| 2212 | ||
| 2213 | /** |
|
| 2214 | * Merge the new $array into the current array. |
|
| @@ 2224-2233 (lines=10) @@ | ||
| 2221 | * |
|
| 2222 | * @return static <p>(Immutable)</p> |
|
| 2223 | */ |
|
| 2224 | public function mergeAppendNewIndex(array $array = array(), $recursive = false) |
|
| 2225 | { |
|
| 2226 | if (true === $recursive) { |
|
| 2227 | $result = \array_merge_recursive($this->array, $array); |
|
| 2228 | } else { |
|
| 2229 | $result = \array_merge($this->array, $array); |
|
| 2230 | } |
|
| 2231 | ||
| 2232 | return static::create($result); |
|
| 2233 | } |
|
| 2234 | ||
| 2235 | /** |
|
| 2236 | * Merge the the current array into the $array. |
|
| @@ 2245-2254 (lines=10) @@ | ||
| 2242 | * |
|
| 2243 | * @return static <p>(Immutable)</p> |
|
| 2244 | */ |
|
| 2245 | public function mergePrependKeepIndex(array $array = array(), $recursive = false) |
|
| 2246 | { |
|
| 2247 | if (true === $recursive) { |
|
| 2248 | $result = \array_replace_recursive($array, $this->array); |
|
| 2249 | } else { |
|
| 2250 | $result = \array_replace($array, $this->array); |
|
| 2251 | } |
|
| 2252 | ||
| 2253 | return static::create($result); |
|
| 2254 | } |
|
| 2255 | ||
| 2256 | /** |
|
| 2257 | * Merge the current array into the new $array. |
|
| @@ 2267-2276 (lines=10) @@ | ||
| 2264 | * |
|
| 2265 | * @return static <p>(Immutable)</p> |
|
| 2266 | */ |
|
| 2267 | public function mergePrependNewIndex(array $array = array(), $recursive = false) |
|
| 2268 | { |
|
| 2269 | if (true === $recursive) { |
|
| 2270 | $result = \array_merge_recursive($array, $this->array); |
|
| 2271 | } else { |
|
| 2272 | $result = \array_merge($array, $this->array); |
|
| 2273 | } |
|
| 2274 | ||
| 2275 | return static::create($result); |
|
| 2276 | } |
|
| 2277 | ||
| 2278 | /** |
|
| 2279 | * Get the min value from an array. |
|