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.

Flavor::retrieve()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 9.4285
ccs 0
cts 0
cp 0
cc 1
eloc 3
nc 1
nop 0
crap 2
1
<?php declare(strict_types=1);
2
3
namespace OpenStack\Compute\v2\Models;
4
5
use OpenStack\Common\Resource\Creatable;
6
use OpenStack\Common\Resource\Deletable;
7
use OpenStack\Common\Resource\OperatorResource;
8
use OpenStack\Common\Resource\Listable;
9
use OpenStack\Common\Resource\Retrievable;
10
11
/**
12
 * Represents a Compute v2 Flavor.
13
 *
14
 * @property \OpenStack\Compute\v2\Api $api
15
 */
16
class Flavor extends OperatorResource implements Listable, Retrievable, Creatable, Deletable
17
{
18
    /** @var int */
19
    public $disk;
20
21
    /** @var string */
22
    public $id;
23
24
    /** @var string */
25
    public $name;
26
27
    /** @var int */
28
    public $ram;
29
30
    /** @var int */
31
    public $swap;
32
33
    /** @var int */
34
    public $vcpus;
35
36
    /** @var array */
37
    public $links;
38
39
    protected $resourceKey = 'flavor';
40 1
    protected $resourcesKey = 'flavors';
41
42 1
    /**
43 1
     * {@inheritDoc}
44 1
     */
45
    public function retrieve()
46
    {
47
        $response = $this->execute($this->api->getFlavor(), ['id' => (string) $this->id]);
48
        $this->populateFromResponse($response);
49
    }
50
51
    /**
52
     * {@inheritDoc}
53
     */
54
    public function create(array $userOptions): Creatable
55
    {
56
        $response = $this->execute($this->api->postFlavors(), $userOptions);
57
        return $this->populateFromResponse($response);
58
    }
59
60
    /**
61
     * {@inheritDoc}
62
     */
63
    public function delete()
64
    {
65
        $this->execute($this->api->deleteFlavor(), ['id' => (string) $this->id]);
66
    }
67
}
68