TeamResponse::__construct()   A
last analyzed

Complexity

Conditions 5
Paths 16

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 5
eloc 10
c 2
b 0
f 0
nc 16
nop 1
dl 0
loc 15
rs 9.6111
1
<?php
2
3
namespace AcquiaCloudApi\Response;
4
5
class TeamResponse
6
{
7
    public string $uuid;
8
9
    public string $name;
10
11
    public ?string $created_at;
12
13
    public ?string $updated_at;
14
15
    public ?object $organization;
16
17
    public object $links;
18
19
    public function __construct(object $team)
20
    {
21
        $this->uuid = $team->uuid;
22
        $this->name = $team->name;
23
        if (property_exists($team, 'created_at')) {
24
            $this->created_at = $team->created_at;
25
        }
26
        if (property_exists($team, 'updated_at')) {
27
            $this->updated_at = $team->updated_at;
28
        }
29
        if (property_exists($team, 'organization')) {
30
            $this->organization = $team->organization;
31
        }
32
        if (property_exists($team, '_links')) {
33
            $this->links = $team->_links;
34
        }
35
    }
36
}
37