Return Storage Object.

@throws InvalidArgumentException If required driver is not supported

@return mixed
484628
protected function returnStorageObject()
    {
        $driver = $this->driver;
        $options = $this->options;

        if (isset($this->supportedDriver[$driver])) {
            $class = $this->supportedDriver[$driver];

            return new $class($options);
        }

        throw new InvalidArgumentException("[{$driver}] not supported.");
    }
1166419
public function getCache()
    {
        $data = apc_fetch($this->config['key_prefix'] . '.storage');
        $this->isCached = !empty($data);

        return $data;
    }
1368945
public function get($name)
    {
        if (!isset($this->storages[$name])) {
            throw new InvalidArgumentException("Storage $name not found.");
        }

        return $this->storages[$name];
    }
624476
public function getServer()
    {
        if(!$this->has('server')) {
            $storages = [];

            if($this->useJwtToken)
            {
                if(!array_key_exists('access_token', $this->storageMap) || !array_key_exists('public_key', $this->storageMap)) {
                        throw new \yii\base\InvalidConfigException('access_token and public_key must be set or set useJwtToken to false');
                }
                //define dependencies when JWT is used instead of normal token
                \Yii::$container->clear('public_key'); //remove old definition
                \Yii::$container->set('public_key', $this->storageMap['public_key']);
                \Yii::$container->set('OAuth2\Storage\PublicKeyInterface', $this->storageMap['public_key']);

                \Yii::$container->clear('access_token'); //remove old definition
                \Yii::$container->set('access_token', $this->storageMap['access_token']);
            }

            foreach(array_keys($this->storageMap) as $name) {
                $storages[$name] = \Yii::$container->get($name);
            }

            $grantTypes = [];
            foreach($this->grantTypes as $name => $options) {
                if(!isset($storages[$name]) || empty($options['class'])) {
                    throw new \yii\base\InvalidConfigException('Invalid grant types configuration.');
                }

                $class = $options['class'];
                unset($options['class']);

                $reflection = new \ReflectionClass($class);
                $config = array_merge([0 => $storages[$name]], [$options]);

                $instance = $reflection->newInstanceArgs($config);
                $grantTypes[$name] = $instance;
            }


            $server = \Yii::$container->get(Server::className(), [
                $this,
                $storages,
                array_merge([
                    'use_jwt_access_tokens' => $this->useJwtToken,//ADDED
                    'token_param_name' => $this->tokenParamName,
                    'access_lifetime' => $this->tokenAccessLifetime,
                    'require_exact_redirect_uri' => false
                    /** add more ... */
                ], $this->options),
                $grantTypes
            ]);

            $this->set('server', $server);
        }
        return $this->get('server');
    }
306214
public function getStoragePlugins()
    {
        if (null === $this->storagePlugins) {
            $this->setStoragePlugins(new Storage\PluginManager());
        }
        return $this->storagePlugins;
    }
194588
public function getStorage()
    {
        if ($this->hasToken()) {
            return $this->temporaryStorage->setToken($this->getToken());
        }

        return $this->storage;
    }
703847
public function storage(StorageInterface $storage = null)
    {
        if ($storage !== null) {
            $this->_storage = $storage;

            return null;
        }

        if ($this->_storage) {
            return $this->_storage;
        }

        $config = $this->_config['storage'];
        if (is_string($config)) {
            $class = $config;
            $config = [];
        } else {
            $class = $config['className'];
            unset($config['className']);
        }
        $className = App::className($class, 'Auth/Storage', 'Storage');
        if (!class_exists($className)) {
            throw new Exception(sprintf('Auth storage adapter "%s" was not found.', $class));
        }
        $request = $this->getController()->getRequest();
        $response = $this->getController()->getResponse();
        $this->_storage = new $className($request, $response, $config);

        return $this->_storage;
    }
79383
public function getFileSystem()
    {
        if (! $this->storage) {
            $this->storage = $this->getServiceLocator()->get(PortableElementFileStorage::SERVICE_ID);
            $this->storage->setServiceLocator($this->getServiceLocator());
            $this->storage->setModel($this->getModel());
        }
        return $this->storage;
    }
764226
public function getStorage(): ?Filesystem
    {
        if (!$this->hasStorage()) {
            $this->setStorage($this->getDefaultStorage());
        }
        return $this->storage;
    }
456577
public function getStorageLocation()
    {
        if ($this->storageLocation === null) {
            $orm = $this->app['database/orm']->entityManager();
            /* @var \Doctrine\ORM\EntityManagerInterface $orm */
            $storageLocation = $orm->getRepository(StorageLocation::class)->findOneBy(['fslIsDefault' => true]);

            if ($storageLocation) {
                $this->storageLocation = $storageLocation;
            }
        }

        return $this->storageLocation;
    }
1350108
public function build(): GetDOMStorageItemsRequest
	{
		$instance = new GetDOMStorageItemsRequest();
		if ($this->storageId === null) {
			throw new BuilderException('Property [storageId] is required.');
		}
		$instance->storageId = $this->storageId;
		return $instance;
	}
434677
public function getDriver()
    {
        // if driver status is false, we return the BlackHole driver
        if (!$this->getStatus()) {
            if (is_null(self::$nullDriver)) {
                self::$nullDriver = new Storage\BlackHole();
            }

            return self::$nullDriver;
        }

        return $this->driver;
    }
1021894
public function storage($name = null)
	{
		$name = $name ?: $this->getDefaultDriver();

		return $this->stores[$name] = (isset($this->stores[$name]) ? $this->stores[$name] : $this->resolve($name));
	}
412225
protected static function storage()
    {
        if (self::$storage) {
            return self::$storage;
        }
        $className = self::getStorageClassName();
        if (!class_exists($className)) {
            throw new LaravelSmsException("Generate storage failed, the class [$className] does not exists.");
        }
        $store = new $className();
        if (!($store instanceof Storage)) {
            throw new LaravelSmsException("Generate storage failed, the class [$className] does not implement the interface [Toplan\\Sms\\Storage].");
        }

        return self::$storage = $store;
    }
678861
public function getFilePathHeader() {
        if($this->filePathHeader === null){
            throw new InvalidArgumentException(sprintf("The filePathContent must be setter."));
        }
        $path = $this->filePathHeader;
        if($this->container){
            $path = $this->container->get("kernel")->locateResource($path);
        }
        if(!$this->chainModel->getExporterManager()->getFs()->exists($path)){
            throw new InvalidArgumentException(sprintf("The filePathHeader '%s' does not exist.",$path));
        }
        return $path;
    }
1021008
protected function getImageUrlOrDefault()
    {
        $imagePath = $this->entity->path;

        if (!Storage::exists($imagePath)) {
            $imagePath = $this->imgNotFound();
        }

        return Storage::url($imagePath);
    }
54868
public function load()
    {
        $this->_checkAdapter();

        if (!class_exists($this->getClass())) {
            throw new InvalidArgumentException(
                "The loader class '{$this->getClass()}' is not defined."
            );
        }

        $reflexion = new ReflectionClass($this->getClass());

        /** @var LoaderInterface $loader */
        $args = [['adapter' => $this->_adapter]];
        $loader = $reflexion->newInstanceArgs($args);

        $className = '\Slick\Database\Schema\LoaderInterface';

        if (!($loader instanceof LoaderInterface)) {
            throw new InvalidArgumentException(
                "The loader class '{$this->getClass()}' does not " .
                "implement {$className}."
            );
        }
        return $loader->getSchema();
    }