Passed
Push — master ( 288b46...98b0e3 )
by Nico
31:30 queued 08:00
created

AbstractFlightConsequence   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A trigger() 0 13 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Ship\Lib\Movement\Component\Consequence;
6
7
use Stu\Module\Ship\Lib\Message\MessageCollectionInterface;
8
use Stu\Module\Ship\Lib\Movement\Route\FlightRouteInterface;
9
use Stu\Module\Ship\Lib\ShipWrapperInterface;
10
11
abstract class AbstractFlightConsequence implements FlightConsequenceInterface
12
{
13 84
    public function trigger(
14
        ShipWrapperInterface $wrapper,
15
        FlightRouteInterface $flightRoute,
16
        MessageCollectionInterface $messages
17
    ): void {
18 84
        if ($wrapper->get()->isDestroyed()) {
19 15
            return;
20
        }
21
22 69
        $this->triggerSpecific(
23 69
            $wrapper,
24 69
            $flightRoute,
25 69
            $messages
26 69
        );
27
    }
28
29
    protected abstract function triggerSpecific(
30
        ShipWrapperInterface $wrapper,
31
        FlightRouteInterface $flightRoute,
32
        MessageCollectionInterface $messages
33
    ): void;
34
}
35