Code Duplication    Length = 11-11 lines in 3 locations

lib/GitHub/Receiver/Issues/Labels.php 1 location

@@ 143-153 (lines=11) @@
140
     *
141
     * @return bool
142
     */
143
    public function removeIssueLabel(int $number, string $name): bool
144
    {
145
        $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels/:name',
146
            $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number, $name), Request::METHOD_DELETE);
147
148
        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
149
            return true;
150
        }
151
152
        return false;
153
    }
154
155
    /**
156
     * Replace all labels for an issue

lib/GitHub/Receiver/Organizations/Teams.php 2 locations

@@ 234-244 (lines=11) @@
231
     * @return bool|array
232
     * @throws \Exception
233
     */
234
    public function addTeamRepository(int $id)
235
    {
236
        $return = $this->getApi()->request($this->getApi()->sprintf('/teams/:id/repos/:org/:repo', (string)$id,
237
            $this->getOrganizations()->getOwner(), $this->getOrganizations()->getRepo()), Request::METHOD_PUT);
238
239
        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
240
            return true;
241
        }
242
243
        return $return;
244
    }
245
246
    /**
247
     * Remove team repository
@@ 256-266 (lines=11) @@
253
     * @return bool
254
     * @throws \Exception
255
     */
256
    public function removeTeamRepository(int $id): bool
257
    {
258
        $this->getApi()->request($this->getApi()->sprintf('/teams/:id/repos/:owner/:repo', (string)$id,
259
            $this->getOrganizations()->getOwner(), $this->getOrganizations()->getRepo()), Request::METHOD_DELETE);
260
261
        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
262
            return true;
263
        }
264
265
        return false;
266
    }
267
268
    /**
269
     * List user teams