Passed
Push — master ( bfa63a...41a424 )
by Artem
01:47
created

FirewallDevices   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 0
f 0
dl 0
loc 16
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\Networking;
13
14
use Linode\Entity;
15
use Linode\Linode\LinodeEntity;
16
17
/**
18
 * Associates a Firewall with a Linode service. A Firewall can be assigned to a
19
 * single Linode service at a time. Additional disabled Firewalls can be assigned to
20
 * a service, but they cannot be enabled if another active Firewall is already
21
 * assigned to the same service.
22
 *
23
 * @property int          $id      The Device's unique ID
24
 * @property string       $created When this Device was created.
25
 * @property string       $updated When this Device was last updated.
26
 * @property LinodeEntity $entity  The Linode service that this Firewall has been applied to.
27
 */
28
class FirewallDevices extends Entity
29
{
30
    // Available fields.
31
    public const FIELD_ID      = 'id';
32
    public const FIELD_CREATED = 'created';
33
    public const FIELD_UPDATED = 'updated';
34
    public const FIELD_ENTITY  = 'entity';
35
36
    /**
37
     * @codeCoverageIgnore This method was autogenerated.
38
     */
39
    public function __get(string $name): mixed
40
    {
41
        return match ($name) {
42
            self::FIELD_ENTITY => new LinodeEntity($this->client, $this->data[$name]),
43
            default            => parent::__get($name),
44
        };
45
    }
46
}
47