@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Combat; |
| 5 | 5 | |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | protected $message; |
| 47 | 47 | |
| 48 | 48 | public function __construct(ITranslator $translator, array $action) { |
| 49 | - $requiredStats = ["action", "result", "character1", "character2",]; |
|
| 50 | - $allStats = array_merge($requiredStats, ["amount", "name",]); |
|
| 49 | + $requiredStats = ["action", "result", "character1", "character2", ]; |
|
| 50 | + $allStats = array_merge($requiredStats, ["amount", "name", ]); |
|
| 51 | 51 | $resolver = new OptionsResolver(); |
| 52 | 52 | $resolver->setDefined($allStats); |
| 53 | 53 | $resolver->setRequired($requiredStats); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $text = $this->translator->translate("combat.log.poison", $this->amount, ["character1" => $character1]); |
| 152 | 152 | break; |
| 153 | 153 | } |
| 154 | - $this->message = $text; |
|
| 154 | + $this->message = $text; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | public function __toString(): string { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Combat; |
| 5 | 5 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | protected function configureOptions(OptionsResolver $resolver): void { |
| 50 | 50 | parent::configureOptions($resolver); |
| 51 | - $allStats = ["baseDamage", "damageGrowth", "strikes", "hitRate",]; |
|
| 51 | + $allStats = ["baseDamage", "damageGrowth", "strikes", "hitRate", ]; |
|
| 52 | 52 | $resolver->setRequired($allStats); |
| 53 | 53 | $resolver->setAllowedTypes("baseDamage", "string"); |
| 54 | 54 | $resolver->setAllowedTypes("damageGrowth", "string"); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Combat; |
| 5 | 5 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | protected $duration; |
| 41 | 41 | |
| 42 | 42 | public function __construct(array $effect) { |
| 43 | - $allStats = ["id", "type", "source", "value", "duration", "stat",]; |
|
| 43 | + $allStats = ["id", "type", "source", "value", "duration", "stat", ]; |
|
| 44 | 44 | $resolver = new OptionsResolver(); |
| 45 | 45 | $resolver->setDefined($allStats); |
| 46 | 46 | $resolver->setRequired($allStats); |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | $resolver->setDefault("value", 0); |
| 63 | 63 | $resolver->setAllowedTypes("duration", ["string", "integer"]); |
| 64 | 64 | $resolver->setAllowedValues("duration", function($value) { |
| 65 | - return (in_array($value, $this->getDurations(), true)) OR ($value > 0); |
|
| 65 | + return (in_array($value, $this->getDurations(), true)) or ($value > 0); |
|
| 66 | 66 | }); |
| 67 | 67 | $effect = $resolver->resolve($effect); |
| 68 | - if(!in_array($effect["type"], SkillSpecial::NO_STAT_TYPES, true) AND $effect["stat"] === "") { |
|
| 68 | + if(!in_array($effect["type"], SkillSpecial::NO_STAT_TYPES, true) and $effect["stat"] === "") { |
|
| 69 | 69 | throw new \InvalidArgumentException("The option stat with value '' is invalid."); |
| 70 | 70 | } |
| 71 | 71 | $this->id = $effect["id"]; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @throws \InvalidArgumentException |
| 130 | 130 | */ |
| 131 | 131 | public function setDuration($value) { |
| 132 | - if(!is_int($value) AND !in_array($value, $this->getDurations(), true)) { |
|
| 132 | + if(!is_int($value) and !in_array($value, $this->getDurations(), true)) { |
|
| 133 | 133 | throw new \InvalidArgumentException("Invalid value set to CharacterEffect::\$duration. Expected string or integer."); |
| 134 | 134 | } |
| 135 | 135 | $this->duration = $value; |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Combat; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Combat; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Combat; |
| 5 | 5 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public const STAT_DODGE = "dodge"; |
| 33 | 33 | public const STAT_INITIATIVE = "initiative"; |
| 34 | 34 | /** @var string[] */ |
| 35 | - public const NO_STAT_TYPES = [self::TYPE_STUN, self::TYPE_POISON,]; |
|
| 35 | + public const NO_STAT_TYPES = [self::TYPE_STUN, self::TYPE_POISON, ]; |
|
| 36 | 36 | |
| 37 | 37 | /** @var string */ |
| 38 | 38 | protected $type; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | protected function configureOptions(OptionsResolver $resolver): void { |
| 68 | 68 | parent::configureOptions($resolver); |
| 69 | - $allStats = ["type", "stat", "value", "valueGrowth", "duration",]; |
|
| 69 | + $allStats = ["type", "stat", "value", "valueGrowth", "duration", ]; |
|
| 70 | 70 | $resolver->setRequired($allStats); |
| 71 | 71 | $resolver->setAllowedTypes("type", "string"); |
| 72 | 72 | $resolver->setAllowedValues("type", function(string $value) { |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | }); |
| 75 | 75 | $resolver->setAllowedTypes("stat", ["string", "null"]); |
| 76 | 76 | $resolver->setAllowedValues("stat", function(?string $value) { |
| 77 | - return is_null($value) OR in_array($value, $this->getAllowedStats(), true); |
|
| 77 | + return is_null($value) or in_array($value, $this->getAllowedStats(), true); |
|
| 78 | 78 | }); |
| 79 | 79 | $resolver->setAllowedTypes("value", "integer"); |
| 80 | 80 | $resolver->setAllowedValues("value", function(int $value) { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Combat; |
| 5 | 5 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | protected $bonusValue; |
| 36 | 36 | |
| 37 | 37 | public function __construct(array $data) { |
| 38 | - $allStats = ["id", "deployed", "bonusStat", "bonusValue",]; |
|
| 38 | + $allStats = ["id", "deployed", "bonusStat", "bonusValue", ]; |
|
| 39 | 39 | $resolver = new OptionsResolver(); |
| 40 | 40 | $resolver->setDefined($allStats); |
| 41 | 41 | $resolver->setRequired($allStats); |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Combat; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Combat; |
| 5 | 5 | |