|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Stu\Module\Ship\Lib\Movement\Component\Consequence\Flight; |
|
6
|
|
|
|
|
7
|
|
|
use Override; |
|
|
|
|
|
|
8
|
|
|
use Stu\Component\Ship\System\Utility\TractorMassPayloadUtilInterface; |
|
9
|
|
|
use Stu\Module\Ship\Lib\CancelColonyBlockOrDefendInterface; |
|
10
|
|
|
use Stu\Module\Ship\Lib\Message\MessageCollectionInterface; |
|
11
|
|
|
use Stu\Module\Ship\Lib\Message\MessageFactoryInterface; |
|
12
|
|
|
use Stu\Module\Ship\Lib\Movement\Component\Consequence\AbstractFlightConsequence; |
|
13
|
|
|
use Stu\Module\Ship\Lib\Movement\Route\FlightRouteInterface; |
|
14
|
|
|
use Stu\Module\Ship\Lib\ShipWrapperInterface; |
|
15
|
|
|
|
|
16
|
|
|
class TractorConsequence extends AbstractFlightConsequence |
|
17
|
|
|
{ |
|
18
|
4 |
|
public function __construct( |
|
19
|
|
|
private TractorMassPayloadUtilInterface $tractorMassPayloadUtil, |
|
20
|
|
|
private CancelColonyBlockOrDefendInterface $cancelColonyBlockOrDefend, |
|
21
|
|
|
private MessageFactoryInterface $messageFactory |
|
22
|
4 |
|
) {} |
|
23
|
|
|
|
|
24
|
2 |
|
#[Override] |
|
25
|
|
|
protected function triggerSpecific( |
|
26
|
|
|
ShipWrapperInterface $wrapper, |
|
27
|
|
|
FlightRouteInterface $flightRoute, |
|
28
|
|
|
MessageCollectionInterface $messages |
|
29
|
|
|
): void { |
|
30
|
|
|
|
|
31
|
2 |
|
$ship = $wrapper->get(); |
|
32
|
|
|
|
|
33
|
2 |
|
$tractoredShip = $ship->getTractoredShip(); |
|
34
|
2 |
|
if ($tractoredShip === null) { |
|
35
|
|
|
return; |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
2 |
|
$message = $this->messageFactory->createMessage(); |
|
39
|
2 |
|
$messages->add($message); |
|
40
|
|
|
|
|
41
|
|
|
//can tow tractored ship? |
|
42
|
2 |
|
$canTowTractoredShip = $this->tractorMassPayloadUtil->tryToTow($wrapper, $tractoredShip, $message); |
|
43
|
2 |
|
if ($canTowTractoredShip) { |
|
44
|
1 |
|
$this->cancelColonyBlockOrDefend->work($ship, $message, true); |
|
45
|
|
|
} |
|
46
|
|
|
} |
|
47
|
|
|
} |
|
48
|
|
|
|
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