private function assertValidUrl(string $url): void
    {
        if (!(filter_var($url, FILTER_VALIDATE_URL) || filter_var($url, FILTER_VALIDATE_IP))) {
            throw new RequestContextException("Failed to set invalid URL: $url");
        }
    }
private function assertValidUrl(string $url): void
    {
        if (!(filter_var($url, FILTER_VALIDATE_URL) || filter_var($url, FILTER_VALIDATE_IP))) {
            throw new RequestContextException("Failed to set invalid URL: $url");
        }
    }
private function assertValidUrl ( string $ url ) : void { if ( ! ( filter_var ( $ url , FILTER_VALIDATE_URL ) || filter_var ( $ url , FILTER_VALIDATE_IP ) ) ) { throw new RequestContextException ( "Failed to set invalid URL: $url" ) ; } }
Throw exception on invalid URL

@param string $url

@throws RequestContextException
Throw exception on invalid URL