EventStateStorage::getEventState()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
rs 9.4285
1
<?php
2
3
namespace Symnedi\EventDispatcher\Tests\NetteEvent;
4
5
use Symfony\Component\EventDispatcher\Event;
6
7
8
class EventStateStorage
9
{
10
11
	/**
12
	 * @var string[]
13
	 */
14
	private $storage;
15
16
17
	/**
18
	 * @param string $event
19
	 * @param Event $state
20
	 */
21
	public function addEventState($event, Event $state)
22
	{
23
		$this->storage[$event] = $state;
24
	}
25
26
27
	/**
28
	 * @param string $event
29
	 * @return Event
30
	 */
31
	public function getEventState($event)
32
	{
33
		if (isset($this->storage[$event])) {
34
			return $this->storage[$event];
35
		}
36
		return FALSE;
37
	}
38
39
}
40