EventStateStorage   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
c 3
b 0
f 0
lcom 1
cbo 0
dl 0
loc 32
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addEventState() 0 4 1
A getEventState() 0 7 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