original_string: public function setDir($dir)
      {
          if (!is_dir($dir) && !@mkdir($dir, 0755, true)) {
              $message = sprintf('Failed to create directory "%s"', $dir);
              ($e = error_get_last()) && $message .= ': ' . $e['message'];
              throw new \RuntimeException($message);
          }
          $this->dir = realpath($dir);
          return $this;
      }
code: public function setDir($dir)
      {
          if (!is_dir($dir) && !@mkdir($dir, 0755, true)) {
              $message = sprintf('Failed to create directory "%s"', $dir);
              ($e = error_get_last()) && $message .= ': ' . $e['message'];
              throw new \RuntimeException($message);
          }
          $this->dir = realpath($dir);
          return $this;
      }
code_tokens: public function setDir ( $ dir ) { if ( ! is_dir ( $ dir ) && ! @ mkdir ( $ dir , 0755 , true ) ) { $ message = sprintf ( 'Failed to create directory "%s"' , $ dir ) ; ( $ e = error_get_last ( ) ) && $ message .= ': ' . $ e [ 'message' ] ; throw new \ RuntimeException ( $ message ) ; } $ this -> dir = realpath ( $ dir ) ; return $ this ; }
docstring: Set the cache directory
  
  @param string $dir
  @return $this
  @throws \RuntimeException When failed to create the cache directory
docstring_tokens: Set the cache directory