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.
Passed
Push — master ( b7663d...658651 )
by Jamie
08:03
created

Endpoint::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace OpenStack\Identity\v3\Models;
4
5
use OpenStack\Common\Resource\AbstractResource;
6
use OpenStack\Common\Resource\Creatable;
7
use OpenStack\Common\Resource\Deletable;
8
use OpenStack\Common\Resource\Updateable;
9
10
/**
11
 * @property \OpenStack\Identity\v3\Api $api
12
 */
13
class Endpoint extends AbstractResource implements Creatable, Updateable, Deletable
14
{
15
    /** @var string */
16
    public $id;
17
18
    /** @var string */
19
    public $interface;
20
21
    /** @var string */
22
    public $name;
23
24
    /** @var string */
25
    public $serviceId;
26
27
    /** @var string */
28
    public $region;
29
30
    /** @var array */
31
    public $links;
32
33
    /** @var string */
34
    public $url;
35
36
    protected $resourceKey = 'endpoint';
37
    protected $resourcesKey = 'endpoints';
38
    protected $aliases = ['service_id' => 'serviceId'];
39
40
    /**
41
     * {@inheritDoc}
42
     *
43
     * @param array $data {@see \OpenStack\Identity\v3\Api::postEndpoints}
44
     */
45 2
    public function create(array $data)
46
    {
47 2
        $response = $this->execute($this->api->postEndpoints(), $data);
48 2
        return $this->populateFromResponse($response);
49
    }
50
51
    /**
52
     * {@inheritDoc}
53
     */
54 1
    public function update()
55
    {
56 1
        $response = $this->executeWithState($this->api->patchEndpoint());
57 1
        return $this->populateFromResponse($response);
58
    }
59
60
    /**
61
     * {@inheritDoc}
62
     */
63 1
    public function delete()
64
    {
65 1
        $this->execute($this->api->deleteEndpoint(), $this->getAttrs(['id']));
66 1
    }
67
68 2
    public function regionMatches($value)
69
    {
70 2
        return $this->region && $this->region == $value;
71
    }
72
73 2
    public function interfaceMatches($value)
74
    {
75 2
        return $this->interface && $this->interface == $value;
76
    }
77
}
78