Completed
Push — master ( 10c9e5...cb21fe )
by Jakub
02:04
created
src/RandomSuccessCalculator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace HeroesofAbenez\Combat;
5 5
 
Please login to merge, or discard this patch.
src/ConstantInitiativeFormulaParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace HeroesofAbenez\Combat;
5 5
 
Please login to merge, or discard this patch.
src/NotImplementedException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace HeroesofAbenez\Combat;
5 5
 
Please login to merge, or discard this patch.
src/InvalidCharacterPositionException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace HeroesofAbenez\Combat;
5 5
 
Please login to merge, or discard this patch.
src/CombatBase.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace HeroesofAbenez\Combat;
5 5
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     $this->onCombatEnd[] = [$this, "logCombatResult"];
83 83
     $this->onCombatEnd[] = [$this, "resetInitiative"];
84 84
     $this->onRoundStart[] = [$this, "decreaseEffectsDuration"];
85
-    $this->onRoundStart[] = [$this ,"recalculateStats"];
85
+    $this->onRoundStart[] = [$this, "recalculateStats"];
86 86
     $this->onRoundStart[] = [$this, "logRoundNumber"];
87 87
     $this->onRoundStart[] = [$this, "applyPoison"];
88 88
     $this->onRound[] = [$this, "mainStage"];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
       foreach($team as $character) {
229 229
         try {
230 230
           $column++;
231
-          if($character->positionRow > 0 AND $character->positionColumn > 0) {
231
+          if($character->positionRow > 0 and $character->positionColumn > 0) {
232 232
             continue;
233 233
           }
234 234
           setPosition:
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     $characters = array_merge($combat->team1->toArray(), $combat->team2->toArray());
282 282
     foreach($characters as $character) {
283 283
       foreach($character->effects as $effect) {
284
-        if($effect->duration === CharacterEffect::DURATION_COMBAT OR is_int($effect->duration)) {
284
+        if($effect->duration === CharacterEffect::DURATION_COMBAT or is_int($effect->duration)) {
285 285
           $character->removeEffect($effect->id);
286 286
         }
287 287
       }
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
       $threshold = static::LOWEST_HP_THRESHOLD;
371 371
     }
372 372
     foreach($team->aliveMembers as $index => $member) {
373
-      if($member->hitpoints <= $member->maxHitpoints * $threshold AND $member->hitpoints < $lowestHp) {
373
+      if($member->hitpoints <= $member->maxHitpoints * $threshold and $member->hitpoints < $lowestHp) {
374 374
         $lowestHp = $member->hitpoints;
375 375
         $lowestIndex = $index;
376 376
       }
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         $targets = $this->getTeam($primaryTarget)->getItems(["positionColumn" => $primaryTarget->positionColumn]);
414 414
         break;
415 415
       default:
416
-        throw new NotImplementedException("Target $skill->skill->target for attack skills is not implemented.");
416
+        throw new NotImplementedException("target $skill->skill->target for attack skills is not implemented.");
417 417
     }
418 418
     foreach($targets as $target) {
419 419
       for($i = 1; $i <= $skill->skill->strikes; $i++) {
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
         $targets = $this->getEnemyTeam($character)->toArray();
439 439
         break;
440 440
       default:
441
-        throw new NotImplementedException("Target $skill->skill->target for special skills is not implemented.");
441
+        throw new NotImplementedException("target $skill->skill->target for special skills is not implemented.");
442 442
     }
443 443
     foreach($targets as $target) {
444 444
       $this->onSkillSpecial($character, $target, $skill);
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
   protected function chooseAction(self $combat, Character $character): ?string {
449 449
     if($character->hitpoints < 1) {
450 450
       return NULL;
451
-    } elseif(in_array($character, $combat->findHealers()->toArray(), true) AND !is_null($combat->selectHealingTarget($character))) {
451
+    } elseif(in_array($character, $combat->findHealers()->toArray(), true) and !is_null($combat->selectHealingTarget($character))) {
452 452
       return CombatAction::ACTION_HEALING;
453 453
     }
454 454
     $attackTarget = $combat->selectAttackTarget($character);
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
       "character1" => $character1, "character2" => $target,
632 632
     ];
633 633
     $effect = new CharacterEffect([
634
-      "id" => "skill{$skill->skill->id}Effect",
634
+      "id" => "skill{$skill->skill->id}effect",
635 635
       "type" => $skill->skill->type,
636 636
       "stat" => ((in_array($skill->skill->type, SkillSpecial::NO_STAT_TYPES, true)) ? NULL : $skill->skill->stat),
637 637
       "value" => $skill->value,
Please login to merge, or discard this patch.
src/Team.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace HeroesofAbenez\Combat;
5 5
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
    * @return Character[]
48 48
    */
49 49
   public function getAliveMembers(): array {
50
-    return $this->getItems(["hitpoints>" => 0,]);
50
+    return $this->getItems(["hitpoints>" => 0, ]);
51 51
   }
52 52
   
53 53
   /**
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,11 +77,11 @@
 block discarded – undo
77 77
    */
78 78
   public function setCharacterPosition($id, int $row, int $column): void {
79 79
     if(!$this->hasItems(["id" => $id])) {
80
-      throw new \OutOfBoundsException("Character $id is not in the team");
80
+      throw new \OutOfBoundsException("character $id is not in the team");
81 81
     } elseif(count($this->getItems(["positionRow" => $row])) >= $this->maxRowSize) {
82
-      throw new InvalidCharacterPositionException("Row $row is full.", InvalidCharacterPositionException::ROW_FULL);
82
+      throw new InvalidCharacterPositionException("row $row is full.", InvalidCharacterPositionException::ROW_FULL);
83 83
     } elseif($this->hasItems(["positionRow" => $row, "positionColumn" => $column])) {
84
-      throw new InvalidCharacterPositionException("Row $row column $column is occupied.", InvalidCharacterPositionException::POSITION_OCCUPIED);
84
+      throw new InvalidCharacterPositionException("row $row column $column is occupied.", InvalidCharacterPositionException::POSITION_OCCUPIED);
85 85
     }
86 86
     $character = $this->getItems(["id" => $id])[0];
87 87
     $character->positionRow = $row;
Please login to merge, or discard this patch.
src/ICharacterEffectsProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace HeroesofAbenez\Combat;
5 5
 
Please login to merge, or discard this patch.
tests/HeroesofAbenez/Combat/EffectsProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace HeroesofAbenez\Combat;
5 5
 
Please login to merge, or discard this patch.