public function setDriver(\BearFramework\App\ICacheDriver $driver): self
    {
        if ($this->driver !== null) {
            throw new \Exception('A cache driver is already set!');
        }
        $this->driver = $driver;
        return $this;
    }
public function setDriver(\BearFramework\App\ICacheDriver $driver): self
    {
        if ($this->driver !== null) {
            throw new \Exception('A cache driver is already set!');
        }
        $this->driver = $driver;
        return $this;
    }
public function setDriver ( \ BearFramework \ App \ ICacheDriver $ driver ) : self { if ( $ this -> driver !== null ) { throw new \ Exception ( 'A cache driver is already set!' ) ; } $ this -> driver = $ driver ; return $ this ; }
Sets a new cache driver.

@param \BearFramework\App\ICacheDriver $driver The driver to use for cache storage.
@return self Returns a reference to itself.
@throws \Exception
Sets a new cache driver .