1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Stu\Module\Spacecraft\Lib\Movement\Component\Consequence\Flight; |
6
|
|
|
|
7
|
|
|
use Override; |
|
|
|
|
8
|
|
|
use Stu\Component\Spacecraft\System\Utility\TractorMassPayloadUtilInterface; |
9
|
|
|
use Stu\Module\Ship\Lib\CancelColonyBlockOrDefendInterface; |
10
|
|
|
use Stu\Module\Spacecraft\Lib\Message\MessageCollectionInterface; |
11
|
|
|
use Stu\Module\Spacecraft\Lib\Message\MessageFactoryInterface; |
12
|
|
|
use Stu\Module\Spacecraft\Lib\Movement\Component\Consequence\AbstractFlightConsequence; |
13
|
|
|
use Stu\Module\Spacecraft\Lib\Movement\Route\FlightRouteInterface; |
14
|
|
|
use Stu\Module\Spacecraft\Lib\SpacecraftWrapperInterface; |
15
|
|
|
|
16
|
|
|
class TractorConsequence extends AbstractFlightConsequence implements FlightStartConsequenceInterface |
17
|
|
|
{ |
18
|
4 |
|
public function __construct( |
19
|
|
|
private TractorMassPayloadUtilInterface $tractorMassPayloadUtil, |
20
|
|
|
private CancelColonyBlockOrDefendInterface $cancelColonyBlockOrDefend, |
21
|
|
|
private MessageFactoryInterface $messageFactory |
22
|
4 |
|
) {} |
23
|
|
|
|
24
|
6 |
|
#[Override] |
25
|
|
|
protected function skipWhenTractored(): bool |
26
|
|
|
{ |
27
|
6 |
|
return true; |
28
|
|
|
} |
29
|
|
|
|
30
|
6 |
|
#[Override] |
31
|
|
|
protected function triggerSpecific( |
32
|
|
|
SpacecraftWrapperInterface $wrapper, |
33
|
|
|
FlightRouteInterface $flightRoute, |
34
|
|
|
MessageCollectionInterface $messages |
35
|
|
|
): void { |
36
|
|
|
|
37
|
6 |
|
$ship = $wrapper->get(); |
38
|
|
|
|
39
|
6 |
|
$tractoredShip = $ship->getTractoredShip(); |
40
|
6 |
|
if ($tractoredShip === null) { |
41
|
4 |
|
return; |
42
|
|
|
} |
43
|
|
|
|
44
|
2 |
|
$message = $this->messageFactory->createMessage(); |
45
|
2 |
|
$messages->add($message); |
46
|
|
|
|
47
|
|
|
//can tow tractored ship? |
48
|
2 |
|
$canTowTractoredShip = $this->tractorMassPayloadUtil->tryToTow($wrapper, $tractoredShip, $message); |
49
|
2 |
|
if ($canTowTractoredShip) { |
50
|
1 |
|
$this->cancelColonyBlockOrDefend->work($ship, $message, true); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths