src/Url/UrlUtil.php
public function addURIScheme(string $url = '', string $protocol = 'http'): string
    {
        $scheme = $protocol.'://';

        if ('' !== $url && false === System::getContainer()->get('huh.utils.string')->startsWith($url, $protocol)) {
            $url = $scheme.$url;
        }

        return $url;
    }
public function addURIScheme(string $url = '', string $protocol = 'http'): string
    {
        $scheme = $protocol.'://';

        if ('' !== $url && false === System::getContainer()->get('huh.utils.string')->startsWith($url, $protocol)) {
            $url = $scheme.$url;
        }

        return $url;
    }
public function addURIScheme ( string $ url = '' , string $ protocol = 'http' ) : string { $ scheme = $ protocol . '://' ; if ( '' !== $ url && false === System :: getContainer ( ) -> get ( 'huh.utils.string' ) -> startsWith ( $ url , $ protocol ) ) { $ url = $ scheme . $ url ; } return $ url ; }
Add a url scheme to a given url.

@param string $url
@param string $protocol

@return string
Add a url scheme to a given url .