@@ -37,7 +37,7 @@ |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | protected function configureOptions(OptionsResolver $resolver): void { |
| 40 | - $allStats = ["id", "deployed", "bonusStat", "bonusValue",]; |
|
| 40 | + $allStats = ["id", "deployed", "bonusStat", "bonusValue", ]; |
|
| 41 | 41 | $resolver->setRequired($allStats); |
| 42 | 42 | $resolver->setAllowedTypes("id", "integer"); |
| 43 | 43 | $resolver->setAllowedTypes("deployed", "boolean"); |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | protected function configureOptions(OptionsResolver $resolver): void { |
| 63 | - $requiredStats = ["action", "result", "character1", "character2",]; |
|
| 64 | - $resolver->setDefined(["amount", "name",]); |
|
| 63 | + $requiredStats = ["action", "result", "character1", "character2", ]; |
|
| 64 | + $resolver->setDefined(["amount", "name", ]); |
|
| 65 | 65 | $resolver->setRequired($requiredStats); |
| 66 | 66 | $resolver->setAllowedTypes("action", "string"); |
| 67 | 67 | $resolver->setAllowedValues("action", function(string $value) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $text = $this->translator->translate("combat.log.poison", $this->amount, ["character1" => $character1]); |
| 155 | 155 | break; |
| 156 | 156 | } |
| 157 | - $this->message = $text; |
|
| 157 | + $this->message = $text; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | public function __toString(): string { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | protected function configureOptions(OptionsResolver $resolver): void { |
| 76 | - $allStats = ["id", "type", "source", "value", "duration", "stat",]; |
|
| 76 | + $allStats = ["id", "type", "source", "value", "duration", "stat", ]; |
|
| 77 | 77 | $resolver->setRequired($allStats); |
| 78 | 78 | $resolver->setAllowedTypes("id", "string"); |
| 79 | 79 | $resolver->setAllowedTypes("type", "string"); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | protected function getAllowedStats(): array { |
| 101 | 101 | $stats = Constants::getConstantsValues(Character::class, "STAT_"); |
| 102 | - $stats = array_merge($stats, ["strength", "dexterity", "constitution", "intelligence", "charisma",]); |
|
| 102 | + $stats = array_merge($stats, ["strength", "dexterity", "constitution", "intelligence", "charisma", ]); |
|
| 103 | 103 | return $stats; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $resolver = new OptionsResolver(); |
| 50 | 50 | $this->configureOptions($resolver); |
| 51 | 51 | $effect = $resolver->resolve($effect); |
| 52 | - if(!in_array($effect["type"], SkillSpecial::NO_STAT_TYPES, true) AND $effect["stat"] === "") { |
|
| 52 | + if(!in_array($effect["type"], SkillSpecial::NO_STAT_TYPES, true) and $effect["stat"] === "") { |
|
| 53 | 53 | throw new \InvalidArgumentException("The option stat with value '' is invalid."); |
| 54 | 54 | } |
| 55 | 55 | $this->id = $effect["id"]; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $resolver->setAllowedTypes("stat", "string"); |
| 84 | 84 | $resolver->setDefault("stat", ""); |
| 85 | 85 | $resolver->setAllowedValues("stat", function(string $value) { |
| 86 | - return $value === "" OR in_array($value, $this->getAllowedStats(), true); |
|
| 86 | + return $value === "" or in_array($value, $this->getAllowedStats(), true); |
|
| 87 | 87 | }); |
| 88 | 88 | $resolver->setAllowedTypes("source", "string"); |
| 89 | 89 | $resolver->setAllowedValues("source", function(string $value) { |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $resolver->setDefault("value", 0); |
| 94 | 94 | $resolver->setAllowedTypes("duration", ["string", "integer"]); |
| 95 | 95 | $resolver->setAllowedValues("duration", function($value) { |
| 96 | - return (in_array($value, $this->getDurations(), true)) OR ($value > 0); |
|
| 96 | + return (in_array($value, $this->getDurations(), true)) or ($value > 0); |
|
| 97 | 97 | }); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * @throws \InvalidArgumentException |
| 157 | 157 | */ |
| 158 | 158 | public function setDuration($value): void { |
| 159 | - if(!is_int($value) AND !in_array($value, $this->getDurations(), true)) { |
|
| 159 | + if(!is_int($value) and !in_array($value, $this->getDurations(), true)) { |
|
| 160 | 160 | throw new \InvalidArgumentException("Invalid value set to CharacterEffect::\$duration. Expected string or integer."); |
| 161 | 161 | } |
| 162 | 162 | $this->duration = $value; |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | */ |
| 76 | 76 | public function setTemplate(string $template): void { |
| 77 | 77 | if(!is_file($template)) { |
| 78 | - throw new \RuntimeException("File $template does not exist."); |
|
| 78 | + throw new \RuntimeException("file $template does not exist."); |
|
| 79 | 79 | } |
| 80 | 80 | $this->template = $template; |
| 81 | 81 | } |