ManagedLinodeSettings::__get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 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\Managed;
13
14
use Linode\Entity;
15
16
/**
17
 * Settings for a specific Linode related to Managed Services. There is one
18
 * ManagedLinodeSettings object for each Linode on your Account.
19
 *
20
 * @property int         $id    The ID of the Linode these Settings are for.
21
 * @property string      $label The label of the Linode these Settings are for.
22
 * @property string      $group The group of the Linode these Settings are for. This is for display purposes only.
23
 * @property SSHSettings $ssh   The SSH settings for this Linode.
24
 */
25
class ManagedLinodeSettings extends Entity
26
{
27
    // Available fields.
28
    public const FIELD_ID    = 'id';
29
    public const FIELD_LABEL = 'label';
30
    public const FIELD_GROUP = 'group';
31
    public const FIELD_SSH   = 'ssh';
32
33
    /**
34
     * @codeCoverageIgnore This method was autogenerated.
35
     */
36
    public function __get(string $name): mixed
37
    {
38
        return match ($name) {
39
            self::FIELD_SSH => new SSHSettings($this->client, $this->data[$name]),
40
            default         => parent::__get($name),
41
        };
42
    }
43
}
44