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

NodeBalancerStats::__get()   A

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\NodeBalancers;
13
14
use Linode\Entity;
15
16
/**
17
 * Stats for this NodeBalancer.
18
 *
19
 * @property string                $title The title for the statistics generated in this response.
20
 * @property NodeBalancerStatsData $data  The data returned about this NodeBalancers.
21
 */
22
class NodeBalancerStats extends Entity
23
{
24
    // Available fields.
25
    public const FIELD_TITLE = 'title';
26
    public const FIELD_DATA  = 'data';
27
28
    /**
29
     * @codeCoverageIgnore This method was autogenerated.
30
     */
31
    public function __get(string $name): mixed
32
    {
33
        return match ($name) {
34
            self::FIELD_DATA => new NodeBalancerStatsData($this->client, $this->data[$name]),
35
            default          => parent::__get($name),
36
        };
37
    }
38
}
39