Code Duplication    Length = 8-11 lines in 6 locations

src/User/Group.php 3 locations

@@ 45-52 (lines=8) @@
42
     *
43
     * @return int
44
     */
45
    public function create($name)
46
    {
47
        $params = [
48
                   'group' => ['name' => $name],
49
                  ];
50
51
        return $this->parseJSON('json', [self::API_CREATE, $params]);
52
    }
53
54
    /**
55
     * List all groups.
@@ 72-82 (lines=11) @@
69
     *
70
     * @return bool
71
     */
72
    public function update($groupId, $name)
73
    {
74
        $params = [
75
                   'group' => [
76
                               'id' => $groupId,
77
                               'name' => $name,
78
                              ],
79
                  ];
80
81
        return $this->parseJSON('json', [self::API_UPDATE, $params]);
82
    }
83
84
    /**
85
     * Delete group.
@@ 91-98 (lines=8) @@
88
     *
89
     * @return bool
90
     */
91
    public function delete($groupId)
92
    {
93
        $params = [
94
                   'group' => ['id' => $groupId],
95
                  ];
96
97
        return $this->parseJSON('json', [self::API_DELETE, $params]);
98
    }
99
100
    /**
101
     * Get user group.

src/User/Tag.php 1 location

@@ 46-53 (lines=8) @@
43
     *
44
     * @return int
45
     */
46
    public function create($name)
47
    {
48
        $params = [
49
                   'tag' => ['name' => $name],
50
                  ];
51
52
        return $this->parseJSON('json', [self::API_CREATE, $params]);
53
    }
54
55
    /**
56
     * List all tags.

src/Device/Device.php 2 locations

@@ 188-195 (lines=8) @@
185
        return $this->parseJSON('get', [self::API_DEV_STAT, $params]);
186
    }
187
188
    public function verifyQrcode($ticket)
189
    {
190
        $params = [
191
            'ticket' => $ticket
192
        ];
193
194
        return $this->parseJSON('post', [self::API_DEV_VERIFY_QRCODE, $params]);
195
    }
196
197
    public function getOpenid($deviceId)
198
    {
@@ 207-214 (lines=8) @@
204
        return $this->parseJSON('get', [self::API_DEV_GET_OPENID, $params]);
205
    }
206
207
    public function getDeviceidByOpenid($openid)
208
    {
209
        $params = [
210
            'openid' => $openid
211
        ];
212
213
        return $this->parseJSON('get', [self::API_USER_DEV_BIND, $params]);
214
    }
215
}
216