original_string: public function directory($path)
      {
          $dir = $this->realPath($path);
          if (!is_dir($dir)) {
              throw new \InvalidArgumentException(sprintf('The path is not a directory: %s', $dir));
          }
  
          return $path;
      }
code: public function directory($path)
      {
          $dir = $this->realPath($path);
          if (!is_dir($dir)) {
              throw new \InvalidArgumentException(sprintf('The path is not a directory: %s', $dir));
          }
  
          return $path;
      }
code_tokens: public function directory ( $ path ) { $ dir = $ this -> realPath ( $ path ) ; if ( ! is_dir ( $ dir ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The path is not a directory: %s' , $ dir ) ) ; } return $ path ; }
docstring: Validate a directory path.
  
  @param string $path
  
  @return string
docstring_tokens: Validate a directory path .