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 (#50)
by Ha
02:31
created

Flavor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 52
ccs 4
cts 4
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A retrieve() 0 5 1
A create() 0 5 1
A delete() 0 4 1
1
<?php declare (strict_types=1);
2
3
namespace OpenStack\Compute\v2\Models;
4
5
use OpenCloud\Common\Resource\Creatable;
6
use OpenCloud\Common\Resource\Deletable;
7
use OpenCloud\Common\Resource\OperatorResource;
8
use OpenCloud\Common\Resource\Listable;
9
use OpenCloud\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
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 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