@@ -96,7 +96,7 @@ |
||
96 | 96 | |
97 | 97 | protected function calculateCorruptionBoundary(): Etherum |
98 | 98 | { |
99 | - $ascension = $this->talentCollection->findSecretKnowledge()?->getAscension(); |
|
99 | + $ascension = $this->talentCollection->findSecretKnowledge() ? ->getAscension(); |
|
100 | 100 | if ($ascension === null) { |
101 | 101 | return new Etherum(2); |
102 | 102 | } |
@@ -141,7 +141,7 @@ |
||
141 | 141 | { |
142 | 142 | $this->etherum->increaseBy($etherum); |
143 | 143 | |
144 | - $playerAscension = $this->talentCollection->findSecretKnowledge()?->getAscension() |
|
144 | + $playerAscension = $this->talentCollection->findSecretKnowledge() ? ->getAscension() |
|
145 | 145 | ?? throw PlayerException::etherumOverdose(); |
146 | 146 | |
147 | 147 | $corruptionBoundary = $this->calculateCorruptionBoundary(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ); |
80 | 80 | } |
81 | 81 | |
82 | - private function askForPlayerAction(PlayerAction $playerAction): Attack|Consumable |
|
82 | + private function askForPlayerAction(PlayerAction $playerAction): Attack | Consumable |
|
83 | 83 | { |
84 | 84 | $action = $playerAction->askForChoice( |
85 | 85 | 'Select action', |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | private function validatePlayerAction( |
104 | - Attack|Consumable $action, |
|
104 | + Attack | Consumable $action, |
|
105 | 105 | PlayerAction $playerAction, |
106 | - ): Attack|Consumable { |
|
106 | + ): Attack | Consumable { |
|
107 | 107 | if ($action instanceof MeleeAttack && $this->player->hasWeapon() === false) { |
108 | 108 | $playerAction->note('This attack requires weapon equipped.'); |
109 | 109 | return $this->askForPlayerAction($playerAction); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | private function findOpponent(Fighter $fighter, PlayerAction $playerAction): Fighter |
121 | 121 | { |
122 | - return match (true) { |
|
122 | + return match(true) { |
|
123 | 123 | $fighter instanceof Player && $this->opponents->count() > 1 |
124 | 124 | => $playerAction->askForChoice('Select opponent to attack', $this->opponents->getItems()), |
125 | 125 | $fighter instanceof Player => $this->opponents->first(), |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | public function __toString(): string |
28 | 28 | { |
29 | - return match ($this->value) { |
|
29 | + return match($this->value) { |
|
30 | 30 | 1 => 'low', |
31 | 31 | 2 => 'medium', |
32 | 32 | 3 => 'high', |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'talents' => self::normalizeTalents($player->getTalents()), |
29 | 29 | 'inventory' => self::normalizeInventory($player->getInventory()), |
30 | 30 | 'weapon' => $player->getWeapon() !== null ? self::normalizeWeapon($player->getWeapon()) : null, |
31 | - 'corruption' => $player->getCorruption()?->get(), |
|
31 | + 'corruption' => $player->getCorruption() ? ->get(), |
|
32 | 32 | 'levelProgress' => [ |
33 | 33 | 'level' => $player->getLevelProgress()->getLevel()->get(), |
34 | 34 | 'currentExperience' => $player->getLevelProgress()->getCurrentExperience()->get(), |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | static function(Talent $talent): array { |
47 | 47 | $data = ['className' => get_class($talent)]; |
48 | 48 | |
49 | - return match (true) { |
|
49 | + return match(true) { |
|
50 | 50 | $talent instanceof SecretKnowledge => array_merge($data, [ |
51 | 51 | 'ascension' => $talent->getAscension()->get(), |
52 | 52 | ]), |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $data = ['className' => get_class($weapon)]; |
67 | 67 | |
68 | - return match (true) { |
|
68 | + return match(true) { |
|
69 | 69 | $weapon instanceof RebredirWeapon => array_merge($data, [ |
70 | 70 | 'etherumLoad' => $weapon->getEtherumLoad()->get(), |
71 | 71 | ]), |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | return map( |
79 | 79 | static function(InventoryItem $inventoryItem): array { |
80 | - return match (true) { |
|
80 | + return match(true) { |
|
81 | 81 | $inventoryItem instanceof Weapon => self::normalizeWeapon($inventoryItem), |
82 | 82 | default => ['className' => get_class($inventoryItem)], |
83 | 83 | }; |