src/Common/ValidateAuthentication.php
public static function token(Request $request)
    {
        $authorization = $request->getHeader('Authorization');

        if (!isset($authorization[0])) {
            throw new HeaderWithoutAuthorizationException('The request does not contain the Authorization header');
        }

        $token = preg_replace('/^\w+\s/', '', $authorization[0]);

        return Authenticator::decodeToken($token);
    }
public static function token(Request $request)
    {
        $authorization = $request->getHeader('Authorization');

        if (!isset($authorization[0])) {
            throw new HeaderWithoutAuthorizationException('The request does not contain the Authorization header');
        }

        $token = preg_replace('/^\w+\s/', '', $authorization[0]);

        return Authenticator::decodeToken($token);
    }
public static function token ( Request $ request ) { $ authorization = $ request -> getHeader ( 'Authorization' ) ; if ( ! isset ( $ authorization [ 0 ] ) ) { throw new HeaderWithoutAuthorizationException ( 'The request does not contain the Authorization header' ) ; } $ token = preg_replace ( '/^\w+\s/' , '' , $ authorization [ 0 ] ) ; return Authenticator :: decodeToken ( $ token ) ; }
Returns the data of token passed on Request
@author Edson B S Monteiro <bruno.monteirodg@gmail.com>
@since 1.0
@param Request $request
@return \stdClass
@throws HeaderWithoutAuthorizationException
Returns the data of token passed on Request