lib/Imgur/Auth/OAuth2.php
public function setAccessToken($token)
    {
        if (!\is_array($token)) {
            throw new AuthException('Token is not a valid json string.');
        }

        if (isset($token['data']['access_token'])) {
            $token = $token['data'];
        }

        if (!isset($token['access_token'])) {
            throw new AuthException('Access token could not be retrieved from the decoded json response.');
        }

        $this->token = $token;

        $this->sign();
    }
public function setAccessToken($token)
    {
        if (!\is_array($token)) {
            throw new AuthException('Token is not a valid json string.');
        }

        if (isset($token['data']['access_token'])) {
            $token = $token['data'];
        }

        if (!isset($token['access_token'])) {
            throw new AuthException('Access token could not be retrieved from the decoded json response.');
        }

        $this->token = $token;

        $this->sign();
    }
public function setAccessToken ( $ token ) { if ( ! \ is_array ( $ token ) ) { throw new AuthException ( 'Token is not a valid json string.' ) ; } if ( isset ( $ token [ 'data' ] [ 'access_token' ] ) ) { $ token = $ token [ 'data' ] ; } if ( ! isset ( $ token [ 'access_token' ] ) ) { throw new AuthException ( 'Access token could not be retrieved from the decoded json response.' ) ; } $ this -> token = $ token ; $ this -> sign ( ) ; }
Stores the access token, refresh token and expiration date.

@param array $token

@throws AuthException

@return array
Stores the access token refresh token and expiration date .