We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -1,23 +1,32 @@ |
||
| 1 | 1 | <?php declare(strict_types=1); |
| 2 | 2 | |
| 3 | -if (isset($var['from'])) $start = $var['from']; |
|
| 4 | -else $start = trim($_POST['from']); |
|
| 5 | -if (isset($var['to'])) $target = $var['to']; |
|
| 6 | -else $target = trim($_POST['to']); |
|
| 3 | +if (isset($var['from'])) { |
|
| 4 | + $start = $var['from']; |
|
| 5 | +} else { |
|
| 6 | + $start = trim($_POST['from']); |
|
| 7 | +} |
|
| 8 | +if (isset($var['to'])) { |
|
| 9 | + $target = $var['to']; |
|
| 10 | +} else { |
|
| 11 | + $target = trim($_POST['to']); |
|
| 12 | +} |
|
| 7 | 13 | |
| 8 | 14 | // perform some basic checks on both numbers |
| 9 | -if (empty($start) || empty($target)) |
|
| 15 | +if (empty($start) || empty($target)) { |
|
| 10 | 16 | create_error('Where do you want to go today?'); |
| 17 | +} |
|
| 11 | 18 | |
| 12 | 19 | |
| 13 | -if (!is_numeric($start) || !is_numeric($target)) |
|
| 20 | +if (!is_numeric($start) || !is_numeric($target)) { |
|
| 14 | 21 | create_error('Please enter only numbers!'); |
| 22 | +} |
|
| 15 | 23 | |
| 16 | 24 | $start = abs(str_replace('.', '', $start)); |
| 17 | 25 | $target = abs(str_replace('.', '', $target)); |
| 18 | 26 | |
| 19 | -if ($start == $target) |
|
| 27 | +if ($start == $target) { |
|
| 20 | 28 | create_error('Hmmmm...if ' . $start . '=' . $target . ' then that means...YOU\'RE ALREADY THERE! *cough*you\'re real smart*cough*'); |
| 29 | +} |
|
| 21 | 30 | |
| 22 | 31 | try { |
| 23 | 32 | $startSector = SmrSector::getSector($player->getGameID(), $start); |