Completed
Branch develop (598d0f)
by Benjamin
03:23
created
src/Helper/Rule/Traits/AbstractPlayerRuleTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      * @return object|null
86 86
      * @throws \Exception
87 87
      */
88
-    public function getInjury($key):?object
88
+    public function getInjury($key): ?object
89 89
     {
90 90
         if (!$this->getInjuries()->containsKey($key)) {
91 91
             throw new \Exception('No Injury found for ' . $key);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      * @param PlayerVersion $version
102 102
      * @return string|null
103 103
      */
104
-    public function getSppLevel(PlayerVersion $version):?string
104
+    public function getSppLevel(PlayerVersion $version): ?string
105 105
     {
106 106
         if ($version->getSpp() && $version->getSpp() > 0) {
107 107
             if ($this->getSppLevels()->containsKey($version->getSpp())) {
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         return $this->getSppLevels()->first();
114 114
     }
115 115
 
116
-    public function getContextForRoll(array $roll):?array
116
+    public function getContextForRoll(array $roll): ?array
117 117
     {
118 118
         $context = null;
119 119
         if (isset($roll['d6_1']) && isset($roll['d6_2'])) {
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         return $context;
138 138
     }
139 139
 
140
-    public function getAvailableSkills(?PlayerVersion $version, $context = ['single', 'double']):?ArrayCollection
140
+    public function getAvailableSkills(?PlayerVersion $version, $context = ['single', 'double']): ?ArrayCollection
141 141
     {
142 142
         $criteria = Criteria::create();
143 143
         if ($version) {
Please login to merge, or discard this patch.
src/Helper/Rule/Config/ConfigResolver.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
         $configuration->configureOptions($this->resolver);
19 19
         foreach ($configuration::getChildren() as $key => $children_class) {
20 20
             $children = new $children_class();
21
-            if(!$children instanceof ConfigInterface) {
21
+            if (!$children instanceof ConfigInterface) {
22 22
                 $message = sprintf("The children must implements interface %s", ConfigInterface::class);
23 23
                 throw new \Exception($message);
24 24
             }
25
-            if($children instanceof ConfigTreeInterface) {
25
+            if ($children instanceof ConfigTreeInterface) {
26 26
                 $this->children[$key] = new ConfigTreeResolver($children);
27 27
             }
28 28
             else {
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $resolved = $this->resolver->resolve($data);
36 36
         foreach ($this->children as $key => $children) {
37
-            if($children instanceof ConfigTreeResolver) {
37
+            if ($children instanceof ConfigTreeResolver) {
38 38
                 foreach ($resolved[$key] as $sub_key => $sub_data) {
39 39
                     $resolved[$key][$sub_key] = $children->resolve($sub_data);
40 40
                 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@  discard block
 block discarded – undo
24 24
             }
25 25
             if($children instanceof ConfigTreeInterface) {
26 26
                 $this->children[$key] = new ConfigTreeResolver($children);
27
-            }
28
-            else {
27
+            } else {
29 28
                 $this->children[$key] = new ConfigResolver($children);
30 29
             }
31 30
         }
@@ -38,8 +37,7 @@  discard block
 block discarded – undo
38 37
                 foreach ($resolved[$key] as $sub_key => $sub_data) {
39 38
                     $resolved[$key][$sub_key] = $children->resolve($sub_data);
40 39
                 }
41
-            }
42
-            else {
40
+            } else {
43 41
                 $resolved[$key] = $children->resolve($resolved[$key]);
44 42
             }
45 43
         }
Please login to merge, or discard this patch.
src/Helper/Rule/AbstractRuleHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * CACHING
68 68
      *********/
69 69
 
70
-    public function getAttachedRule():?Rule
70
+    public function getAttachedRule(): ?Rule
71 71
     {
72 72
         return $this->attachedRule;
73 73
     }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         return $weather;
132 132
     }
133 133
 
134
-    public function createInducementAsPlayer(InducementInterface $inducement, $number = 0):?Player
134
+    public function createInducementAsPlayer(InducementInterface $inducement, $number = 0): ?Player
135 135
     {
136 136
         if (!$inducement instanceof StarPlayer) {
137 137
             return null;
Please login to merge, or discard this patch.
src/Helper/Rule/Roster/AbstractRoster.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
     /**
93 93
      * @return array
94 94
      */
95
-    public function getInducementOptions():?array
95
+    public function getInducementOptions(): ?array
96 96
     {
97 97
         return $this->inducement_options;
98 98
     }
Please login to merge, or discard this patch.
src/Command/RulesLoaderCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@
 block discarded – undo
79 79
                             ->setRule($rule_array);
80 80
                         $this->em->persist($rule);
81 81
                         $io->progressFinish();
82
-                    }
83
-                    catch (InvalidArgumentException $e) {
82
+                    } catch (InvalidArgumentException $e) {
84 83
                         $io->progressFinish();
85 84
                         $io->error("The rule.{$key} is not valid, resolver said :\n{$e->getMessage()}");
86 85
                     }
Please login to merge, or discard this patch.
src/Twig/RulesExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
         $alpha = Criteria::create()
124 124
             ->orderBy(['key' => 'ASC']);
125 125
         $skills = $helper->getSkills()->matching($alpha);
126
-        return array_map(function (Skill $skill) use ($rule) {
126
+        return array_map(function(Skill $skill) use ($rule) {
127 127
             return [
128 128
                 'name' => $skill->getTranslationKey(),
129 129
                 'type' => $skill->getTypeTranslationKey(),
Please login to merge, or discard this patch.
src/Entity/Team.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
         foreach ($new_player_list as $player) {
190 190
             $used_numbers[$player->getNumber()] = $player;
191 191
         }
192
-        for ($i=1; $i<=16; $i++) {
192
+        for ($i = 1; $i <= 16; $i++) {
193 193
             if (!isset($used_numbers[$i])) {
194 194
                 $new_player_list->add((new Player())->setNumber($i));
195 195
             }
Please login to merge, or discard this patch.