/** * Set a given configuration value. * * @param array|string $key * @param mixed $value */ public function set($key, $value = null) { if (is_array($key)) { foreach ($key as $innerKey => $innerValue) { Arr::set($this->items, $innerKey, $innerValue); } } else { Arr::set($this->items, $key, $value); } }
/** * Get the Rackspace Cloud Files container. * * @param \OpenCloud\Rackspace $client * @param array $config * * @return \OpenCloud\ObjectStore\Resource\Container */ protected function getRackspaceContainer(Rackspace $client, array $config) { $urlType = Arr::get($config, 'url_type'); $store = $client->objectStoreService('cloudFiles', $config['region'], $urlType); return $store->getContainer($config['container']); }
/** * Pulls 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); }
/** * Get all of the input except for a specified array of items. * * @param array|mixed $keys * * @return array */ public function except($keys) { $keys = is_array($keys) ? $keys : func_get_args(); $results = $this->all(); Arr::forget($results, $keys); return $results; }