public function withAccessToken (AccessToken $token)
    {
        $config = $this->getConfig();
        $this->configureHandlers($config['handler']);
        
        $config['wechat.accessToken'] = $token;
        $config['wechat.developerMode'] = $this->developerMode;
        
        return new static($config);
    }
public function withAccessToken (AccessToken $token)
    {
        $config = $this->getConfig();
        $this->configureHandlers($config['handler']);
        
        $config['wechat.accessToken'] = $token;
        $config['wechat.developerMode'] = $this->developerMode;
        
        return new static($config);
    }
public function withAccessToken ( AccessToken $ token ) { $ config = $ this -> getConfig ( ) ; $ this -> configureHandlers ( $ config [ 'handler' ] ) ; $ config [ 'wechat.accessToken' ] = $ token ; $ config [ 'wechat.developerMode' ] = $ this -> developerMode ; return new static ( $ config ) ; }
Sets the access token to be used, and returns the cloned client with the token being used.

@param AccessToken $token

@return Client
Sets the access token to be used and returns the cloned client with the token being used .