Passed
Push — master ( f2d70f...ce79d3 )
by Jakub
02:17
created
src/CharacterAttackSkill.php 2 patches
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.
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/ImmutableException.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/CharacterSpecialSkill.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/CharacterEffect.php 2 patches
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
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
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
   
Please login to merge, or discard this patch.
src/Pet.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
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
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");
Please login to merge, or discard this patch.
src/CombatAction.php 1 patch
Spacing   +4 added lines, -4 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
 
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 {
Please login to merge, or discard this patch.
src/ICharacterEffectProvider.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/EffectProvider.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/VictoryConditions.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.