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 ( beaba1...b637a0 )
by VEBER
17s
created

Plugin::retrievePlugin()   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 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\Plugin as Document;
17
18
/**
19
 * plugin
20
 *
21
 * @author VEBER Arnaud <https://github.com/VEBERArnaud>
22
 */
23
class Plugin extends AbstractNode
24
{
25
    /**
26
     * add plugin
27
     *
28
     * @param string $nameOrId
29
     * @param \Unikorp\KongAdminApi\Document\Plugin $document
30
     *
31
     * @return \Psr\Http\Message\ResponseInterface
32
     */
33 1
    public function addPlugin(string $nameOrId, Document $document): ResponseInterface
34
    {
35 1
        return $this->post(sprintf('/apis/%1$s/plugins/', $nameOrId), $document);
36
    }
37
38
    /**
39
     * retrieve plugin
40
     *
41
     * @param string $id
42
     *
43
     * @return \Psr\Http\Message\ResponseInterface
44
     */
45 1
    public function retrievePlugin(string $id): ResponseInterface
46
    {
47 1
        return $this->get(sprintf('/plugins/%1$s', $id));
48
    }
49
50
    /**
51
     * list all plugins
52
     *
53
     * @return \Psr\Http\Message\ResponseInterface
54
     */
55 1
    public function listAllPlugins(): ResponseInterface
56
    {
57 1
        return $this->get('/plugins/');
58
    }
59
60
    /**
61
     * list plugins per api
62
     *
63
     * @param string $apiNameOrId
64
     *
65
     * @return \Psr\Http\Message\ResponseInterface
66
     */
67 1
    public function listPluginsPerApi(string $apiNameOrId): ResponseInterface
68
    {
69 1
        return $this->get(sprintf('/apis/%1$s/plugins/', $apiNameOrId));
70
    }
71
72
    /**
73
     * update plugin
74
     *
75
     * @param string $apiNameOrId
76
     * @param string $id
77
     * @param \Unikorp\KongAdminApi\Document\Plugin $document
78
     *
79
     * @return \Psr\Http\Message\ResponseInterface
80
     */
81 1
    public function updatePlugin(string $apiNameOrId, string $id, Document $document): ResponseInterface
82
    {
83 1
        return $this->patch(sprintf('/apis/%1$s/plugins/%2$s', $apiNameOrId, $id), $document);
84
    }
85
86
    /**
87
     * update or add plugin
88
     *
89
     * @param string $apiNameOrId
90
     * @param \Unikorp\KongAdminApi\Document\Plugin $document
91
     *
92
     * @return \Psr\Http\Message\ResponseInterface
93
     */
94 1
    public function updateOrAddPlugin(string $apiNameOrId, Document $document): ResponseInterface
95
    {
96 1
        return $this->put(sprintf('/apis/%1$s/plugins/', $apiNameOrId), $document);
97
    }
98
99
    /**
100
     * delete plugin
101
     *
102
     * @param string $apiNameOrId
103
     * @param string $id
104
     *
105
     * @return \Psr\Http\Message\ResponseInterface
106
     */
107 1
    public function deletePlugin(string $apiNameOrId, string $id): ResponseInterface
108
    {
109 1
        return $this->delete(sprintf('/apis/%1$s/plugins/%2$s', $apiNameOrId, $id));
110
    }
111
112
    /**
113
     * retrieve enabled plugin
114
     *
115
     * @return \Psr\Http\Message\ResponseInterface
116
     */
117 1
    public function retrieveEnabledPlugin(): ResponseInterface
118
    {
119 1
        return $this->get('/plugins/enabled');
120
    }
121
122
    /**
123
     * retrieve plugin schema
124
     *
125
     * @param string $pluginName
126
     *
127
     * @return \Psr\Http\Message\ResponseInterface
128
     */
129 1
    public function retrievePluginSchema(string $pluginName): ResponseInterface
130
    {
131 1
        return $this->get(sprintf('/plugins/schema/%1$s', $pluginName));
132
    }
133
}
134