DomainResponse   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 15
c 1
b 0
f 0
dl 0
loc 32
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 3
1
<?php
2
3
namespace AcquiaCloudApi\Response;
4
5
class DomainResponse
6
{
7
    public string $hostname;
8
9
    public object $flags;
10
11
    /**
12
     * @var array<string>|null $ip_addresses
13
     */
14
    public ?array $ip_addresses;
15
16
    /**
17
     * @var array<string>|null $cnames
18
     */
19
    public ?array $cnames;
20
21
    public object $environment;
22
23
    public object $links;
24
25
    public function __construct(object $domain)
26
    {
27
        $this->hostname = $domain->hostname;
28
        $this->flags = $domain->flags;
29
        $this->environment = $domain->environment;
30
        if (property_exists($domain, 'ip_addresses')) {
31
            $this->ip_addresses = $domain->ip_addresses;
32
        }
33
        if (property_exists($domain, 'cnames')) {
34
            $this->cnames = $domain->cnames;
35
        }
36
        $this->links = $domain->_links;
37
    }
38
}
39