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 ( a6e2fd...77480b )
by Jamie
12s
created

SecurityGroup::getAliases()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
namespace OpenStack\Networking\v2\Extensions\SecurityGroups\Models;
4
5
use OpenStack\Common\Resource\Alias;
6
use OpenStack\Common\Resource\OperatorResource;
7
use OpenStack\Common\Resource\Creatable;
8
use OpenStack\Common\Resource\Deletable;
9
use OpenStack\Common\Resource\Listable;
10
use OpenStack\Common\Resource\Retrievable;
11
use OpenStack\Common\Resource\Updateable;
12
13
/**
14
 * Represents a SecurityGroup resource in the Network v2 service
15
 *
16
 * @property \OpenStack\Networking\v2\Extensions\SecurityGroups\Api $api
17
 */
18
class SecurityGroup extends OperatorResource implements Creatable, Listable, Deletable, Retrievable, Updateable
19
{
20
    /**
21
     * @var string
22
     */
23
    public $description;
24
25
    /**
26
     * @var string
27
     */
28
    public $id;
29
30
    /**
31
     * @var string
32
     */
33
    public $name;
34
35
    /**
36
     * @var []SecurityGroupRule
37
     */
38
    public $securityGroupRules;
39
40
    /**
41
     * @var string
42
     */
43
    public $tenantId;
44
45
    protected $aliases = [
46
        'tenant_id' => 'tenantId',
47
    ];
48
49
    protected $resourceKey  = 'security_group';
50
    protected $resourcesKey = 'security_groups';
51
52
    /**
53
     * @inheritdoc
54
     */
55
    protected function getAliases(): array
56
    {
57
        return parent::getAliases() + [
58
            'security_group_rules' => new Alias('securityGroupRules', SecurityGroupRule::class, true),
59
            'rules'                => new Alias('securityGroupRules', SecurityGroupRule::class, true)
60
        ];
61
    }
62
63
    /**
64
     * {@inheritDoc}
65
     */
66
    public function create(array $userOptions): Creatable
67
    {
68
        $response = $this->execute($this->api->postSecurityGroups(), $userOptions);
69
        return $this->populateFromResponse($response);
70
    }
71
72
    /**
73
     * {@inheritDoc}
74
     */
75
    public function delete()
76
    {
77
        $this->executeWithState($this->api->deleteSecurityGroup());
78
    }
79
80
    /**
81
     * {@inheritDoc}
82
     */
83
    public function retrieve()
84
    {
85
        $response = $this->executeWithState($this->api->getSecurityGroup());
86
        $this->populateFromResponse($response);
87
    }
88
89
    public function update()
90
    {
91
        $response = $this->executeWithState($this->api->putSecurityGroups());
92
        $this->populateFromResponse($response);
93
    }
94
}
95