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