Code Duplication    Length = 9-9 lines in 4 locations

src/Channel.php 2 locations

@@ 196-204 (lines=9) @@
193
     *
194
     * @return \React\Promise\PromiseInterface
195
     */
196
    public function inviteUser(User $user)
197
    {
198
        return $this->client->apiCall('channels.invite', [
199
            'channel' => $this->getId(),
200
            'user' => $user->getId(),
201
        ])->then(function () use ($user) {
202
            $this->data['members'][] = $user->getId();
203
        });
204
    }
205
206
    /**
207
     * Kicks a user from the channel.
@@ 213-221 (lines=9) @@
210
     *
211
     * @return \React\Promise\PromiseInterface
212
     */
213
    public function kickUser(User $user)
214
    {
215
        return $this->client->apiCall('channels.kick', [
216
            'channel' => $this->getId(),
217
            'user' => $user->getId(),
218
        ])->then(function () use ($user) {
219
            unset($this->data['members'][$user->getId()]);
220
        });
221
    }
222
223
    /**
224
     * {@inheritDoc}

src/Group.php 2 locations

@@ 98-106 (lines=9) @@
95
     *
96
     * @return \React\Promise\PromiseInterface
97
     */
98
    public function inviteUser(User $user)
99
    {
100
        return $this->client->apiCall('groups.invite', [
101
            'channel' => $this->getId(),
102
            'user' => $user->getId(),
103
        ])->then(function () use ($user) {
104
            $this->data['members'][] = $user->getId();
105
        });
106
    }
107
108
    /**
109
     * Kicks a user from the group.
@@ 115-123 (lines=9) @@
112
     *
113
     * @return \React\Promise\PromiseInterface
114
     */
115
    public function kickUser(User $user)
116
    {
117
        return $this->client->apiCall('groups.kick', [
118
            'channel' => $this->getId(),
119
            'user' => $user->getId(),
120
        ])->then(function () use ($user) {
121
            unset($this->data['members'][$user->getId()]);
122
        });
123
    }
124
125
    /**
126
     * Opens the group.