Passed
Push — master ( f4068b...77f637 )
by Nico
40:27 queued 14:09
created

TakeoverConsequence   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A triggerSpecific() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Ship\Lib\Movement\Component\Consequence\Flight;
6
7
use Stu\Module\Ship\Lib\Interaction\ShipTakeoverManagerInterface;
8
use Stu\Module\Ship\Lib\Message\MessageCollectionInterface;
9
use Stu\Module\Ship\Lib\Movement\Component\Consequence\AbstractFlightConsequence;
10
use Stu\Module\Ship\Lib\Movement\Route\FlightRouteInterface;
11
use Stu\Module\Ship\Lib\ShipWrapperInterface;
12
13
class TakeoverConsequence extends AbstractFlightConsequence
14
{
15
    private ShipTakeoverManagerInterface $shipTakeoverManager;
16
17 3
    public function __construct(ShipTakeoverManagerInterface $shipTakeoverManager)
18
    {
19 3
        $this->shipTakeoverManager = $shipTakeoverManager;
20
    }
21
22 1
    protected function triggerSpecific(
23
        ShipWrapperInterface $wrapper,
24
        FlightRouteInterface $flightRoute,
25
        MessageCollectionInterface $messages
26
    ): void {
27
28 1
        $ship = $wrapper->get();
29
30 1
        $this->shipTakeoverManager->cancelBothTakeover(
31 1
            $ship,
32 1
            ', da das Schiff bewegt wurde'
33 1
        );
34
    }
35
}
36