src/Factory/UriSchemeFactory.php
public static function retrieve(array $server = null)
    {
        if (empty($server)) {
            $server = $_SERVER;
        }

        $scheme = 'http';

        if (isset($server['HTTPS']) && 'off' != $server['HTTPS']) {
            $scheme = 'https';
        }

        return $scheme;
    }
public static function retrieve(array $server = null)
    {
        if (empty($server)) {
            $server = $_SERVER;
        }

        $scheme = 'http';

        if (isset($server['HTTPS']) && 'off' != $server['HTTPS']) {
            $scheme = 'https';
        }

        return $scheme;
    }
public static function retrieve ( array $ server = null ) { if ( empty ( $ server ) ) { $ server = $ _SERVER ; } $ scheme = 'http' ; if ( isset ( $ server [ 'HTTPS' ] ) && 'off' != $ server [ 'HTTPS' ] ) { $ scheme = 'https' ; } return $ scheme ; }
Retrieves the Uri scheme using incoming data, ignores a forced scheme.
If unable to retrieve the scheme, returns 'http'.

@param array $server Optional; null by default or empty array means
global $_SERVER. The source data

@return string Returns the Uri scheme if any, 'http' otherwise
Retrieves the Uri scheme using incoming data ignores a forced scheme . If unable to retrieve the scheme returns http .