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 (#159)
by Roman
01:49
created

LoadBalancerMember::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
namespace OpenStack\Networking\v2\Models;
4
5
use OpenStack\Common\Resource\Alias;
6
use OpenStack\Common\Resource\Creatable;
7
use OpenStack\Common\Resource\Deletable;
8
use OpenStack\Common\Resource\OperatorResource;
9
use OpenStack\Common\Resource\Retrievable;
10
use OpenStack\Common\Resource\Updateable;
11
use OpenStack\Networking\v2\Api;
12
13
/**
14
 * Represents a Neutron v2 LoadBalancer member
15
 *
16
 * @property Api $api
17
 */
18
class LoadBalancerMember extends OperatorResource implements Creatable, Retrievable, Updateable, Deletable
19
{
20
    /**
21
     * @var string
22
     */
23
    public $id;
24
25
    /**
26
     * @var string
27
     */
28
    public $tenantId;
29
30
    /**
31
     * @var string
32
     */
33
    public $address;
34
35
    /**
36
     * @var integer
37
     */
38
    public $protocolPort;
39
40
    /**
41
     * @var integer
42
     */
43
    public $weight;
44
45
    /**
46
     * @var string
47
     */
48
    public $subnetId;
49
50
    /**
51
     * @var string
52
     */
53
    public $poolId;
54
55
    /**
56
     * @var boolean
57
     */
58
    public $adminStateUp;
59
60
    /**
61
     * @var string
62
     */
63
    public $operatingStatus;
64
65
    /**
66
     * @var string
67
     */
68
    public $provisioningStatus;
69
70
    protected $resourcesKey = 'members';
71
    protected $resourceKey = 'member';
72
73
    /**
74
     * @inheritdoc
75
     */
76
    protected static function getAlias(): Alias
77
    {
78
        $alias = parent::getAlias();
79
80
        if (!$alias->hasAliases(self::class)) {
81
            $alias
82
                ->add(self::class, 'tenant_id', 'tenantId')
83
                ->add(self::class, 'admin_state_up', 'adminStateUp')
84
                ->add(self::class, 'protocol_port', 'protocolPort')
85
                ->add(self::class, 'subnet_id', 'subnetId')
86
                ->add(self::class, 'pool_id', 'poolId')
87
                ->add(self::class, 'operating_status', 'operatingStatus')
88
                ->add(self::class, 'provisioning_status', 'provisioningStatus');
89
        }
90
91
        return $alias;
92
    }
93
94
    /**
95
     * {@inheritDoc}
96
     */
97
    public function create(array $userOptions): Creatable
98
    {
99
        $userOptions = array_merge(['poolId' => $this->poolId], $userOptions);
100
        $response = $this->execute($this->api->postLoadBalancerMember(), $userOptions);
101
        return $this->populateFromResponse($response);
102
    }
103
104
    /**
105
     * {@inheritDoc}
106
     */
107
    public function retrieve()
108
    {
109
        $response = $this->execute($this->api->getLoadBalancerMember(), ['poolId' => (string)$this->poolId, 'id' => (string)$this->id]);
110
        $this->populateFromResponse($response);
111
    }
112
113
    /**
114
     * {@inheritDoc}
115
     */
116
    public function update()
117
    {
118
        $response = $this->executeWithState($this->api->putLoadBalancerMember(), ['poolId' => (string)$this->poolId, 'id' => (string)$this->id]);
0 ignored issues
show
Unused Code introduced by
The call to LoadBalancerMember::executeWithState() has too many arguments starting with array('poolId' => (strin... => (string) $this->id).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
119
        $this->populateFromResponse($response);
120
    }
121
122
    /**
123
     * {@inheritDoc}
124
     */
125
    public function delete()
126
    {
127
        $this->executeWithState($this->api->deleteLoadBalancerMember(), ['poolId' => (string)$this->poolId, 'id' => (string)$this->id]);
0 ignored issues
show
Unused Code introduced by
The call to LoadBalancerMember::executeWithState() has too many arguments starting with array('poolId' => (strin... => (string) $this->id).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
128
    }
129
}
130