Code Duplication    Length = 8-11 lines in 8 locations

src/User/Group.php 3 locations

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

src/User/Tag.php 1 location

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

src/Device/Device.php 2 locations

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

src/ShakeAround/Group.php 2 locations

@@ 46-53 (lines=8) @@
43
     *
44
     * @return \EasyWeChat\Support\Collection
45
     */
46
    public function add($name)
47
    {
48
        $params = [
49
            'group_name' => $name,
50
        ];
51
52
        return $this->parseJSON('json', [self::API_ADD, $params]);
53
    }
54
55
    /**
56
     * Update a device group name.
@@ 63-71 (lines=9) @@
60
     *
61
     * @return \EasyWeChat\Support\Collection
62
     */
63
    public function update($groupId, $name)
64
    {
65
        $params = [
66
            'group_id' => intval($groupId),
67
            'group_name' => $name,
68
        ];
69
70
        return $this->parseJSON('json', [self::API_UPDATE, $params]);
71
    }
72
73
    /**
74
     * Delete device group.