for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Stu\Module\Ship\Lib\Destruction\Handler;
use Stu\Lib\Information\InformationInterface;
use Stu\Lib\Pirate\Component\PirateWrathManagerInterface;
use Stu\Module\PlayerSetting\Lib\UserEnum;
use Stu\Module\Ship\Lib\Destruction\ShipDestroyerInterface;
use Stu\Module\Ship\Lib\Destruction\ShipDestructionCauseEnum;
use Stu\Module\Ship\Lib\ShipWrapperInterface;
class UpdatePirateWrath
{
public function __construct(
private PirateWrathManagerInterface $pirateWrathManager
) {
}
public function handleShipDestruction(
?ShipDestroyerInterface $destroyer,
ShipWrapperInterface $destroyedShipWrapper,
ShipDestructionCauseEnum $cause,
$cause
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
/** @scrutinizer ignore-unused */ ShipDestructionCauseEnum $cause,
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
InformationInterface $informations
$informations
/** @scrutinizer ignore-unused */ InformationInterface $informations
): void {
if ($destroyer === null) {
return;
$ship = $destroyedShipWrapper->get();
$targetPrestige = $ship->getRump()->getPrestige();
if ($targetPrestige < 1) {
$destroyerUser = $destroyer->getUser();
$userOfDestroyed = $destroyedShipWrapper->get()->getUser();
if ($destroyerUser->getId() === UserEnum::USER_NPC_KAZON) {
$this->pirateWrathManager->decreaseWrath($userOfDestroyed, $targetPrestige);
if ($userOfDestroyed->getId() === UserEnum::USER_NPC_KAZON) {
$this->pirateWrathManager->increaseWrath($userOfDestroyed, $targetPrestige);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.