GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( cde5b2...a2c9c7 )
by VEBER
13s
created

Sni::updateOrCreateSni()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the KongAdminApi package.
5
 *
6
 * (c) Unikorp <https://github.com/unikorp>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Unikorp\KongAdminApi\Node;
13
14
use Psr\Http\Message\ResponseInterface;
15
use Unikorp\KongAdminApi\AbstractNode;
16
use Unikorp\KongAdminApi\Document\Sni as Document;
17
18
/**
19
 * sni
20
 *
21
 * @author VEBER Arnaud <https://github.com/VEBERArnaud>
22
 */
23 View Code Duplication
class Sni extends AbstractNode
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
24
{
25
    /**
26
     * add sni
27
     *
28
     * @param \Unikorp\KongAdminApi\Document\Sni $document
29
     *
30
     * @return \Psr\Http\Message\ResponseInterface
31
     */
32 1
    public function addSni(Document $document): ResponseInterface
33
    {
34 1
        return $this->post('/snis/', $document);
35
    }
36
37
    /**
38
     * retrieve sni
39
     *
40
     * @param string $name
41
     *
42
     * @return \Psr\Http\Message\ResponseInterface
43
     */
44 1
    public function retrieveSni(string $name): ResponseInterface
45
    {
46 1
        return $this->get(sprintf('/snis/%1$s', $name));
47
    }
48
49
    /**
50
     * list snis
51
     *
52
     * @return \Psr\Http\Message\ResponseInterface
53
     */
54 1
    public function listSnis(): ResponseInterface
55
    {
56 1
        return $this->get('/snis/');
57
    }
58
59
    /**
60
     * update sni
61
     *
62
     * @param string $name
63
     * @param \Unikorp\KongAdminApi\Document\Sni $document
64
     *
65
     * @return \Psr\Http\Message\ResponseInterface
66
     */
67 1
    public function updateSni(string $name, Document $document): ResponseInterface
68
    {
69 1
        return $this->patch(sprintf('/snis/%1$s', $name), $document);
70
    }
71
72
    /**
73
     * update or create sni
74
     *
75
     * @param \Unikorp\KongAdminApi\Document\Sni $document
76
     *
77
     * @return \Psr\Http\Message\ResponseInterface
78
     */
79 1
    public function updateOrCreateSni(Document $document): ResponseInterface
80
    {
81 1
        return $this->put('/snis/', $document);
82
    }
83
84
    /**
85
     * delete sni
86
     *
87
     * @param string $name
88
     *
89
     * @return \Psr\Http\Message\ResponseInterface
90
     */
91 1
    public function deleteSni(string $name): ResponseInterface
92
    {
93 1
        return $this->delete(sprintf('/snis/%1$s', $name));
94
    }
95
}
96