@@ -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 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | public function getHitRate(): int { |
41 | - if(is_string($this->skill->hitRate) AND substr($this->skill->hitRate, -1) === "%") { |
|
41 | + if(is_string($this->skill->hitRate) and substr($this->skill->hitRate, -1) === "%") { |
|
42 | 42 | return (int) $this->skill->hitRate; |
43 | 43 | } |
44 | 44 | return 100; |
@@ -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 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $resolver->setAllowedTypes("stat", "string"); |
53 | 53 | $resolver->setDefault("stat", ""); |
54 | 54 | $resolver->setAllowedValues("stat", function(string $value) { |
55 | - return $value === "" OR in_array($value, $this->getAllowedStats(), true); |
|
55 | + return $value === "" or in_array($value, $this->getAllowedStats(), true); |
|
56 | 56 | }); |
57 | 57 | $resolver->setAllowedTypes("source", "string"); |
58 | 58 | $resolver->setAllowedValues("source", function(string $value) { |
@@ -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"]; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @throws \InvalidArgumentException |
136 | 136 | */ |
137 | 137 | public function setDuration($value) { |
138 | - if(!is_int($value) AND !in_array($value, $this->getDurations(), true)) { |
|
138 | + if(!is_int($value) and !in_array($value, $this->getDurations(), true)) { |
|
139 | 139 | throw new \InvalidArgumentException("Invalid value set to CharacterEffect::\$duration. Expected string or integer."); |
140 | 140 | } |
141 | 141 | $this->duration = $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 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public $onRemove = []; |
47 | 47 | |
48 | 48 | public function __construct(array $effect) { |
49 | - $allStats = ["id", "type", "source", "value", "duration", "stat",]; |
|
49 | + $allStats = ["id", "type", "source", "value", "duration", "stat", ]; |
|
50 | 50 | $resolver = new OptionsResolver(); |
51 | 51 | $resolver->setRequired($allStats); |
52 | 52 | $resolver->setAllowedTypes("id", "string"); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | protected function getAllowedStats(): array { |
87 | 87 | $stats = Constants::getConstantsValues(SkillSpecial::class, "STAT_"); |
88 | - $stats = array_merge($stats, ["strength", "dexterity", "constitution", "intelligence", "charisma",]); |
|
88 | + $stats = array_merge($stats, ["strength", "dexterity", "constitution", "intelligence", "charisma", ]); |
|
89 | 89 | return $stats; |
90 | 90 | } |
91 | 91 |
@@ -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->setRequired($allStats); |
41 | 41 | $resolver->setAllowedTypes("id", "integer"); |
@@ -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,9 +46,9 @@ discard block |
||
46 | 46 | protected $message; |
47 | 47 | |
48 | 48 | public function __construct(ITranslator $translator, array $action) { |
49 | - $requiredStats = ["action", "result", "character1", "character2",]; |
|
49 | + $requiredStats = ["action", "result", "character1", "character2", ]; |
|
50 | 50 | $resolver = new OptionsResolver(); |
51 | - $resolver->setDefined(["amount", "name",]); |
|
51 | + $resolver->setDefined(["amount", "name", ]); |
|
52 | 52 | $resolver->setRequired($requiredStats); |
53 | 53 | $resolver->setAllowedTypes("action", "string"); |
54 | 54 | $resolver->setAllowedValues("action", function(string $value) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $text = $this->translator->translate("combat.log.poison", $this->amount, ["character1" => $character1]); |
151 | 151 | break; |
152 | 152 | } |
153 | - $this->message = $text; |
|
153 | + $this->message = $text; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | public function __toString(): string { |
@@ -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 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace HeroesofAbenez\Combat; |
5 | 5 |