Completed
Push — master ( 25ba12...d7e08b )
by Jakub
02:28
created
src/CharacterEffect.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
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
   protected $duration;
41 41
   
42 42
   public function __construct(array $effect) {
43
-    $allStats = ["id", "type", "source", "value", "duration", "stat",];
43
+    $allStats = ["id", "type", "source", "value", "duration", "stat", ];
44 44
     $resolver = new OptionsResolver();
45 45
     $resolver->setDefined($allStats);
46 46
     $resolver->setRequired($allStats);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
   
79 79
   protected function getAllowedStats(): array {
80 80
     $stats = Constants::getConstantsValues(SkillSpecial::class, "STAT_");
81
-    $stats = array_merge($stats, ["strength", "dexterity", "constitution", "intelligence", "charisma",]);
81
+    $stats = array_merge($stats, ["strength", "dexterity", "constitution", "intelligence", "charisma", ]);
82 82
     return $stats;
83 83
   }
84 84
   
Please login to merge, or discard this patch.
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.