| Conditions | 5 |
| Paths | 6 |
| Total Lines | 26 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function handleShipDestruction( |
||
| 20 | ?ShipDestroyerInterface $destroyer, |
||
| 21 | ShipWrapperInterface $destroyedShipWrapper, |
||
| 22 | ShipDestructionCauseEnum $cause, |
||
|
|
|||
| 23 | InformationInterface $informations |
||
| 24 | ): void { |
||
| 25 | |||
| 26 | if ($destroyer === null) { |
||
| 27 | return; |
||
| 28 | } |
||
| 29 | |||
| 30 | $ship = $destroyedShipWrapper->get(); |
||
| 31 | $targetPrestige = $ship->getRump()->getPrestige(); |
||
| 32 | if ($targetPrestige < 1) { |
||
| 33 | return; |
||
| 34 | } |
||
| 35 | |||
| 36 | $destroyerUser = $destroyer->getUser(); |
||
| 37 | $userOfDestroyed = $destroyedShipWrapper->get()->getUser(); |
||
| 38 | |||
| 39 | if ($destroyerUser->getId() === UserEnum::USER_NPC_KAZON) { |
||
| 40 | $this->pirateWrathManager->decreaseWrath($userOfDestroyed, $targetPrestige); |
||
| 41 | } |
||
| 42 | |||
| 43 | if ($userOfDestroyed->getId() === UserEnum::USER_NPC_KAZON) { |
||
| 44 | $this->pirateWrathManager->increaseWrath($userOfDestroyed, $targetPrestige); |
||
| 45 | } |
||
| 48 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.