| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function refactor(): void |
||
| 20 | { |
||
| 21 | foreach ($this->shipRepository->findAll() as $ship) { |
||
| 22 | |||
| 23 | $astroStartTurn = $ship->getAstroStartTurn(); |
||
| 24 | if ($astroStartTurn === null) { |
||
| 25 | continue; |
||
| 26 | } |
||
| 27 | |||
| 28 | $astroLab = $this->shipWrapperFactory |
||
| 29 | ->wrapShip($ship) |
||
| 30 | ->getAstroLaboratorySystemData(); |
||
| 31 | |||
| 32 | if ($astroLab === null) { |
||
| 33 | throw new RuntimeException('this should not happen'); |
||
| 34 | } |
||
| 35 | |||
| 36 | $astroLab |
||
| 37 | ->setAstroStartTurn($astroStartTurn) |
||
| 38 | ->update(); |
||
| 39 | } |
||
| 42 |