| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function trigger(string $event, array $payload = null) : void { |
||
| 28 | |||
| 29 | Logger::getInstance()->add(Logger::LEVEL_DEBUG, 'Event triggered: ' . $event); |
||
|
|
|||
| 30 | |||
| 31 | if(!isset($this->_subscriber[$event])) { |
||
| 32 | return; |
||
| 33 | } |
||
| 34 | |||
| 35 | foreach($this->_subscriber[$event] as $callable) { |
||
| 36 | $callable($event, $payload); |
||
| 37 | } |
||
| 39 | } |