IPv6Information::__get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 7
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\LinodeInstances;
13
14
use Linode\Entity;
15
use Linode\Networking\IPAddressV6LinkLocal;
16
use Linode\Networking\IPAddressV6Slaac;
17
use Linode\Networking\IPv6Pool;
18
19
/**
20
 * Information about this Linode's IPv6 addresses.
21
 *
22
 * @property IPAddressV6LinkLocal $link_local
23
 * @property IPAddressV6Slaac     $slaac
24
 * @property IPv6Pool             $global
25
 */
26
class IPv6Information extends Entity
27
{
28
    /**
29
     * @codeCoverageIgnore This method was autogenerated.
30
     */
31
    public function __get(string $name): mixed
32
    {
33
        return match ($name) {
34
            'link_local' => new IPAddressV6LinkLocal($this->client, $this->data[$name]),
35
            'slaac'      => new IPAddressV6Slaac($this->client, $this->data[$name]),
36
            'global'     => new IPv6Pool($this->client, $this->data[$name]),
37
            default      => parent::__get($name),
38
        };
39
    }
40
}
41