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;
    }
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;
    }
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 ; }
Validate a directory path.

@param string $path

@return string
Validate a directory path .