Passed
Push — master ( f2d70f...ce79d3 )
by Jakub
02:17
created
src/SkillAttack.php 1 patch
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
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
   
49 49
   protected function configureOptions(OptionsResolver $resolver): void {
50 50
     parent::configureOptions($resolver);
51
-    $allStats = ["baseDamage", "damageGrowth", "strikes", "hitRate",];
51
+    $allStats = ["baseDamage", "damageGrowth", "strikes", "hitRate", ];
52 52
     $resolver->setRequired($allStats);
53 53
     $resolver->setAllowedTypes("baseDamage", "string");
54 54
     $resolver->setAllowedTypes("damageGrowth", "string");
Please login to merge, or discard this patch.
src/SkillSpecial.php 2 patches
Spacing   +3 added lines, -3 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
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
   public const STAT_DODGE = "dodge";
33 33
   public const STAT_INITIATIVE = "initiative";
34 34
   /** @var string[] */
35
-  public const NO_STAT_TYPES = [self::TYPE_STUN, self::TYPE_POISON,];
35
+  public const NO_STAT_TYPES = [self::TYPE_STUN, self::TYPE_POISON, ];
36 36
   
37 37
   /** @var string */
38 38
   protected $type;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
   
67 67
   protected function configureOptions(OptionsResolver $resolver): void {
68 68
     parent::configureOptions($resolver);
69
-    $allStats = ["type", "stat", "value", "valueGrowth", "duration",];
69
+    $allStats = ["type", "stat", "value", "valueGrowth", "duration", ];
70 70
     $resolver->setRequired($allStats);
71 71
     $resolver->setAllowedTypes("type", "string");
72 72
     $resolver->setAllowedValues("type", function(string $value) {
Please login to merge, or discard this 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/Equipment.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
     });
62 62
     $resolver->setAllowedTypes("type", ["string", "null"]);
63 63
     $resolver->setAllowedValues("type", function(?string $value) {
64
-      return is_null($value) OR in_array($value, $this->getAllowedTypes(), true);
64
+      return is_null($value) or in_array($value, $this->getAllowedTypes(), true);
65 65
     });
66 66
     $resolver->setAllowedTypes("strength", "integer");
67 67
     $resolver->setAllowedValues("strength", function(int $value) {
Please login to merge, or discard this patch.
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
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
   protected $worn;
51 51
   
52 52
   public function __construct(array $data) {
53
-    $allStats = ["id", "name", "slot", "type", "strength", "worn",];
53
+    $allStats = ["id", "name", "slot", "type", "strength", "worn", ];
54 54
     $resolver = new OptionsResolver();
55 55
     $resolver->setRequired($allStats);
56 56
     $resolver->setAllowedTypes("id", "integer");
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
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     $this->onCombatEnd[] = [$this, "removeCombatEffects"];
79 79
     $this->onCombatEnd[] = [$this, "logCombatResult"];
80 80
     $this->onCombatEnd[] = [$this, "resetInitiative"];
81
-    $this->onRoundStart[] = [$this ,"recalculateStats"];
81
+    $this->onRoundStart[] = [$this, "recalculateStats"];
82 82
     $this->onRoundStart[] = [$this, "logRoundNumber"];
83 83
     $this->onRoundStart[] = [$this, "applyPoison"];
84 84
     $this->onRound[] = [$this, "mainStage"];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     $characters = array_merge($combat->team1->items, $combat->team2->items);
299 299
     foreach($characters as $character) {
300 300
       foreach($character->effects as $effect) {
301
-        if($effect->duration === CharacterEffect::DURATION_COMBAT OR is_int($effect->duration)) {
301
+        if($effect->duration === CharacterEffect::DURATION_COMBAT or is_int($effect->duration)) {
302 302
           $character->removeEffect($effect->id);
303 303
         }
304 304
       }
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
       $threshold = static::LOWEST_HP_THRESHOLD;
390 390
     }
391 391
     foreach($team->aliveMembers as $index => $member) {
392
-      if($member->hitpoints <= $member->maxHitpoints * $threshold AND $member->hitpoints < $lowestHp) {
392
+      if($member->hitpoints <= $member->maxHitpoints * $threshold and $member->hitpoints < $lowestHp) {
393 393
         $lowestHp = $member->hitpoints;
394 394
         $lowestIndex = $index;
395 395
       }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
   protected function chooseAction(CombatBase $combat, Character $character): ?string {
442 442
     if($character->hitpoints < 1) {
443 443
       return NULL;
444
-    } elseif(in_array($character, $combat->findHealers()->items, true) AND !is_null($combat->selectHealingTarget($character))) {
444
+    } elseif(in_array($character, $combat->findHealers()->items, true) and !is_null($combat->selectHealingTarget($character))) {
445 445
       return CombatAction::ACTION_HEALING;
446 446
     }
447 447
     $attackTarget = $combat->selectAttackTarget($character);
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
     ];
629 629
     $this->results = $result;
630 630
     $effect = new CharacterEffect([
631
-      "id" => "skill{$skill->skill->id}Effect",
631
+      "id" => "skill{$skill->skill->id}effect",
632 632
       "type" => $skill->skill->type,
633 633
       "stat" => ((in_array($skill->skill->type, SkillSpecial::NO_STAT_TYPES, true)) ? NULL : $skill->skill->stat),
634 634
       "value" => $skill->value,
Please login to merge, or discard this patch.
src/Character.php 2 patches
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
    * @throws \OutOfBoundsException
430 430
    */
431 431
   public function getPet(int $petId): Pet {
432
-    if(isset($this->pets[$petId]) AND $this->pets[$petId] instanceof Pet) {
432
+    if(isset($this->pets[$petId]) and $this->pets[$petId] instanceof Pet) {
433 433
       return $this->pets[$petId];
434 434
     }
435 435
     throw new \OutOfBoundsException("Pet was not found.");
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
   public function damageStat(): string {
490 490
     $stat = "strength";
491 491
     foreach($this->equipment as $item) {
492
-      if(!$item->worn OR $item->slot != Equipment::SLOT_WEAPON) {
492
+      if(!$item->worn or $item->slot != Equipment::SLOT_WEAPON) {
493 493
         continue;
494 494
       }
495 495
       switch($item->type) {
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
       $stat = $effect->stat;
543 543
       $type = $effect->type;
544 544
       $duration = $effect->duration;
545
-      if(is_int($duration) AND $duration < 0) {
545
+      if(is_int($duration) and $duration < 0) {
546 546
         unset($this->effects[$i]);
547 547
         continue;
548 548
       }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 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
 
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
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"]);
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 require __DIR__ . "/../vendor/autoload.php";
5
-Testbench\Bootstrap::setup(__DIR__ . '/_temp', function (\Nette\Configurator $configurator) {
6
-  $configurator->addParameters(["appDir" => __DIR__,]);
5
+Testbench\Bootstrap::setup(__DIR__ . '/_temp', function(\Nette\Configurator $configurator) {
6
+  $configurator->addParameters(["appDir" => __DIR__, ]);
7 7
   $configurator->addConfig(__DIR__ . "/tests.neon");
8 8
 });
9 9
 ?>
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
src/InvalidStateException.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/CombatLogger.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/BaseCharacterSkill.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.