| Conditions | 5 |
| Paths | 7 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | protected function trigger(string $event): bool |
||
| 50 | { |
||
| 51 | if (!$this->withEvent) { |
||
| 52 | return true; |
||
| 53 | } |
||
| 54 | |||
| 55 | $call = 'on' . App::parseName($event, 1); |
||
| 56 | |||
| 57 | try { |
||
| 58 | if (method_exists(static::class, $call)) { |
||
| 59 | $result = Container::getInstance()->invoke([static::class, $call], [$this]); |
||
| 60 | } else { |
||
| 61 | $result = true; |
||
| 62 | } |
||
| 63 | |||
| 64 | return false === $result ? false : true; |
||
| 65 | } catch (ModelEventException $e) { |
||
| 66 | return false; |
||
| 67 | } |
||
| 70 |