Conditions | 5 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 11.4436 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | 1 | public function notify(string $type, ModelInterface $model) |
|
25 | { |
||
26 | 1 | if (!$this->isEnabled()) { |
|
27 | return; |
||
28 | } |
||
29 | |||
30 | 1 | if (!$this->mustTakeAction($type)) { |
|
31 | 1 | return; |
|
32 | } |
||
33 | |||
34 | $options = $this->getOptions($type); |
||
35 | if (empty($options)) { |
||
36 | return; |
||
37 | } |
||
38 | |||
39 | foreach ($options as $action => $value) { |
||
40 | assert(is_callable($value)); |
||
41 | $value($model, $action); |
||
42 | } |
||
45 |