Passed
Push — master ( 0676a7...01ab94 )
by Artem
11:54
created

LongviewSubscription   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 8
dl 0
loc 16
c 0
b 0
f 0
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\Longview;
13
14
use Linode\Entity;
15
use Linode\Linode\Price;
16
17
/**
18
 * A Longview Subscriptions represents a tier of Longview service you can subscribe
19
 * to.
20
 *
21
 * @property string $id               The unique ID of this Subscription tier.
22
 * @property string $label            A display name for this Subscription tier.
23
 * @property int    $clients_included The number of Longview Clients that may be created with this Subscription tier.
24
 * @property Price  $price            Pricing information about this Subscription tier.
25
 */
26
class LongviewSubscription extends Entity
27
{
28
    // Available fields.
29
    public const FIELD_ID               = 'id';
30
    public const FIELD_LABEL            = 'label';
31
    public const FIELD_CLIENTS_INCLUDED = 'clients_included';
32
    public const FIELD_PRICE            = 'price';
33
34
    /**
35
     * @codeCoverageIgnore This method was autogenerated.
36
     */
37
    public function __get(string $name): mixed
38
    {
39
        return match ($name) {
40
            self::FIELD_PRICE => new Price($this->client, $this->data[$name]),
41
            default           => parent::__get($name),
42
        };
43
    }
44
}
45