Total Complexity | 6 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 60% |
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 | 306 | public function __construct(ObserverStore $observerStore, string $notifier) |
|
21 | 306 | } |
|
22 | |||
23 | public function attach($observer) |
||
24 | { |
||
25 | $this->observerStore->attach($this->notifier, $observer); |
||
26 | } |
||
27 | |||
28 | public function detach($observer) |
||
29 | { |
||
30 | $this->observerStore->detach($this->notifier, $observer); |
||
31 | } |
||
32 | |||
33 | 151 | public function notify($method, ...$params) |
|
39 | } |
||
40 | } |
||
41 | 151 | } |
|
43 | } |