Code Duplication    Length = 8-8 lines in 4 locations

src/Channel.php 2 locations

@@ 166-173 (lines=8) @@
163
     *
164
     * @return \React\Promise\PromiseInterface
165
     */
166
    public function archive()
167
    {
168
        return $this->client->apiCall('channels.archive', [
169
            'channel' => $this->getId(),
170
        ])->then(function () {
171
            $this->data['is_archived'] = true;
172
        });
173
    }
174
175
    /**
176
     * Un-archives the channel.
@@ 180-187 (lines=8) @@
177
     *
178
     * @return \React\Promise\PromiseInterface
179
     */
180
    public function unarchive()
181
    {
182
        return $this->client->apiCall('channels.unarchive', [
183
            'channel' => $this->getId(),
184
        ])->then(function () {
185
            $this->data['is_archived'] = false;
186
        });
187
    }
188
189
    /**
190
     * Invites a user to the channel.

src/Group.php 2 locations

@@ 68-75 (lines=8) @@
65
     *
66
     * @return \React\Promise\PromiseInterface
67
     */
68
    public function archive()
69
    {
70
        return $this->client->apiCall('groups.archive', [
71
            'channel' => $this->getId(),
72
        ])->then(function () {
73
            $this->data['is_archived'] = true;
74
        });
75
    }
76
77
    /**
78
     * Un-archives the group.
@@ 82-89 (lines=8) @@
79
     *
80
     * @return \React\Promise\PromiseInterface
81
     */
82
    public function unarchive()
83
    {
84
        return $this->client->apiCall('groups.unarchive', [
85
            'channel' => $this->getId(),
86
        ])->then(function () {
87
            $this->data['is_archived'] = false;
88
        });
89
    }
90
91
    /**
92
     * Invites a user to the group.