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   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 0 Features 1
Metric Value
wmc 7
c 6
b 0
f 1
lcom 3
cbo 1
dl 0
loc 65
ccs 13
cts 13
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 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
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