public function setAccessToken($token)
    {
        if ($token instanceof Token\TokenInterface) {
            $this->rawToken = $token;
        } else {
            $this->rawToken = is_array($token) ?
                $this->tokenFactory($token) :
                $this->tokenFactory(['access_token' => $token]);
        }

        if ($this->rawToken === null) {
            throw new Exception\OAuth2Exception("setAccessToken() takes a string, array or TokenInterface object");
        }

        return $this;
    }
public function setAccessToken($token)
    {
        if ($token instanceof Token\TokenInterface) {
            $this->rawToken = $token;
        } else {
            $this->rawToken = is_array($token) ?
                $this->tokenFactory($token) :
                $this->tokenFactory(['access_token' => $token]);
        }

        if ($this->rawToken === null) {
            throw new Exception\OAuth2Exception("setAccessToken() takes a string, array or TokenInterface object");
        }

        return $this;
    }
public function setAccessToken ( $ token ) { if ( $ token instanceof Token \ TokenInterface ) { $ this -> rawToken = $ token ; } else { $ this -> rawToken = is_array ( $ token ) ? $ this -> tokenFactory ( $ token ) : $ this -> tokenFactory ( [ 'access_token' => $ token ] ) ; } if ( $ this -> rawToken === null ) { throw new Exception \ OAuth2Exception ( "setAccessToken() takes a string, array or TokenInterface object" ) ; } return $ this ; }
Manually set the access token.

@param string|array|TokenInterface $token An array of token data, an access token string, or a TokenInterface object
Manually set the access token .