public function getToken()
    {
        $auth = $this->request->getHeader('Authorization');

        if (!$auth) {
            return null;
        }

        if ('bearer ' !== strtolower(substr($auth, 0, 7))) {
            return null;
        }

        return substr($auth, 7);
    }
public function getToken()
    {
        $auth = $this->request->getHeader('Authorization');

        if (!$auth) {
            return null;
        }

        if ('bearer ' !== strtolower(substr($auth, 0, 7))) {
            return null;
        }

        return substr($auth, 7);
    }
public function getToken ( ) { $ auth = $ this -> request -> getHeader ( 'Authorization' ) ; if ( ! $ auth ) { return null ; } if ( 'bearer ' !== strtolower ( substr ( $ auth , 0 , 7 ) ) ) { return null ; } return substr ( $ auth , 7 ) ; }
This method returns a string with an access token.

If no token was found, this method returns null.

@return null|string
This method returns a string with an access token .