| Total Complexity | 8 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class PrestigeCalculation implements PrestigeCalculationInterface |
||
| 10 | { |
||
| 11 | |||
| 12 | 3 | public function getPrestigeOfSpacecraftOrFleet(ShipWrapperInterface|ShipInterface $spacecraft): int |
|
| 26 | } |
||
| 27 | |||
| 28 | 3 | public function targetHasPositivePrestige(ShipInterface $target): bool |
|
| 29 | { |
||
| 30 | 3 | $fleet = $target->getFleet(); |
|
| 31 | 3 | if ($fleet !== null) { |
|
| 32 | 1 | foreach ($fleet->getShips() as $ship) { |
|
| 33 | 1 | if ($ship->getRump()->getPrestige() > 0) { |
|
| 34 | 1 | return true; |
|
| 35 | } |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | 2 | return $target->getRump()->getPrestige() > 0; |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | public function getPrestigeOfBattleParty(BattlePartyInterface $battleParty): int |
|
| 49 | 1 | ); |
|
| 50 | } |
||
| 52 |