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:16
created

Flavor::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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->postFlavor(), $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