public function officialAccount(string $appId, string $refreshToken = null, AccessToken $accessToken = null): OfficialAccount
    {
        $application = new OfficialAccount($this->getAuthorizerConfig($appId, $refreshToken), $this->getReplaceServices($accessToken) + [
            'encryptor' => $this['encryptor'],

            'account' => function ($app) {
                return new AccountClient($app, $this);
            },
        ]);

        $application->extend('oauth', function ($socialite) {
            /* @var \Overtrue\Socialite\Providers\WeChatProvider $socialite */
            return $socialite->component(new ComponentDelegate($this));
        });

        return $application;
    }
public function officialAccount(string $appId, string $refreshToken = null, AccessToken $accessToken = null): OfficialAccount
    {
        $application = new OfficialAccount($this->getAuthorizerConfig($appId, $refreshToken), $this->getReplaceServices($accessToken) + [
            'encryptor' => $this['encryptor'],

            'account' => function ($app) {
                return new AccountClient($app, $this);
            },
        ]);

        $application->extend('oauth', function ($socialite) {
            /* @var \Overtrue\Socialite\Providers\WeChatProvider $socialite */
            return $socialite->component(new ComponentDelegate($this));
        });

        return $application;
    }
public function officialAccount ( string $ appId , string $ refreshToken = null , AccessToken $ accessToken = null ) : OfficialAccount { $ application = new OfficialAccount ( $ this -> getAuthorizerConfig ( $ appId , $ refreshToken ) , $ this -> getReplaceServices ( $ accessToken ) + [ 'encryptor' => $ this [ 'encryptor' ] , 'account' => function ( $ app ) { return new AccountClient ( $ app , $ this ) ; } , ] ) ; $ application -> extend ( 'oauth' , function ( $ socialite ) { /* @var \Overtrue\Socialite\Providers\WeChatProvider $socialite */ return $ socialite -> component ( new ComponentDelegate ( $ this ) ) ; } ) ; return $ application ; }
Creates the officialAccount application.

@param string                                                    $appId
@param string|null                                               $refreshToken
@param \EasyWeChat\OpenPlatform\Authorizer\Auth\AccessToken|null $accessToken

@return \EasyWeChat\OpenPlatform\Authorizer\OfficialAccount\Application
Creates the officialAccount application .