Passed
Push — master ( 41a424...f04d85 )
by Artem
01:57
created

DatabaseTypeEngine   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __get() 0 5 1
1
<?php
2
3
// ---------------------------------------------------------------------
4
//
5
//  Copyright (C) 2018-2024 Artem Rodygin
6
//
7
//  You should have received a copy of the MIT License along with
8
//  this file. If not, see <https://opensource.org/licenses/MIT>.
9
//
10
// ---------------------------------------------------------------------
11
12
namespace Linode\Databases;
13
14
use Linode\Entity;
15
use Linode\Linode\Price;
16
17
/**
18
 * @property int   $quantity The number of nodes for the Managed Database cluster for this subscription tier.
19
 * @property Price $price    Cost in US dollars, broken down into hourly and monthly charges.
20
 */
21
class DatabaseTypeEngine extends Entity
22
{
23
    // Available fields.
24
    public const FIELD_QUANTITY = 'quantity';
25
    public const FIELD_PRICE    = 'price';
26
27
    // `FIELD_QUANTITY` values.
28
    public const QUANTITY_1 = 1;
29
    public const QUANTITY_2 = 2;
30
    public const QUANTITY_3 = 3;
31
32
    /**
33
     * @codeCoverageIgnore This method was autogenerated.
34
     */
35
    public function __get(string $name): mixed
36
    {
37
        return match ($name) {
38
            self::FIELD_PRICE => new Price($this->client, $this->data[$name]),
39
            default           => parent::__get($name),
40
        };
41
    }
42
}
43