Completed
Pull Request — master (#26)
by
unknown
02:12
created

HostingInfo::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
// Copyright 1999-2016. Parallels IP Holdings GmbH.
3
4
namespace PleskX\Api\Struct\Site;
5
6
class HostingInfo extends \PleskX\Api\Struct
7
{
8
    /** @var array */
9
    public $properties = [];
10
11
    /** @var string */
12
    public $ipAddress;
13
14
    public function __construct($apiResponse)
15
    {
16
        foreach ($apiResponse->vrt_hst->property as $property) {
17
            $this->properties[(string)$property->name] = (string)$property->value;
18
        }
19
        $this->_initScalarProperties($apiResponse->vrt_hst, [
20
            'ip_address',
21
        ]);
22
    }
23
}