src/Connection/Connector.php
protected function loadToken()
    {
        if ($this->config['api_token'] && $this->config['api_token_type'] === 'access') {
            return new AccessToken([
                'access_token' => $this->config['api_token'],
                // Skip local expiry checking.
                'expires' => 2147483647,
            ]);
        }
        if (!$this->session->get($this->storageKeys['access_token'])) {
            return null;
        }

        // These keys are used for saving in the session for backwards
        // compatibility with the commerceguys/guzzle-oauth2-plugin package.
        $values = [];
        foreach ($this->storageKeys as $tokenKey => $sessionKey) {
            $value = $this->session->get($sessionKey);
            if ($value !== null) {
                $values[$tokenKey] = $value;
            }
        }

        return new AccessToken($values);
    }
protected function loadToken()
    {
        if ($this->config['api_token'] && $this->config['api_token_type'] === 'access') {
            return new AccessToken([
                'access_token' => $this->config['api_token'],
                // Skip local expiry checking.
                'expires' => 2147483647,
            ]);
        }
        if (!$this->session->get($this->storageKeys['access_token'])) {
            return null;
        }

        // These keys are used for saving in the session for backwards
        // compatibility with the commerceguys/guzzle-oauth2-plugin package.
        $values = [];
        foreach ($this->storageKeys as $tokenKey => $sessionKey) {
            $value = $this->session->get($sessionKey);
            if ($value !== null) {
                $values[$tokenKey] = $value;
            }
        }

        return new AccessToken($values);
    }
protected function loadToken ( ) { if ( $ this -> config [ 'api_token' ] && $ this -> config [ 'api_token_type' ] === 'access' ) { return new AccessToken ( [ 'access_token' => $ this -> config [ 'api_token' ] , // Skip local expiry checking. 'expires' => 2147483647 , ] ) ; } if ( ! $ this -> session -> get ( $ this -> storageKeys [ 'access_token' ] ) ) { return null ; } // These keys are used for saving in the session for backwards // compatibility with the commerceguys/guzzle-oauth2-plugin package. $ values = [ ] ; foreach ( $ this -> storageKeys as $ tokenKey => $ sessionKey ) { $ value = $ this -> session -> get ( $ sessionKey ) ; if ( $ value !== null ) { $ values [ $ tokenKey ] = $ value ; } } return new AccessToken ( $ values ) ; }
Load the current access token.

@return AccessToken|null
Load the current access token .