Skip to content

Commit

Permalink
Code style refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lanedirt committed Dec 15, 2024
1 parent acbfd20 commit 9913a00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions app/GameMissions/BattleEngine/BattleEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ private function calculateDebris(UnitCollection $attackerUnitsLost, UnitCollecti
* @param Resources $debris
* @return int
*/
private function calculateMoonChance(Resources $debris): int {
private function calculateMoonChance(Resources $debris): int
{
$max_moon_chance = $this->settings->maximumMoonChance();

// Every 100k debris results in 1% moon chance, up to a maximum
Expand All @@ -420,7 +421,8 @@ private function calculateMoonChance(Resources $debris): int {
* @param int $moonChance
* @return bool
*/
private function rollMoonCreation($moonChance): bool {
private function rollMoonCreation($moonChance): bool
{
$dice = rand(1, 100);
return $dice <= $moonChance;
}
Expand Down
4 changes: 1 addition & 3 deletions app/Services/PlayerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace OGame\Services;

use Exception;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
Expand Down Expand Up @@ -56,8 +55,7 @@ public function __construct(int $player_id)
// Load the player object if a positive player ID is given.
if ($player_id !== 0) {
$this->load($player_id);
}
else {
} else {
// If no player ID is given then an actual player context will not be available.
// This is expected for unittests, that's why we create a dummy user object here.
$this->user = new User();
Expand Down

0 comments on commit 9913a00

Please sign in to comment.