Total Complexity | 6 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class Notifier |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * @var ObserverStore |
||
10 | */ |
||
11 | private $observerStore; |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $notifier; |
||
16 | |||
17 | 317 | public function __construct(ObserverStore $observerStore, string $notifier) |
|
21 | 317 | } |
|
22 | |||
23 | 1 | public function attach($observer) |
|
24 | { |
||
25 | 1 | $this->observerStore->attach($this->notifier, $observer); |
|
26 | 1 | } |
|
27 | |||
28 | 1 | public function detach($observer) |
|
29 | { |
||
30 | 1 | $this->observerStore->detach($this->notifier, $observer); |
|
31 | 1 | } |
|
32 | |||
33 | 152 | public function notify($method, ...$params) |
|
39 | } |
||
40 | } |
||
41 | 152 | } |
|
43 | } |