Passed
Pull Request — master (#1779)
by Nico
49:51 queued 23:55
created

ChangeAlertStateToRed   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 8
ccs 0
cts 4
cp 0
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A action() 0 6 2
1
<?php
2
3
namespace Stu\Lib\Pirate\Behaviour;
4
5
use Stu\Component\Ship\ShipAlertStateEnum;
6
use Stu\Lib\Pirate\PirateReactionInterface;
7
use Stu\Module\Ship\Lib\FleetWrapperInterface;
8
9
class ChangeAlertStateToRed implements PirateBehaviourInterface
10
{
11
    public function action(FleetWrapperInterface $fleet, PirateReactionInterface $pirateReaction): void
12
    {
13
        $fleet = $fleet->get();
14
15
        foreach ($fleet->getShips() as $ship) {
16
            $ship->setAlertState(ShipAlertStateEnum::ALERT_RED);
17
        }
18
    }
19
}
20