Code Duplication    Length = 9-11 lines in 4 locations

src/OpenPlatform/Components/Authorizer.php 4 locations

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