Conditions | 4 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function buildProperty( |
||
19 | PostTransformEvent $event, |
||
20 | string $supportedModelClass, |
||
21 | callable $callback |
||
22 | ): void |
||
23 | { |
||
24 | $model = $event->getObject(); |
||
25 | |||
26 | if (!$model instanceof $supportedModelClass || ($model instanceof ToggleableInterface && !$model->isEnabled())) { |
||
27 | return; |
||
28 | } |
||
29 | |||
30 | $document = $event->getDocument(); |
||
31 | |||
32 | $callback($model, $document); |
||
33 | } |
||
42 |