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
Pull Request — master (#2)
by VEBER
01:54
created

AbstractApi::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 2
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;
13
14
/**
15
 * abstract api
16
 *
17
 * @author VEBER Arnaud <https://github.com/VEBERArnaud>
18
 */
19
class AbstractApi implements ApiInterface
20
{
21
    /**
22
     * client
23
     * @var \Unikorp\KongAdminApi\Client $client
24
     */
25
    private $client = null;
26
27
    /**
28
     * Constructor
29
     *
30
     * @param \Unikorp\KongAdminApi\Client $client
31
     */
32 5
    public function __construct(Client $client)
33
    {
34 5
        $this->client = $client;
35 5
    }
36
37
    /**
38
     * get
39
     *
40
     * @param string $uri
41
     * @param array $headers
42
     *
43
     * @return \Psr\Http\Message\ResponseInterface
44
     */
45
    protected function get($uri, array $headers = [])
0 ignored issues
show
Unused Code introduced by
The parameter $uri is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
46
    {
47
        return $this->client->getHttpClient()->get($path, $headers);
0 ignored issues
show
Bug introduced by
The variable $path does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
48
    }
49
50
    /**
51
     * post
52
     *
53
     * @param string $uri
54
     * @param array $headers
55
     * @param string $body
56
     *
57
     * @return \Psr\Http\Message\ResponseInterface
58
     */
59
    protected function post($uri, array $headers = [], $body = null)
60
    {
61
        return $this->client->getHttpClient()->post($uri, $headers, $body);
62
    }
63
64
    /**
65
     * put
66
     *
67
     * @param string $uri
68
     * @param array $headers
69
     * @param string $body
70
     *
71
     * @return \Psr\Http\Message\ResponseInterface
72
     */
73
    protected function put($uri, array $headers = [], $body = null)
74
    {
75
        return $this->client->getHttpClient()->put($uri, $headers, $body);
76
    }
77
78
    /**
79
     * patch
80
     *
81
     * @param string $uri
82
     * @param array $headers
83
     * @param string $uri
84
     *
85
     * @return \Psr\Http\Message\ResponseInterface
86
     */
87
    protected function patch($uri, array $headers = [], $body = null)
88
    {
89
        return $this->client->getHttpClient()->patch($uri, $headers, $body);
90
    }
91
92
    /**
93
     * delete
94
     *
95
     * @param string $uri
96
     * @param array $headers
97
     * @param string $body
98
     *
99
     * @return \Psr\Http\Message\ResponseInterface
100
     */
101
    protected function delete($uri, array $headers = [], $body = null)
102
    {
103
        return $this->client->getHttpClient()->delete($uri, $headers, $body);
104
    }
105
}
106