public static function getUsername(UriInterface $uri): string
    {
        $userInfo = explode(':', $uri->getUserInfo());
        return (isset($userInfo[0]) ? $userInfo[0] : '');
    }
public static function getUsername(UriInterface $uri): string
    {
        $userInfo = explode(':', $uri->getUserInfo());
        return (isset($userInfo[0]) ? $userInfo[0] : '');
    }
public static function getUsername ( UriInterface $ uri ) : string { $ userInfo = explode ( ':' , $ uri -> getUserInfo ( ) ) ; return ( isset ( $ userInfo [ 0 ] ) ? $ userInfo [ 0 ] : '' ) ; }
Get the username component of the given Uri

@param UriInterface $uri
@return string If the URI had no username an empty string is returned.
Get the username component of the given Uri