| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function preRemove( |
||
| 25 | Wander $wander, |
||
| 26 | /** @scrutinizer ignore-unused */ LifecycleEventArgs $event |
||
| 27 | ): void { |
||
| 28 | // If we're about to delete a wander, we want to remove it as a featuring |
||
| 29 | // wander from the related Image first, otherwise we'll break referential |
||
| 30 | // integrity. |
||
| 31 | $image = $wander->getFeaturedImage(); |
||
| 32 | if ($image !== null) { |
||
| 33 | $image->setFeaturingWander(null); |
||
| 34 | } |
||
| 50 | } |