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;
    }