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 ( 8fccc5...dea5ad )
by Jamie
8s
created

Router   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 68
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 5 1
A update() 0 4 1
A retrieve() 0 4 1
A delete() 0 4 1
A addInterface() 0 5 1
A removeInterface() 0 5 1
1
<?php
2
3
namespace OpenStack\Networking\v2\Extensions\Layer3\Models;
4
5
use OpenCloud\Common\Resource\OperatorResource;
6
use OpenCloud\Common\Resource\Creatable;
7
use OpenCloud\Common\Resource\Deletable;
8
use OpenCloud\Common\Resource\Listable;
9
use OpenCloud\Common\Resource\Retrievable;
10
use OpenCloud\Common\Resource\Updateable;
11
use OpenStack\Networking\v2\Extensions\Layer3\Api;
12
13
/**
14
 * @property Api $api
15
 */
16
class Router extends OperatorResource implements Listable, Creatable, Retrievable, Updateable, Deletable
0 ignored issues
show
Bug introduced by
There is one abstract method enumerate in this class; you could implement it, or declare this class as abstract.
Loading history...
17
{
18
    /** @var string */
19
    public $status;
20
21
    /** @var GatewayInfo */
22
    public $externalGatewayInfo;
23
24
    /** @var string */
25
    public $name;
26
27
    /** @var string */
28
    public $adminStateUp;
29
30
    /** @var string */
31
    public $tenantId;
32
33
    /** @var array */
34
    public $routes;
35
36
    /** @var string */
37
    public $id;
38
39
    protected $aliases = [
40
        'external_gateway_info' => 'externalGatewayInfo',
41
        'admin_state_up'        => 'adminStateUp',
42
        'tenant_id'             => 'tenantId',
43
    ];
44
45
    public function create(array $userOptions): Creatable
46
    {
47
        $response = $this->execute($this->api->postRouters(), $userOptions);
48
        return $this->populateFromResponse($response);
49
    }
50
51
    public function update()
52
    {
53
        $this->executeWithState($this->api->putRouter());
54
    }
55
56
    public function retrieve()
57
    {
58
        $this->executeWithState($this->api->getRouter());
59
    }
60
61
    public function delete()
62
    {
63
        $this->executeWithState($this->api->deleteRouter());
64
    }
65
66
    /**
67
     * @param array $userOptions {@see \OpenStack\Networking\v2\Extensions\Layer3\Api::putAddInterface}
68
     */
69
    public function addInterface(array $userOptions)
70
    {
71
        $userOptions['id'] = $this->id;
72
        $this->execute($this->api->putAddInterface(), $userOptions);
73
    }
74
75
    /**
76
     * @param array $userOptions {@see \OpenStack\Networking\v2\Extensions\Layer3\Api::putRemoveInterface}
77
     */
78
    public function removeInterface(array $userOptions)
79
    {
80
        $userOptions['id'] = $this->id;
81
        $this->execute($this->api->putRemoveInterface(), $userOptions);
82
    }
83
}
84