We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 2 |
Paths | 2 |
Total Lines | 22 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
18 | public function build(SmrAccount $account): never { |
||
19 | // Move a port from one sector to another |
||
20 | $targetSectorID = Request::getInt('TargetSectorID'); |
||
21 | $origSectorID = Request::getInt('OrigSectorID'); |
||
22 | $targetSector = SmrSector::getSector($this->gameID, $targetSectorID); |
||
23 | |||
24 | // Skip if target sector already has a port |
||
25 | if (!$targetSector->hasPort()) { |
||
26 | $oldPort = SmrPort::getPort($this->gameID, $origSectorID); |
||
27 | |||
28 | $newPort = SmrPort::createPort($this->gameID, $targetSectorID); |
||
29 | $newPort->setRaceID($oldPort->getRaceID()); |
||
30 | $newPort->setLevel($oldPort->getLevel()); |
||
31 | $newPort->setPortGoods($oldPort->getGoodTransactions()); |
||
32 | $newPort->setCreditsToDefault(); |
||
33 | $newPort->update(); |
||
34 | |||
35 | SmrPort::removePort($this->gameID, $origSectorID); |
||
36 | } |
||
37 | |||
38 | $container = new EditGalaxy($this->gameID, $this->galaxyID); |
||
39 | $container->go(); |
||
40 | } |
||
43 |