FloatingIp   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 35
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B build() 0 14 6
1
<?php
2
/*
3
 *   This file is part of the Vultr PHP library.
4
 *
5
 *   (c) Albert Leitato <[email protected]>
6
 *
7
 *   For the full copyright and license information, please view the LICENSE
8
 *   file that was distributed with this source code.
9
 */
10
namespace Vultr\Entity;
11
12
/**
13
 * @author Albert Leitato <[email protected]>
14
 */
15
final class FloatingIp extends AbstractEntity
16
{
17
    /**
18
     * @var string
19
     */
20
    public $subid;
21
22
    /**
23
     * @var Droplet|null
24
     */
25
    public $droplet;
26
27
    /**
28
     * @var Region
29
     */
30
    public $region;
31
32
    /**
33
     * @param array $parameters
34
     */
35
    public function build(array $parameters)
36
    {
37
        parent::build($parameters);
38
39
        foreach ($parameters as $property => $value) {
40
            if ('droplet' === $property && \is_object($value)) {
41
                $this->droplet = new Droplet($value);
42
            }
43
44
            if ('region' === $property && \is_object($value)) {
45
                $this->region = new Region($value);
46
            }
47
        }
48
    }
49
}
50