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

TakeoverConsequence::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
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