| @@ -54,7 +54,7 @@ | ||
| 54 | 54 | |
| 55 | 55 | public function __toString(): string | 
| 56 | 56 |      { | 
| 57 | -        return match ($this->value) { | |
| 57 | +        return match($this->value) { | |
| 58 | 58 | self::INEXPERIENCED => 'inexperienced', | 
| 59 | 59 | self::NOVICE => 'novice', | 
| 60 | 60 | self::WARRIOR => 'warrior', | 
| @@ -14,7 +14,7 @@ discard block | ||
| 14 | 14 | public function findWeaponMasteryForWeaponType(WeaponType $weaponType): ?WeaponMastery | 
| 15 | 15 |      { | 
| 16 | 16 | return $this->filter( | 
| 17 | - static fn(Talent $talent): bool => | |
| 17 | + static fn(Talent $talent) : bool => | |
| 18 | 18 | $talent instanceof WeaponMastery && $talent->getType()->equals($weaponType), | 
| 19 | 19 | )->getIterator()->current(); | 
| 20 | 20 | } | 
| @@ -22,7 +22,7 @@ discard block | ||
| 22 | 22 | public function findSecretKnowledge(): ?SecretKnowledge | 
| 23 | 23 |      { | 
| 24 | 24 | return $this->filter( | 
| 25 | - static fn(Talent $talent): bool => $talent instanceof SecretKnowledge, | |
| 25 | + static fn(Talent $talent) : bool => $talent instanceof SecretKnowledge, | |
| 26 | 26 | )->getIterator()->current(); | 
| 27 | 27 | } | 
| 28 | 28 | |
| @@ -61,7 +61,7 @@ discard block | ||
| 61 | 61 | |
| 62 | 62 | public function getRequiredEtherum(): Etherum | 
| 63 | 63 |      { | 
| 64 | -        return match ($this->value) { | |
| 64 | +        return match($this->value) { | |
| 65 | 65 | self::FIRST_ASCENSION => new Etherum(1), | 
| 66 | 66 | self::SECOND_ASCENSION => new Etherum(2), | 
| 67 | 67 | self::THIRD_ASCENSION => new Etherum(4), | 
| @@ -76,7 +76,7 @@ discard block | ||
| 76 | 76 | |
| 77 | 77 | public function __toString(): string | 
| 78 | 78 |      { | 
| 79 | -        return match ($this->value) { | |
| 79 | +        return match($this->value) { | |
| 80 | 80 | self::FIRST_ASCENSION => 'First Ascension', | 
| 81 | 81 | self::SECOND_ASCENSION => 'Second Ascension', | 
| 82 | 82 | self::THIRD_ASCENSION => 'Third Ascension', | 
| @@ -66,7 +66,7 @@ discard block | ||
| 66 | 66 | return; | 
| 67 | 67 | } | 
| 68 | 68 | |
| 69 | - $playerAscension = $this->talentCollection->findSecretKnowledge()?->getAscension() | |
| 69 | + $playerAscension = $this->talentCollection->findSecretKnowledge() ? ->getAscension() | |
| 70 | 70 | ?? throw PlayerException::etherumOverdose(); | 
| 71 | 71 | |
| 72 | 72 | $corruptionBoundary = $this->calculateCorruptionBoundary(); | 
| @@ -92,7 +92,7 @@ discard block | ||
| 92 | 92 | |
| 93 | 93 | private function calculateCorruptionBoundary(): Etherum | 
| 94 | 94 |      { | 
| 95 | - $ascension = $this->talentCollection->findSecretKnowledge()?->getAscension(); | |
| 95 | + $ascension = $this->talentCollection->findSecretKnowledge() ? ->getAscension(); | |
| 96 | 96 |          if ($ascension === null) { | 
| 97 | 97 | return new Etherum(2); | 
| 98 | 98 | } | 
| @@ -39,7 +39,7 @@ | ||
| 39 | 39 | return $this->io->confirm($question); | 
| 40 | 40 | } | 
| 41 | 41 | |
| 42 | - public function tell(string|array $message): void | |
| 42 | + public function tell(string | array $message): void | |
| 43 | 43 |      { | 
| 44 | 44 | sleep(1); | 
| 45 | 45 | $this->io->text($message); | 
| @@ -17,7 +17,7 @@ | ||
| 17 | 17 | |
| 18 | 18 | public function askForConfirmation(string $question): bool; | 
| 19 | 19 | |
| 20 | - public function tell(string|array $message): void; | |
| 20 | + public function tell(string | array $message): void; | |
| 21 | 21 | |
| 22 | 22 | public function list(array $items): void; | 
| 23 | 23 | |
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | Fighter $attacker, | 
| 41 | 41 | Attack $attack, | 
| 42 | 42 |      ): Damage { | 
| 43 | -        return match (true) { | |
| 43 | +        return match(true) { | |
| 44 | 44 | $attack instanceof MeleeAttack => | 
| 45 | 45 | (new Damage(0)) | 
| 46 | 46 | ->increaseBy($attack->getDamage($attacker->getWeapon() ?? throw FightException::weaponRequired())) | 
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 |              static function(array $talent): Talent { | 
| 58 | 58 | $reflection = new \ReflectionClass($talent['className']); | 
| 59 | 59 | |
| 60 | -                $talent = match ($talent['className']) { | |
| 60 | +                $talent = match($talent['className']) { | |
| 61 | 61 | WeaponMastery::class => | 
| 62 | 62 | $reflection->newInstance( | 
| 63 | 63 | new WeaponType($talent['type']), | 
| @@ -80,7 +80,7 @@ discard block | ||
| 80 | 80 |      { | 
| 81 | 81 | $reflection = new \ReflectionClass($data['className']); | 
| 82 | 82 | |
| 83 | -        $weapon = match (true) { | |
| 83 | +        $weapon = match(true) { | |
| 84 | 84 | $reflection->isSubclassOf(RebredirWeapon::class) => | 
| 85 | 85 | $reflection->newInstance(new Etherum($data['etherumLoad'])), | 
| 86 | 86 | default => $reflection->newInstance(), | 
| @@ -97,7 +97,7 @@ discard block | ||
| 97 | 97 |              static function(array $item): InventoryItem { | 
| 98 | 98 | $reflection = new \ReflectionClass($item['className']); | 
| 99 | 99 | |
| 100 | -                $item = match (true) { | |
| 100 | +                $item = match(true) { | |
| 101 | 101 | $reflection->isSubclassOf(Weapon::class) => self::denormalizeWeapon($item), | 
| 102 | 102 | default => $reflection->newInstance(), | 
| 103 | 103 | }; | 
| @@ -45,7 +45,7 @@ discard block | ||
| 45 | 45 |              static function(Talent $talent): array { | 
| 46 | 46 | $data = ['className' => get_class($talent)]; | 
| 47 | 47 | |
| 48 | -                return match (true) { | |
| 48 | +                return match(true) { | |
| 49 | 49 | $talent instanceof SecretKnowledge => array_merge($data, [ | 
| 50 | 50 | 'ascension' => $talent->getAscension()->get(), | 
| 51 | 51 | ]), | 
| @@ -64,7 +64,7 @@ discard block | ||
| 64 | 64 |      { | 
| 65 | 65 | $data = ['className' => $className = get_class($weapon)]; | 
| 66 | 66 | |
| 67 | -        return match (true) { | |
| 67 | +        return match(true) { | |
| 68 | 68 | $weapon instanceof RebredirWeapon => array_merge($data, [ | 
| 69 | 69 | 'etherumLoad' => $weapon->getEtherumLoad()->get(), | 
| 70 | 70 | ]), | 
| @@ -76,7 +76,7 @@ discard block | ||
| 76 | 76 |      { | 
| 77 | 77 | return map( | 
| 78 | 78 |              static function(InventoryItem $inventoryItem): array { | 
| 79 | -                return match (true) { | |
| 79 | +                return match(true) { | |
| 80 | 80 | $inventoryItem instanceof Weapon => self::normalizeWeapon($inventoryItem), | 
| 81 | 81 | default => ['className' => get_class($inventoryItem)], | 
| 82 | 82 | }; |