Passed
Push — dev ( 220852...a22d66 )
by Janko
21:21
created

ChangeAlertStateToRed   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

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