/** * Compile Blade statements that start with "@". * * @param string $value * @return mixed */ protected function compileStatements($value) { $callback = function ($match) { if (method_exists($this, $method = 'compile' . ucfirst($match[1]))) { $match[0] = $this->{$method}(Arr::get(3, $match)); } elseif (isset($this->customDirectives[$match[1]])) { $match[0] = call_user_func($this->customDirectives[$match[1]], Arr::get(3, $match)); } return isset($match[3]) ? $match[0] : $match[0] . $match[2]; }; return preg_replace_callback('/\\B@(\\w+)([ \\t]*)(\\( ( (?>[^()]+) | (?3) )* \\))?/x', $callback, $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']); }