src/Mvc/Listener/Limit/LimitStrategy.php
public function setStorage($storage)
    {
        if (is_string($storage)) {
            $storage = $this->getStoragePlugins()->get($storage);
        } elseif (is_array($storage)) {
            if (!isset($storage['name'])) {
                throw new \Exception('Invalid Storage configuration: Name required.');
            }
            $storage = $this->getStoragePlugins()->get($storage['name'], $storage);
        }
        
        if (!$storage instanceof Storage\StorageInterface) {
            throw new \Exception('Storage must be instance of Spork\Mvc\Listener\Limit\Storage\StorageInterface');
        }
        
        $this->storage = $storage;
        return $this;
    }
public function setStorage($storage)
    {
        if (is_string($storage)) {
            $storage = $this->getStoragePlugins()->get($storage);
        } elseif (is_array($storage)) {
            if (!isset($storage['name'])) {
                throw new \Exception('Invalid Storage configuration: Name required.');
            }
            $storage = $this->getStoragePlugins()->get($storage['name'], $storage);
        }
        
        if (!$storage instanceof Storage\StorageInterface) {
            throw new \Exception('Storage must be instance of Spork\Mvc\Listener\Limit\Storage\StorageInterface');
        }
        
        $this->storage = $storage;
        return $this;
    }
public function setStorage ( $ storage ) { if ( is_string ( $ storage ) ) { $ storage = $ this -> getStoragePlugins ( ) -> get ( $ storage ) ; } elseif ( is_array ( $ storage ) ) { if ( ! isset ( $ storage [ 'name' ] ) ) { throw new \ Exception ( 'Invalid Storage configuration: Name required.' ) ; } $ storage = $ this -> getStoragePlugins ( ) -> get ( $ storage [ 'name' ] , $ storage ) ; } if ( ! $ storage instanceof Storage \ StorageInterface ) { throw new \ Exception ( 'Storage must be instance of Spork\Mvc\Listener\Limit\Storage\StorageInterface' ) ; } $ this -> storage = $ storage ; return $ this ; }
Set storage instance

@param StorageInterface|string|array $storage
@return \Spork\Mvc\Listener\Limit\LimitStrategy
@throws \Exception on invalid type
Set storage instance