original_string: public function setDriver($driver)
      {
          $class = $this->wei->getClass($driver);
  
          if (!class_exists($class)) {
              throw new \InvalidArgumentException(sprintf('Cache driver class "%s" not found', $class));
          }
  
          if (!is_subclass_of($class, 'Wei\BaseCache')) {
              throw new \InvalidArgumentException(sprintf('Cache driver class "%s" must extend "Wei\BaseCache"', $class));
          }
  
          $this->driver = $driver;
          $this->object = $this->wei->get($driver);
          return $this;
      }
code: public function setDriver($driver)
      {
          $class = $this->wei->getClass($driver);
  
          if (!class_exists($class)) {
              throw new \InvalidArgumentException(sprintf('Cache driver class "%s" not found', $class));
          }
  
          if (!is_subclass_of($class, 'Wei\BaseCache')) {
              throw new \InvalidArgumentException(sprintf('Cache driver class "%s" must extend "Wei\BaseCache"', $class));
          }
  
          $this->driver = $driver;
          $this->object = $this->wei->get($driver);
          return $this;
      }
code_tokens: public function setDriver ( $ driver ) { $ class = $ this -> wei -> getClass ( $ driver ) ; if ( ! class_exists ( $ class ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Cache driver class "%s" not found' , $ class ) ) ; } if ( ! is_subclass_of ( $ class , 'Wei\BaseCache' ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Cache driver class "%s" must extend "Wei\BaseCache"' , $ class ) ) ; } $ this -> driver = $ driver ; $ this -> object = $ this -> wei -> get ( $ driver ) ; return $ this ; }
docstring: Set cache driver
  
  @param string $driver
  @return $this
  @throws \InvalidArgumentException
docstring_tokens: Set cache driver