Conditions | 5 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function refactor(): void |
||
26 | { |
||
27 | foreach ($this->shipRepository->findAll() as $ship) { |
||
28 | if (!$ship->hasShipSystem(ShipSystemTypeEnum::SYSTEM_WARPCORE)) { |
||
29 | continue; |
||
30 | } |
||
31 | |||
32 | $wrapper = $this->shipWrapperFactory->wrapShip($ship); |
||
33 | |||
34 | $warpcore = $wrapper->getWarpCoreSystemData(); |
||
35 | $warpdrive = $wrapper->getWarpDriveSystemData(); |
||
36 | |||
37 | if ($warpcore === null || $warpdrive === null) { |
||
38 | continue; |
||
39 | } |
||
40 | |||
41 | $warpdrive->setWarpCoreSplit($warpcore->getWarpCoreSplit()) |
||
|
|||
42 | ->update(); |
||
43 | } |
||
46 |