@@ -76,7 +76,7 @@ |
||
76 | 76 | |
77 | 77 | private static function getRequiredExperience(Level $level): Experience |
78 | 78 | { |
79 | - return match (true) { |
|
79 | + return match(true) { |
|
80 | 80 | $level->isGreaterThan(new Level(10)) => new Experience(2000), |
81 | 81 | $level->isGreaterThan(new Level(20)) => new Experience(3000), |
82 | 82 | default => new Experience(1000), |
@@ -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->getWeapon() === null) { |
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(), |