Completed
Push — master ( b2dfe1...1412d2 )
by Sam
02:32
created

InstanceStatusCollection::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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
	public function jsonSerialize()
44
	{
45
		return $this->_messages;
46
	}
47
48
}
49