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

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