private function setPath($path)
    {
        if ('' === $path) {
            $this->path = $path;

            return;
        }
        if (
            false !== filter_var('http://example.com'.$path, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)
            && '/' === $path{0}
        ) {
            $this->path = $path;
        } else {
            throw new \InvalidArgumentException("Invalid path");
        }
    }
private function setPath($path)
    {
        if ('' === $path) {
            $this->path = $path;

            return;
        }
        if (
            false !== filter_var('http://example.com'.$path, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)
            && '/' === $path{0}
        ) {
            $this->path = $path;
        } else {
            throw new \InvalidArgumentException("Invalid path");
        }
    }
@param string $path

@throws \InvalidArgumentException