InstanceStatusCollection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 28.57%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 35
rs 10
ccs 2
cts 7
cp 0.2857
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 3 1
A getInstanceStatuses() 0 3 1
A jsonSerialize() 0 3 1
1
<?php
2
3
namespace Jalle19\StatusManager\Instance;
4
5
/**
6
 * Class InstanceStatusCollection\Instance
7
 * @package   Jalle19\StatusManager
8
 * @copyright Copyright &copy; Sam Stenvall 2015-
9
 * @license   https://www.gnu.org/licenses/gpl.html The GNU General Public License v2.0
10
 */
11
class InstanceStatusCollection implements \JsonSerializable
12
{
13
14
	/**
15
	 * @var InstanceStatus[] the collected status messages
16
	 */
17
	private $_messages = [];
18
19
20
	/**
21
	 * Adds an instance status to the collection
22
	 *
23
	 * @param InstanceStatus $message
24
	 */
25
	public function add(InstanceStatus $message)
26
	{
27
		$this->_messages[] = $message;
28
	}
29
30
31
	/**
32
	 * @return InstanceStatus[]
33
	 */
34
	public function getInstanceStatuses()
35
	{
36
		return $this->_messages;
37
	}
38
39
40
	/**
41
	 * @inheritdoc
42
	 */
43 1
	public function jsonSerialize()
44
	{
45 1
		return $this->_messages;
46
	}
47
48
}
49