Code Duplication    Length = 8-9 lines in 4 locations

src/Device/Device.php 4 locations

@@ 159-167 (lines=9) @@
156
        return $this->parseJSON('json', [self::API_DEV_UNBIND, $params]);
157
    }
158
159
    public function compelBind($openId, $deviceId)
160
    {
161
        $params = [
162
            'device_id' => $deviceId,
163
            'openid' => $openId
164
        ];
165
166
        return $this->parseJSON('json', [self::API_DEV_COMPEL_BIND, $params]);
167
    }
168
169
    public function compelUnbind($openId, $deviceId)
170
    {
@@ 169-177 (lines=9) @@
166
        return $this->parseJSON('json', [self::API_DEV_COMPEL_BIND, $params]);
167
    }
168
169
    public function compelUnbind($openId, $deviceId)
170
    {
171
        $params = [
172
            'device_id' => $deviceId,
173
            'openid' => $openId
174
        ];
175
176
        return $this->parseJSON('json', [self::API_DEV_COMPEL_UNBIND, $params]);
177
    }
178
179
    public function getDeviceStatus($deviceId)
180
    {
@@ 179-186 (lines=8) @@
176
        return $this->parseJSON('json', [self::API_DEV_COMPEL_UNBIND, $params]);
177
    }
178
179
    public function getDeviceStatus($deviceId)
180
    {
181
        $params = [
182
            'device_id' => $deviceId
183
        ];
184
185
        return $this->parseJSON('get', [self::API_DEV_STAT, $params]);
186
    }
187
188
    public function verifyQrcode($ticket)
189
    {
@@ 197-205 (lines=9) @@
194
        return $this->parseJSON('post', [self::API_DEV_VERIFY_QRCODE, $params]);
195
    }
196
197
    public function getOpenid($deviceId)
198
    {
199
        $params = [
200
            'device_type' => $this->deviceType,
201
            'device_id' => $deviceId
202
        ];
203
204
        return $this->parseJSON('get', [self::API_DEV_GET_OPENID, $params]);
205
    }
206
207
    public function getDeviceidByOpenid($openid)
208
    {