@@ -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 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace HeroesofAbenez\Combat; |
5 | 5 | |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | protected function setStats(array $stats): void { |
164 | - $requiredStats = ["id", "name", "level", "strength", "dexterity", "constitution", "intelligence", "charisma", "initiativeFormula",]; |
|
165 | - $allStats = array_merge($requiredStats, ["occupation", "race", "specialization", "gender", "experience",]); |
|
166 | - $numberStats = ["strength", "dexterity", "constitution", "intelligence", "charisma",]; |
|
167 | - $textStats = ["name", "race", "occupation", "initiativeFormula",]; |
|
164 | + $requiredStats = ["id", "name", "level", "strength", "dexterity", "constitution", "intelligence", "charisma", "initiativeFormula", ]; |
|
165 | + $allStats = array_merge($requiredStats, ["occupation", "race", "specialization", "gender", "experience", ]); |
|
166 | + $numberStats = ["strength", "dexterity", "constitution", "intelligence", "charisma", ]; |
|
167 | + $textStats = ["name", "race", "occupation", "initiativeFormula", ]; |
|
168 | 168 | $resolver = new OptionsResolver(); |
169 | 169 | $resolver->setDefined($allStats); |
170 | 170 | $resolver->setAllowedTypes("id", ["integer", "string"]); |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | public function damageStat(): string { |
477 | 477 | $stat = "strength"; |
478 | 478 | foreach($this->equipment as $item) { |
479 | - if(!$item->worn OR $item->slot != Equipment::SLOT_WEAPON) { |
|
479 | + if(!$item->worn or $item->slot != Equipment::SLOT_WEAPON) { |
|
480 | 480 | continue; |
481 | 481 | } |
482 | 482 | switch($item->type) { |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | $stat = $effect->stat; |
535 | 535 | $type = $effect->type; |
536 | 536 | $duration = $effect->duration; |
537 | - if(is_int($duration) AND $duration < 0) { |
|
537 | + if(is_int($duration) and $duration < 0) { |
|
538 | 538 | unset($this->effects[$i]); |
539 | 539 | continue; |
540 | 540 | } |
@@ -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 |