| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function init() |
||
| 33 | { |
||
| 34 | $data = ParamsExpander::expand($this, ['class']); |
||
| 35 | $class = ''; |
||
| 36 | if (isset($data['class'])) |
||
| 37 | { |
||
| 38 | $class = $data['class']; |
||
| 39 | } |
||
| 40 | // Log only, as it is designed as soft-fail |
||
| 41 | if (empty($class) || !ClassChecker::exists($class)) |
||
| 42 | { |
||
| 43 | (new Signal)->getLogger()->warning(sprintf('Class not found for @SignalFor on model `%s`', $this->getMeta()->type()->name)); |
||
| 44 | return; |
||
| 45 | } |
||
| 46 | NameNormalizer::normalize($class); |
||
| 47 | $this->getEntity()->signalFor[] = $class; |
||
| 48 | } |
||
| 49 | |||
| 51 |