public static function addProtocolToUrl($url, $protocol = 'http')
    {
        $pattern = sprintf('/^%s.*/', $protocol);

        if ((bool)preg_match($pattern, $url)) {
            return $url;
        }

        return sprintf('%s://%s', $protocol, $url);
    }