Container::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 7
1
<?php
2
3
namespace Dock\Docker\Containers;
4
5
class Container
6
{
7
    const STATE_UNKNOWN = 'unknown';
8
    const STATE_RUNNING = 'running';
9
    const STATE_EXITED = 'exited';
10
11
    /**
12
     * @var string
13
     */
14
    private $name;
15
    /**
16
     * @var string
17
     */
18
    private $image;
19
    /**
20
     * @var array
21
     */
22
    private $hosts;
23
    /**
24
     * @var string
25
     */
26
    private $state;
27
    /**
28
     * @var array
29
     */
30
    private $ports;
31
    /**
32
     * @var string
33
     */
34
    private $componentName;
35
    /**
36
     * @var string
37
     */
38
    private $ipAddress;
39
40
    /**
41
     * @param string $name
42
     * @param string $image
43
     * @param string $state
44
     * @param array  $hosts
45
     * @param array  $ports
46
     * @param string $componentName
47
     * @param null   $ipAddress
48
     */
49
    public function __construct($name, $image, $state = self::STATE_UNKNOWN, array $hosts = [], array $ports = [], $componentName = null, $ipAddress = null)
50
    {
51
        $this->name = $name;
52
        $this->image = $image;
53
        $this->hosts = $hosts;
54
        $this->state = $state;
55
        $this->ports = $ports;
56
        $this->componentName = $componentName;
57
        $this->ipAddress = $ipAddress;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function getName()
64
    {
65
        return $this->name;
66
    }
67
68
    /**
69
     * @return string
70
     */
71
    public function getImage()
72
    {
73
        return $this->image;
74
    }
75
76
    /**
77
     * @return array
78
     */
79
    public function getHosts()
80
    {
81
        return $this->hosts;
82
    }
83
84
    /**
85
     * @return string
86
     */
87
    public function getState()
88
    {
89
        return $this->state;
90
    }
91
92
    /**
93
     * @return array
94
     */
95
    public function getPorts()
96
    {
97
        return $this->ports;
98
    }
99
100
    /**
101
     * @return string
102
     */
103
    public function getComponentName()
104
    {
105
        return $this->componentName;
106
    }
107
108
    /**
109
     * @return string
110
     */
111
    public function getIpAddress()
112
    {
113
        return $this->ipAddress;
114
    }
115
}
116