protected function getToken(HTTPRequest $request): ?string
    {
        if ($authHeader = $request->getHeader('Authorization')) {
            if (stripos($authHeader, 'Bearer ') === 0) {
                return substr($authHeader, 6);
            }
        }

        return null;
    }
protected function getToken(HTTPRequest $request): ?string
    {
        if ($authHeader = $request->getHeader('Authorization')) {
            if (stripos($authHeader, 'Bearer ') === 0) {
                return substr($authHeader, 6);
            }
        }

        return null;
    }
protected function getToken ( HTTPRequest $ request ) : ? string { if ( $ authHeader = $ request -> getHeader ( 'Authorization' ) ) { if ( stripos ( $ authHeader , 'Bearer ' ) === 0 ) { return substr ( $ authHeader , 6 ) ; } } return null ; }
Extract the token from the authorization header.

@param HTTPRequest $request The request container the token.

@return null|string
Extract the token from the authorization header .