Completed
Push — master ( f10175...d8ea43 )
by Jérémy
02:02
created
src/Commands/CalculateCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 
85 85
         (new Table($output))
86 86
             ->setHeaders(['Level', 'Attack IV', 'Defense IV', 'Stamina IV', 'Perfection'])
87
-            ->setRows($pokemon->getIvCombinaisons()->map(function (IvCombinaison $combinaison) {
87
+            ->setRows($pokemon->getIvCombinaisons()->map(function(IvCombinaison $combinaison) {
88 88
                 return [
89 89
                     $combinaison->getLevel()->getLevel(),
90 90
                     $combinaison->getAttack(),
Please login to merge, or discard this patch.
src/Extractors/Pokedex.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,13 +24,13 @@
 block discarded – undo
24 24
         $collection = $this->getGameMasterJsonCollection();
25 25
 
26 26
         $finded = $collection
27
-            ->filter(function ($line) {
27
+            ->filter(function($line) {
28 28
                 if (isset($line->pokemonSettings)) {
29 29
                     return true;
30 30
                 }
31 31
                 return false;
32 32
             })
33
-            ->filter(function ($line) use ($name) {
33
+            ->filter(function($line) use ($name) {
34 34
                 return $line->pokemonSettings->pokemonId === strtoupper($name);
35 35
             })
36 36
             ->first()
Please login to merge, or discard this patch.
src/Entities/Pokemon.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
      * Return the minimum of perfection of a Pokemon
71 71
      * @return IvCombinaison|null
72 72
      */
73
-    public function getMinimumCombinaison(): ?IvCombinaison
73
+    public function getMinimumCombinaison(): ? IvCombinaison
74 74
     {
75 75
         return $this->getIvCombinaisons()
76 76
             ->sortBy(
77
-                function (IvCombinaison $combinaison) {
77
+                function(IvCombinaison $combinaison) {
78 78
                     return $combinaison->getPerfection();
79 79
                 })
80 80
             ->last();
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
      * Return the maximum of perfection of a Pokemon
85 85
      * @return IvCombinaison|null
86 86
      */
87
-    public function getMaximumCombinaison(): ?IvCombinaison
87
+    public function getMaximumCombinaison(): ? IvCombinaison
88 88
     {
89 89
         return $this->getIvCombinaisons()
90 90
             ->sortBy(
91
-                function (IvCombinaison $combinaison) {
91
+                function(IvCombinaison $combinaison) {
92 92
                     return $combinaison->getPerfection();
93 93
                 })
94 94
             ->first();
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
      * Return the average perfection of a Pokemon
99 99
      * @return float|null
100 100
      */
101
-    public function getAveragePerfection(): ?float
101
+    public function getAveragePerfection(): ? float
102 102
     {
103 103
         return $this->getIvCombinaisons()->average(
104
-            function (IvCombinaison $combinaison) {
104
+            function(IvCombinaison $combinaison) {
105 105
                 return $combinaison->getPerfection();
106 106
             });
107 107
     }
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
      * Return the min attack of a Pokemon
111 111
      * @return int
112 112
      */
113
-    public function getMinAttack(): ?int
113
+    public function getMinAttack(): ? int
114 114
     {
115 115
         return $this->getIvCombinaisons()->min(
116
-            function (IvCombinaison $combinaison) {
116
+            function(IvCombinaison $combinaison) {
117 117
                 return $combinaison->getAttack();
118 118
             });
119 119
     }
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
      * Return the max attack of a Pokemon
123 123
      * @return int
124 124
      */
125
-    public function getMaxAttack(): ?int
125
+    public function getMaxAttack(): ? int
126 126
     {
127 127
         return $this->getIvCombinaisons()->max(
128
-            function (IvCombinaison $combinaison) {
128
+            function(IvCombinaison $combinaison) {
129 129
                 return $combinaison->getAttack();
130 130
             });
131 131
     }
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
      * Return the min defense of a Pokemon
135 135
      * @return int
136 136
      */
137
-    public function getMinDefense(): ?int
137
+    public function getMinDefense(): ? int
138 138
     {
139 139
         return $this->getIvCombinaisons()->min(
140
-            function (IvCombinaison $combinaison) {
140
+            function(IvCombinaison $combinaison) {
141 141
                 return $combinaison->getDefense();
142 142
             });
143 143
     }
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
      * Return the max defense of a Pokemon
147 147
      * @return int
148 148
      */
149
-    public function getMaxDefense(): ?int
149
+    public function getMaxDefense(): ? int
150 150
     {
151 151
         return $this->getIvCombinaisons()->max(
152
-            function (IvCombinaison $combinaison) {
152
+            function(IvCombinaison $combinaison) {
153 153
                 return $combinaison->getDefense();
154 154
             });
155 155
     }
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
      * Return the min stamina of a Pokemon
159 159
      * @return int
160 160
      */
161
-    public function getMinStamina(): ?int
161
+    public function getMinStamina(): ? int
162 162
     {
163 163
         return $this->getIvCombinaisons()->min(
164
-            function (IvCombinaison $combinaison) {
164
+            function(IvCombinaison $combinaison) {
165 165
                 return $combinaison->getStamina();
166 166
             });
167 167
     }
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
      * Return the max stamina of a Pokemon
171 171
      * @return int
172 172
      */
173
-    public function getMaxStamina(): ?int
173
+    public function getMaxStamina(): ? int
174 174
     {
175 175
         return $this->getIvCombinaisons()->max(
176
-            function (IvCombinaison $combinaison) {
176
+            function(IvCombinaison $combinaison) {
177 177
                 return $combinaison->getStamina();
178 178
             });
179 179
     }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      *
218 218
      * @return int|null
219 219
      */
220
-    public function getCp(): ?int
220
+    public function getCp(): ? int
221 221
     {
222 222
         return $this->cp;
223 223
     }
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      *
241 241
      * @return int|null
242 242
      */
243
-    public function getHp(): ?int
243
+    public function getHp(): ? int
244 244
     {
245 245
         return $this->hp;
246 246
     }
Please login to merge, or discard this patch.
src/Calculator/Calculator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -172,15 +172,15 @@
 block discarded – undo
172 172
     {
173 173
         $this->potentialCombinaisons = $this->potentialCombinaisons
174 174
             // Eliminate impossible combinaison for global combinaison
175
-            ->filter(function ($combinaison) use ($global) {
175
+            ->filter(function($combinaison) use ($global) {
176 176
                 if ($combinaison->getTotal() <= $this->getMaxGlobalEvaluation($global) &&
177
-                    $combinaison->getTotal() > $this->getMaxGlobalEvaluation($global-1)) {
177
+                    $combinaison->getTotal() > $this->getMaxGlobalEvaluation($global - 1)) {
178 178
                     return true;
179 179
                 }
180 180
                 return false;
181 181
             })
182 182
             // Eliminate impossible combinaisons with best stats
183
-            ->filter(function ($combinaison) use ($bestStats) {
183
+            ->filter(function($combinaison) use ($bestStats) {
184 184
                 $nonBestStats = array_diff(self::AVAILABLE_OPTIONS, $bestStats);
185 185
                 foreach ($nonBestStats as $nonBestStat) {
186 186
                     if ($combinaison->getAbbreviated($nonBestStat) >= $combinaison->getMaximalIv()) {
Please login to merge, or discard this patch.