@@ -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) { |
@@ -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; |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function setCharacterPosition($id, int $row, int $column): void { |
| 82 | 82 | if(!$this->hasItems(["id" => $id])) { |
| 83 | - throw new \OutOfBoundsException("Character $id is not in the team"); |
|
| 83 | + throw new \OutOfBoundsException("character $id is not in the team"); |
|
| 84 | 84 | } elseif(count($this->getItems(["positionRow" => $row])) >= $this->maxRowSize) { |
| 85 | - throw new InvalidCharacterPositionException("Row $row is full.", InvalidCharacterPositionException::ROW_FULL); |
|
| 85 | + throw new InvalidCharacterPositionException("row $row is full.", InvalidCharacterPositionException::ROW_FULL); |
|
| 86 | 86 | } elseif($this->hasItems(["positionRow" => $row, "positionColumn" => $column])) { |
| 87 | - throw new InvalidCharacterPositionException("Row $row column $column is occupied.", InvalidCharacterPositionException::POSITION_OCCUPIED); |
|
| 87 | + throw new InvalidCharacterPositionException("row $row column $column is occupied.", InvalidCharacterPositionException::POSITION_OCCUPIED); |
|
| 88 | 88 | } |
| 89 | 89 | $character = $this->getItems(["id" => $id])[0]; |
| 90 | 90 | $character->positionRow = $row; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | return null; |
| 113 | 113 | } |
| 114 | 114 | foreach($this->aliveMembers as $index => $member) { |
| 115 | - if($member->hitpoints <= $member->maxHitpoints * $threshold AND $member->hitpoints < $lowestHp) { |
|
| 115 | + if($member->hitpoints <= $member->maxHitpoints * $threshold and $member->hitpoints < $lowestHp) { |
|
| 116 | 116 | $lowestHp = $member->hitpoints; |
| 117 | 117 | $lowestIndex = $index; |
| 118 | 118 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | "character1" => $character1, "character2" => $target, |
| 38 | 38 | ]; |
| 39 | 39 | $effect = new CharacterEffect([ |
| 40 | - "id" => "skill{$skill->skill->id}Effect", |
|
| 40 | + "id" => "skill{$skill->skill->id}effect", |
|
| 41 | 41 | "type" => $skill->skill->type, |
| 42 | 42 | "stat" => ((in_array($skill->skill->type, Skill::NO_STAT_TYPES, true)) ? null : $skill->skill->stat), |
| 43 | 43 | "value" => $skill->value, |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $targets = $combat->getEnemyTeam($character)->toArray(); |
| 71 | 71 | break; |
| 72 | 72 | default: |
| 73 | - throw new NotImplementedException("Target {$skill->skill->target} for special skills is not implemented."); |
|
| 73 | + throw new NotImplementedException("target {$skill->skill->target} for special skills is not implemented."); |
|
| 74 | 74 | } |
| 75 | 75 | foreach($targets as $target) { |
| 76 | 76 | $this->doSingleTarget($character, $target, $skill, $combat); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function shouldUse(CombatBase $combat, Character $character): bool { |
| 21 | - return (in_array($character, $combat->findHealers()->toArray(), true) AND !is_null($combat->selectHealingTarget($character))); |
|
| 21 | + return (in_array($character, $combat->findHealers()->toArray(), true) and !is_null($combat->selectHealingTarget($character))); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | public function do(CombatBase $combat, Character $character): void { |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $targets = $combat->getTeam($primaryTarget)->getItems(["positionColumn" => $primaryTarget->positionColumn]); |
| 72 | 72 | break; |
| 73 | 73 | default: |
| 74 | - throw new NotImplementedException("Target {$skill->skill->target} for attack skills is not implemented."); |
|
| 74 | + throw new NotImplementedException("target {$skill->skill->target} for attack skills is not implemented."); |
|
| 75 | 75 | } |
| 76 | 76 | foreach($targets as $target) { |
| 77 | 77 | for($i = 1; $i <= $skill->skill->strikes; $i++) { |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | */ |
| 532 | 532 | public function damageStat(): string { |
| 533 | 533 | foreach($this->equipment as $item) { |
| 534 | - if(!$item->worn OR !$item instanceof Weapon) { |
|
| 534 | + if(!$item->worn or !$item instanceof Weapon) { |
|
| 535 | 535 | continue; |
| 536 | 536 | } |
| 537 | 537 | return $item->damageStat; |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | $stat = $effect->stat; |
| 580 | 580 | $type = $effect->type; |
| 581 | 581 | $duration = $effect->duration; |
| 582 | - if(is_int($duration) AND $duration < 1) { |
|
| 582 | + if(is_int($duration) and $duration < 1) { |
|
| 583 | 583 | $this->removeEffect($effect->id); |
| 584 | 584 | continue; |
| 585 | 585 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $resolver = new OptionsResolver(); |
| 47 | 47 | $this->configureOptions($resolver); |
| 48 | 48 | $effect = $resolver->resolve($effect); |
| 49 | - if(!in_array($effect["type"], SkillSpecial::NO_STAT_TYPES, true) AND $effect["stat"] === "") { |
|
| 49 | + if(!in_array($effect["type"], SkillSpecial::NO_STAT_TYPES, true) and $effect["stat"] === "") { |
|
| 50 | 50 | throw new \InvalidArgumentException("The option stat with value '' is invalid."); |
| 51 | 51 | } |
| 52 | 52 | $this->id = $effect["id"]; |
@@ -80,14 +80,14 @@ discard block |
||
| 80 | 80 | $resolver->setAllowedTypes("stat", "string"); |
| 81 | 81 | $resolver->setDefault("stat", ""); |
| 82 | 82 | $resolver->setAllowedValues("stat", function(string $value) { |
| 83 | - return $value === "" OR in_array($value, $this->getAllowedStats(), true); |
|
| 83 | + return $value === "" or in_array($value, $this->getAllowedStats(), true); |
|
| 84 | 84 | }); |
| 85 | 85 | $resolver->setAllowedTypes("value", "integer"); |
| 86 | 86 | $resolver->setAllowedTypes("valueAbsolute", "bool"); |
| 87 | 87 | $resolver->setDefault("value", 0); |
| 88 | 88 | $resolver->setAllowedTypes("duration", ["string", "integer"]); |
| 89 | 89 | $resolver->setAllowedValues("duration", function($value) { |
| 90 | - return (in_array($value, $this->getDurations(), true)) OR ($value > 0); |
|
| 90 | + return (in_array($value, $this->getDurations(), true)) or ($value > 0); |
|
| 91 | 91 | }); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * @throws \InvalidArgumentException |
| 149 | 149 | */ |
| 150 | 150 | public function setDuration($value): void { |
| 151 | - if(!is_int($value) AND !in_array($value, $this->getDurations(), true)) { |
|
| 151 | + if(!is_int($value) and !in_array($value, $this->getDurations(), true)) { |
|
| 152 | 152 | throw new \InvalidArgumentException("Invalid value set to CharacterEffect::\$duration. Expected string or integer."); |
| 153 | 153 | } |
| 154 | 154 | $this->duration = $value; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function setTemplate(string $template): void { |
| 33 | 33 | if(!is_file($template)) { |
| 34 | - throw new \RuntimeException("File $template does not exist."); |
|
| 34 | + throw new \RuntimeException("file $template does not exist."); |
|
| 35 | 35 | } |
| 36 | 36 | $this->template = $template; |
| 37 | 37 | } |
@@ -54,14 +54,14 @@ discard block |
||
| 54 | 54 | case CombatLogEntry::ACTION_ATTACK: |
| 55 | 55 | $message = ($item->result) ? "combat.log.attackHits" : "combat.log.attackFails"; |
| 56 | 56 | $text = $this->translator->translate($message, $item->amount, ["character1" => $character1, "character2" => $character2]); |
| 57 | - if($item->result AND $item->character2->hitpoints < 1) { |
|
| 57 | + if($item->result and $item->character2->hitpoints < 1) { |
|
| 58 | 58 | $text .= $this->translator->translate("combat.log.characterFalls"); |
| 59 | 59 | } |
| 60 | 60 | return $text; |
| 61 | 61 | case CombatLogEntry::ACTION_SKILL_ATTACK: |
| 62 | 62 | $message = ($item->result) ? "combat.log.specialAttackHits" : "combat.log.specialAttackFails"; |
| 63 | 63 | $text = $this->translator->translate($message, $item->amount, ["character1" => $character1, "character2" => $character2, "name" => $item->name]); |
| 64 | - if($item->result AND $item->character2->hitpoints < 1) { |
|
| 64 | + if($item->result and $item->character2->hitpoints < 1) { |
|
| 65 | 65 | $text .= $this->translator->translate("combat.log.characterFalls"); |
| 66 | 66 | } |
| 67 | 67 | return $text; |