EnvironmentResponse   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 42
c 1
b 0
f 0
dl 0
loc 72
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 24 2
1
<?php
2
3
namespace AcquiaCloudApi\Response;
4
5
class EnvironmentResponse
6
{
7
    public string $uuid;
8
9
    public string $label;
10
11
    public string $name;
12
13
    public object $application;
14
15
    /**
16
     * @var array<string> $domains
17
     */
18
    public array $domains;
19
20
    public string $active_domain;
21
22
    public string $default_domain;
23
24
    public ?string $image_url;
25
26
    public ?string $sshUrl;
27
28
    /**
29
     * @var array<string> $ips
30
     */
31
    public array $ips;
32
33
    public ?string $region;
34
35
    public string $status;
36
37
    public string $type;
38
39
    public object $vcs;
40
41
    public object $flags;
42
43
    public ?object $configuration;
44
45
    public object $links;
46
47
    public string $platform;
48
49
    public string $balancer;
50
51
    public ?object $artifact;
52
53
    public function __construct(object $environment)
54
    {
55
        $this->uuid = $environment->id;
56
        $this->label = $environment->label;
57
        $this->name = $environment->name;
58
        $this->application = $environment->application;
59
        $this->domains = $environment->domains;
60
        $this->active_domain = $environment->active_domain;
61
        $this->default_domain = $environment->default_domain;
62
        $this->image_url = $environment->image_url;
63
        if (property_exists($environment, 'ssh_url')) {
64
            $this->sshUrl = $environment->ssh_url;
65
        }
66
        $this->ips = $environment->ips;
67
        $this->region = $environment->region;
68
        $this->balancer = $environment->balancer;
69
        $this->platform = $environment->platform;
70
        $this->status = $environment->status;
71
        $this->type = $environment->type;
72
        $this->vcs = $environment->vcs;
73
        $this->configuration = $environment->configuration;
74
        $this->flags = $environment->flags;
75
        $this->artifact = $environment->artifact;
76
        $this->links = $environment->_links;
77
    }
78
}
79