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 (#110)
by
unknown
06:28
created

Port   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 148
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 148
ccs 12
cts 12
cp 1
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace OpenStack\Networking\v2\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\HasWaiterTrait;
9
use OpenStack\Common\Resource\Listable;
10
use OpenStack\Common\Resource\Retrievable;
11
use OpenStack\Common\Resource\Updateable;
12
13
/**
14
 * @property \OpenStack\Networking\v2\Api $api
15
 */
16
class Port extends OperatorResource implements Creatable, Updateable, Deletable, Listable, Retrievable
17
{
18
    use HasWaiterTrait;
19
20
    /**
21
     * The port status. Value is ACTIVE or DOWN.
22
     *
23
     * @var string
24
     */
25
    public $status;
26
27
    /**
28
     * The port name.
29
     *
30
     * @var string
31
     */
32
    public $name;
33
34
    /**
35
     * A set of zero or more allowed address pairs. An address pair consists of an IP address and MAC address.
36
     *
37
     * @var []string
38
     */
39
    public $allowedAddressPairs;
40
41
    /**
42
     * The administrative state of the port, which is up (true) or down (false).
43
     *
44
     * @var bool
45
     */
46
    public $adminStateUp;
47
48
    /**
49
     * The UUID of the attached network.
50
     *
51
     * @var string
52
     */
53
    public $networkId;
54
55
    /**
56
     * The UUID of the tenant who owns the network. Only administrative users can specify a tenant UUID other than
57
     * their own.
58
     *
59
     * @var string
60
     */
61
    public $tenantId;
62
63
    /**
64
     * A set of zero or more extra DHCP option pairs. An option pair consists of an option value and name.
65
     *
66
     * @var array
67
     */
68
    public $extraDhcpOpts;
69
70
    /**
71
     * The UUID of the entity that uses this port. For example, a DHCP agent.
72
     *
73
     * @var string
74
     */
75
    public $deviceOwner;
76
77
    /**
78
     * The MAC address of the port.
79
     *
80
     * @var string
81
     */
82
    public $macAddress;
83
84
    /**
85
     * The IP addresses for the port. Includes the IP address and UUID of the subnet.
86
     *
87
     * @var array
88
     */
89
    public $fixedIps;
90
91
    /**
92
     * The UUID of the port.
93
     *
94
     * @var string
95
     */
96
    public $id;
97
98
    /**
99
     * The UUIDs of any attached security groups.
100
     *
101
     * @var array
102
     */
103
    public $securityGroups;
104
105
    /**
106
     * The UUID of the device that uses this port. For example, a virtual server.
107
     *
108
     * @var string
109
     */
110
    public $deviceId;
111
112
    /**
113
     * The port security status. The status is enabled (true) or disabled (false).
114
     *
115
     * @var bool
116
     */
117
    public $portSecurityEnabled;
118
119
    protected $aliases = [
120
        'admin_state_up'  => 'adminStateUp',
121 1
        'display_name'    => 'displayName',
122
        'network_id'      => 'networkId',
123 1
        'tenant_id'       => 'tenantId',
124 1
        'device_owner'    => 'deviceOwner',
125
        'mac_address'     => 'macAddress',
126
        'port_id'         => 'portId',
127 1
        'security_groups' => 'securityGroups',
128
        'device_id'       => 'deviceId',
129 1
        'fixed_ips'       => 'fixedIps',
130 1
    ];
131
132
    protected $resourceKey = 'port';
133 1
134
    /**
135 1
     * {@inheritDoc}
136 1
     */
137
    public function create(array $userOptions): Creatable
138 1
    {
139
        $response = $this->execute($this->api->postSinglePort(), $userOptions);
140 1
        return $this->populateFromResponse($response);
141 1
    }
142
143
    public function bulkCreate(array $userOptions): array
144
    {
145
        $response = $this->execute($this->api->postMultiplePorts(), ['ports' => $userOptions]);
146
        return $this->extractMultipleInstances($response);
147
    }
148
149
    public function retrieve()
150
    {
151
        $response = $this->execute($this->api->getPort(), ['id' => (string)$this->id]);
152
        $this->populateFromResponse($response);
153
    }
154
155
    public function update()
156
    {
157
        i$response = $this->executeWithState($this->api->putPort());
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_VARIABLE
Loading history...
158
	$this->populateFromResponse($response);
159
    }
160
161
    public function delete()
162
    {
163
        $this->executeWithState($this->api->deletePort());
164
    }
165
}
166