EventStateStorage::addEventState()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
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