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

NodeBalancerStatsData   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 10
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\NodeBalancers;
13
14
use Linode\Entity;
15
16
/**
17
 * Stats for this NodeBalancer.
18
 *
19
 * @property float[]             $connections An array of key/value pairs representing unix timestamp and
20
 *                                            reading for connections to this NodeBalancer.
21
 * @property NodeBalancerTraffic $traffic     Traffic statistics for this NodeBalancer.
22
 */
23
class NodeBalancerStatsData extends Entity
24
{
25
    /**
26
     * @codeCoverageIgnore This method was autogenerated.
27
     */
28
    public function __get(string $name): mixed
29
    {
30
        return match ($name) {
31
            'traffic' => new NodeBalancerTraffic($this->client, $this->data[$name]),
32
            default   => parent::__get($name),
33
        };
34
    }
35
}
36