Passed
Push — master ( 98f021...0d9edd )
by Jakub
01:48
created
src/SkillSpecial.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/CharacterAttackSkill.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Team.php 1 patch
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
       }
Please login to merge, or discard this patch.
src/CharacterEffect.php 1 patch
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/TextCombatLogRender.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
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
   }
Please login to merge, or discard this patch.
src/CombatActions/SkillSpecial.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/CombatActions/Heal.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
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 {
Please login to merge, or discard this patch.
src/CombatActions/SkillAttack.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
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++) {
Please login to merge, or discard this patch.
src/CombatBase.php 1 patch
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
       foreach($team as $character) {
235 235
         try {
236 236
           $column++;
237
-          if($character->positionRow > 0 AND $character->positionColumn > 0) {
237
+          if($character->positionRow > 0 and $character->positionColumn > 0) {
238 238
             continue;
239 239
           }
240 240
           setPosition:
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     $characters = array_merge($combat->team1->toArray(), $combat->team2->toArray());
290 290
     foreach($characters as $character) {
291 291
       foreach($character->effects as $effect) {
292
-        if($effect->duration === CharacterEffect::DURATION_COMBAT OR is_int($effect->duration)) {
292
+        if($effect->duration === CharacterEffect::DURATION_COMBAT or is_int($effect->duration)) {
293 293
           $character->removeEffect($effect->id);
294 294
         }
295 295
       }
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
     $enemyTeam = $this->getEnemyTeam($attacker);
352 352
     $rangedWeapon = false;
353 353
     foreach($attacker->equipment as $equipment) {
354
-      if($equipment instanceof Weapon AND $equipment->isWorn() AND $equipment->ranged) {
354
+      if($equipment instanceof Weapon and $equipment->isWorn() and $equipment->ranged) {
355 355
         $rangedWeapon = true;
356 356
         break;
357 357
       }
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
           continue 2;
417 417
         }
418 418
       }
419
-      throw new NotImplementedException("Action $action is not implemented.");
419
+      throw new NotImplementedException("action $action is not implemented.");
420 420
     }
421 421
   }
422 422
   
Please login to merge, or discard this patch.