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

ManagedIssue   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 8
dl 0
loc 16
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\Managed;
13
14
use Linode\Entity;
15
use Linode\Linode\LinodeEntity;
16
17
/**
18
 * An Issue that was detected with a service Linode is managing.
19
 *
20
 * @property int          $id       This Issue's unique ID.
21
 * @property string       $created  When this Issue was created. Issues are created in response to issues detected
22
 *                                  with Managed Services, so this is also when the Issue was detected.
23
 * @property int[]        $services An array of Managed Service IDs that were affected by this Issue.
24
 * @property LinodeEntity $entity   The ticket this Managed Issue opened.
25
 */
26
class ManagedIssue extends Entity
27
{
28
    // Available fields.
29
    public const FIELD_ID       = 'id';
30
    public const FIELD_CREATED  = 'created';
31
    public const FIELD_SERVICES = 'services';
32
    public const FIELD_ENTITY   = 'entity';
33
34
    /**
35
     * @codeCoverageIgnore This method was autogenerated.
36
     */
37
    public function __get(string $name): mixed
38
    {
39
        return match ($name) {
40
            self::FIELD_ENTITY => new LinodeEntity($this->client, $this->data[$name]),
41
            default            => parent::__get($name),
42
        };
43
    }
44
}
45