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 ( 835a4f...30eaeb )
by Ha
11s
created

Endpoint   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 3
cbo 1
dl 0
loc 74
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 5 1
A retrieve() 0 5 1
A update() 0 5 1
A delete() 0 4 1
A regionMatches() 0 4 2
A interfaceMatches() 0 4 2
1
<?php declare(strict_types=1);
2
3
namespace OpenStack\Identity\v3\Models;
4
5
use OpenStack\Common\Resource\OperatorResource;
6
use OpenStack\Common\Resource\Creatable;
7
use OpenStack\Common\Resource\Deletable;
8
use OpenStack\Common\Resource\Updateable;
9
use OpenStack\Common\Resource\Retrievable;
10
11
/**
12
 * @property \OpenStack\Identity\v3\Api $api
13
 */
14
class Endpoint extends OperatorResource implements Creatable, Updateable, Deletable, Retrievable
15
{
16
    /** @var string */
17
    public $id;
18
19
    /** @var string */
20
    public $interface;
21
22
    /** @var string */
23
    public $name;
24
25
    /** @var string */
26
    public $serviceId;
27
28
    /** @var string */
29
    public $region;
30
31
    /** @var array */
32
    public $links;
33
34
    /** @var string */
35
    public $url;
36
37
    protected $resourceKey = 'endpoint';
38
    protected $resourcesKey = 'endpoints';
39
    protected $aliases = ['service_id' => 'serviceId'];
40
41
    /**
42
     * {@inheritDoc}
43
     *
44
     * @param array $data {@see \OpenStack\Identity\v3\Api::postEndpoints}
45 2
     */
46
    public function create(array $data): Creatable
47 2
    {
48 2
        $response = $this->execute($this->api->postEndpoints(), $data);
49
        return $this->populateFromResponse($response);
50
    }
51
52
    /**
53
     * {@inheritDoc}
54 1
     */
55
    public function retrieve()
56 1
    {
57 1
        $response = $this->executeWithState($this->api->getEndpoint());
58
        $this->populateFromResponse($response);
59
    }
60
61
    /**
62
     * {@inheritDoc}
63 1
     */
64
    public function update()
65 1
    {
66 1
        $response = $this->executeWithState($this->api->patchEndpoint());
67
        $this->populateFromResponse($response);
68 2
    }
69
70 2
    /**
71
     * {@inheritDoc}
72
     */
73 2
    public function delete()
74
    {
75 2
        $this->execute($this->api->deleteEndpoint(), $this->getAttrs(['id']));
76
    }
77
78
    public function regionMatches(string $value): bool
79
    {
80
        return $this->region && $this->region == $value;
81
    }
82
83
    public function interfaceMatches(string $value): bool
84
    {
85
        return $this->interface && $this->interface == $value;
86
    }
87
}
88