private static function isValidAuthUser(?string $userinfo): bool
    {
        if ($userinfo === null) {
            return true;
        }

        // http://tools.ietf.org/html/rfc3986#section-3.2.1
        // userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
        $pattern = sprintf(
            '/\A(?:[%s%s:]|(?:%s))*\z/i',
            'a-z0-9\-._~',
            '!$&\'()*+,;=',
            '%[a-f0-9]{2}'
        );

        return !!preg_match($pattern, $userinfo);
    }
private static function isValidAuthUser(?string $userinfo): bool
    {
        if ($userinfo === null) {
            return true;
        }

        // http://tools.ietf.org/html/rfc3986#section-3.2.1
        // userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
        $pattern = sprintf(
            '/\A(?:[%s%s:]|(?:%s))*\z/i',
            'a-z0-9\-._~',
            '!$&\'()*+,;=',
            '%[a-f0-9]{2}'
        );

        return !!preg_match($pattern, $userinfo);
    }
private static function isValidAuthUser ( ? string $ userinfo ) : bool { if ( $ userinfo === null ) { return true ; } // http://tools.ietf.org/html/rfc3986#section-3.2.1 // userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) $ pattern = sprintf ( '/\A(?:[%s%s:]|(?:%s))*\z/i' , 'a-z0-9\-._~' , '!$&\'()*+,;=' , '%[a-f0-9]{2}' ) ; return ! ! preg_match ( $ pattern , $ userinfo ) ; }
Checks if authority userinfo is valid

@param string|null $userinfo The userinfo

@return bool
Checks if authority userinfo is valid