Code Duplication    Length = 10-11 lines in 2 locations

src/Api.php 1 location

@@ 43-52 (lines=10) @@
40
     * @param string $apiurl           微信接口地址 APIURL
41
     * @param string $cacheDriver      缓存驱动 Redis File ThinkPHP ......
42
     */
43
    public static function init($appid, $appsecret, $originalid = '', $token, $encoding_aes_key, $apiurl = 'https://api.weixin.qq.com/', $cacheDriver = 'File')
44
    {
45
        self::$API_URL          = $apiurl ? $apiurl : 'https://api.weixin.qq.com/';
46
        self::$APP_ID           = $appid;
47
        self::$APP_SECRET       = $appsecret;
48
        self::$ORIGINAL_ID      = $originalid;
49
        self::$TOKEN            = $token;
50
        self::$ENCODING_AES_KEY = $encoding_aes_key;
51
        self::$CACHE_DRIVER     = $cacheDriver;
52
    }
53
54
    /**
55
     * 工厂+多例模式 获取接口实例.

src/ComponentApi.php 1 location

@@ 42-52 (lines=11) @@
39
     * @param string $apiurl
40
     * @param string $cacheDriver
41
     */
42
    public static function init($appid, $component_appid, $component_appsecret, $component_token, $encoding_aes_key, $authorizer_access_token, $apiurl = 'https://api.weixin.qq.com/', $cacheDriver = 'File')
43
    {
44
        self::$APP_ID                     = $appid;
45
        self::$COMPONENT_APPID            = $component_appid;
46
        self::$COMPONENT_APPSECRET        = $component_appsecret;
47
        self::$COMPONENT_TOKEN            = $component_token;
48
        self::$COMPONENT_ENCODING_AES_KEY = $encoding_aes_key;
49
        self::$AUTHORIZER_ACCESS_TOKEN    = $authorizer_access_token;
50
        self::$CACHE_DRIVER               = $cacheDriver;
51
        self::$API_URL                    = $apiurl;
52
    }
53
54
    /**
55
     * 获取授权服务号的token