FloatingIp   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

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