Passed
Pull Request — master (#10)
by Alice
02:01
created

AbstractThreadMediator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 24
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setMediator() 0 3 1
A getMediator() 0 3 1
A notify() 0 3 1
1
<?php
2
3
namespace Wonderland\Thread;
4
5
use Wonderland\Thread\Mediator\Event\EventInterface;
6
use Wonderland\Thread\Mediator\Mediator;
7
8
class AbstractThreadMediator
9
{
10
	/** @var Mediator */
11
	private $mediator;
12
13
	/**
14
	 * @return Mediator
15
	 */
16 1
	protected function getMediator()
17
	{
18 1
		return $this->mediator;
19
	}
20
21 5
	public function setMediator(Mediator $mediator)
22
	{
23 5
		$this->mediator = $mediator;
24 5
	}
25
26
	/**
27
	 * @param EventInterface $event
28
	 */
29 1
	protected function notify(EventInterface $event)
30
	{
31 1
		$this->getMediator()->notify($event);
32 1
	}
33
34
}
35