/** * Assign high numeric IDs to a config item to force appending. * * @param array $array * @return array */ function append_config(array $array) { $start = 9999; foreach ($array as $key => $value) { if (is_numeric($key)) { $start++; $array[$start] = Arr::pull($array, $key); } } return $array; }
/** * Get a value from the array, and remove it. * * @param array $array * @param string $key * @param mixed $default * @return mixed */ function array_pull(&$array, $key, $default = null) { return Arr::pull($array, $key, $default); }
/** * Get and remove an item from the collection. * * @param mixed $key * @param mixed $default * @return mixed */ public function pull($key, $default = null) { return Arr::pull($this->items, $key, $default); }
/** * Removes a value from array. * * @param string $key * @param mixed $value * @return self */ public function pull($key, $value) { $values = $this->get($key); Arr::pull($values, $value); return $this->set($key, $values); }