protected function parseUrl(string $url)
    {
        $url = trim($url, '/');

        // Proceed if the URL is still a valid URL
        if (filter_var($url, FILTER_VALIDATE_URL)) {
            // Return an URL with a '/' if is just a domain
            return preg_match('/(\.(?<tld>\w*))$/m', $url)
                ? $url . '/'
                : $url;
        }

        throw new InvalidUrlException($url);
    }
protected function parseUrl(string $url)
    {
        $url = trim($url, '/');

        // Proceed if the URL is still a valid URL
        if (filter_var($url, FILTER_VALIDATE_URL)) {
            // Return an URL with a '/' if is just a domain
            return preg_match('/(\.(?<tld>\w*))$/m', $url)
                ? $url . '/'
                : $url;
        }

        throw new InvalidUrlException($url);
    }
protected function parseUrl ( string $ url ) { $ url = trim ( $ url , '/' ) ; // Proceed if the URL is still a valid URL if ( filter_var ( $ url , FILTER_VALIDATE_URL ) ) { // Return an URL with a '/' if is just a domain return preg_match ( '/(\.(?<tld>\w*))$/m' , $ url ) ? $ url . '/' : $ url ; } throw new InvalidUrlException ( $ url ) ; }
Parses a string and appends a Webhook Secret.

@param string $url
@return string
@throws InvalidUrlException
Parses a string and appends a Webhook Secret .