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

Target::addTarget()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
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\Target as Document;
17
18
/**
19
 * target
20
 *
21
 * @author VEBER Arnaud <https://github.com/VEBERArnaud>
22
 */
23
class Target extends AbstractNode
24
{
25
    /**
26
     * add target
27
     *
28
     * @param string $nameOrId
29
     * @param \Unikorp\KongAdminApi\Document\Target $document
30
     *
31
     * @return \Psr\Http\Message\ResponseInterface
32
     */
33 1
    public function addTarget(string $nameOrId, Document $document): ResponseInterface
34
    {
35 1
        return $this->post(sprintf('/upstreams/%1$s/targets', $nameOrId), $document);
36
    }
37
38
    /**
39
     * list targets
40
     *
41
     * @param string $nameOrId
42
     *
43
     * @return \Psr\Http\Message\ResponseInterface
44
     */
45 1
    public function listTargets(string $nameOrId): ResponseInterface
46
    {
47 1
        return $this->get(sprintf('/upstreams/%1$s/targets', $nameOrId));
48
    }
49
50
    /**
51
     * list active targets
52
     *
53
     * @param string $nameOrId
54
     *
55
     * @return \Psr\Http\Message\ResponseInterface
56
     */
57 1
    public function listActiveTargets(string $nameOrId): ResponseInterface
58
    {
59 1
        return $this->get(sprintf('/upstreams/%1$s/targets/active', $nameOrId));
60
    }
61
62
    /**
63
     * delete target
64
     *
65
     * @param string $nameOrId
66
     * @param string $target
67
     *
68
     * @return \Psr\Http\Message\ResponseInterface
69
     */
70 1
    public function deleteTarget(string $nameOrId, string $target): ResponseInterface
71
    {
72 1
        return $this->delete(sprintf('/upstreams/%1$s/targets/%2$s', $nameOrId, $target));
73
    }
74
}
75