Code Duplication    Length = 9-11 lines in 4 locations

src/OpenPlatform/Components/Authorizer.php 4 locations

@@ 80-89 (lines=10) @@
77
     *
78
     * @return \EasyWeChat\Support\Collection
79
     */
80
    public function getAuthorizationToken($appId, $refreshToken)
81
    {
82
        $data = [
83
            'component_appid' => $this->getComponentAppId(),
84
            'authorizer_appid' => $appId,
85
            'authorizer_refresh_token' => $refreshToken
86
        ];
87
88
        return $this->parseJSON('json', [self::AUTHORIZATION_TOKEN, $data]);
89
    }
90
91
    /**
92
     * Get authorizer info.
@@ 98-106 (lines=9) @@
95
     *
96
     * @return \EasyWeChat\Support\Collection
97
     */
98
    public function getAuthorizerInfo($authorizerAppId)
99
    {
100
        $data = [
101
            'component_appid' => $this->getComponentAppId(),
102
            'authorizer_appid' => $authorizerAppId,
103
        ];
104
105
        return $this->parseJSON('json', [self::GET_AUTHORIZER_INFO, $data]);
106
    }
107
108
    /**
109
     * Get options.
@@ 116-125 (lines=10) @@
113
     *
114
     * @return \EasyWeChat\Support\Collection
115
     */
116
    public function getAuthorizerOption($authorizerAppId, $optionName)
117
    {
118
        $data = [
119
            'component_appid' => $this->getComponentAppId(),
120
            'authorizer_appid' => $authorizerAppId,
121
            'option_name' => $optionName
122
        ];
123
124
        return $this->parseJSON('json', [self::GET_AUTHORIZER_OPTION, $data]);
125
    }
126
127
    /**
128
     * Set authorizer option.
@@ 136-146 (lines=11) @@
133
     *
134
     * @return \EasyWeChat\Support\Collection
135
     */
136
    public function setAuthorizerOption($authorizerAppId, $optionName, $optionValue)
137
    {
138
        $data = [
139
            'component_appid' => $this->getComponentAppId(),
140
            'authorizer_appid' => $authorizerAppId,
141
            'option_name' => $optionName,
142
            'option_value' => $optionValue
143
        ];
144
145
        return $this->parseJSON('json', [self::SET_AUTHORIZER_OPTION, $data]);
146
    }
147
148
    /**
149
     * Get component appId.