@@ -84,7 +84,7 @@ |
||
| 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(), |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | ->getIntervalLevelFiltered($pokemon, $trainer); |
| 29 | 29 | |
| 30 | 30 | $levels |
| 31 | - ->each(function ($level) use (&$dusts, &$loop, $trainer) { |
|
| 31 | + ->each(function($level) use (&$dusts, &$loop, $trainer) { |
|
| 32 | 32 | $loop += 0.5; |
| 33 | 33 | $dusts += $level->dust * 2; |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | - if ($pokemon*2 % 2 === 1) { |
|
| 36 | + if ($pokemon * 2 % 2 === 1) { |
|
| 37 | 37 | $dusts -= $levels->first()->dust; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | ->getIntervalLevelFiltered($pokemon, $trainer); |
| 59 | 59 | |
| 60 | 60 | $levels |
| 61 | - ->each(function ($level) use (&$candies, &$loop, $trainer) { |
|
| 61 | + ->each(function($level) use (&$candies, &$loop, $trainer) { |
|
| 62 | 62 | $loop += 0.5; |
| 63 | 63 | $candies += $level->candy * 2; |
| 64 | 64 | }); |
| 65 | 65 | |
| 66 | - if ($pokemon*2 % 2 === 1) { |
|
| 66 | + if ($pokemon * 2 % 2 === 1) { |
|
| 67 | 67 | $candies -= $levels->first()->candy; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -172,15 +172,15 @@ discard block |
||
| 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()) { |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | return true; |
| 191 | 191 | }) |
| 192 | 192 | // Eliminate impossible combinaisons with equals best stats |
| 193 | - ->filter(function ($combinaison) use ($bestStats) { |
|
| 193 | + ->filter(function($combinaison) use ($bestStats) { |
|
| 194 | 194 | foreach ($bestStats as $bestStat) { |
| 195 | 195 | if ($combinaison->getAbbreviated($bestStat) != $combinaison->getMaximalIv()) { |
| 196 | 196 | return false; |
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | $collection = $this->getGameMasterJsonCollection(); |
| 27 | 27 | |
| 28 | 28 | $finded = $collection |
| 29 | - ->filter(function ($line) { |
|
| 29 | + ->filter(function($line) { |
|
| 30 | 30 | if (isset($line->pokemonSettings)) { |
| 31 | 31 | return true; |
| 32 | 32 | } |
| 33 | 33 | return false; |
| 34 | 34 | }) |
| 35 | - ->filter(function ($line) use ($name) { |
|
| 35 | + ->filter(function($line) use ($name) { |
|
| 36 | 36 | return $line->pokemonSettings->pokemonId === strtoupper($name); |
| 37 | 37 | }) |
| 38 | 38 | ->first() |
@@ -56,16 +56,16 @@ discard block |
||
| 56 | 56 | $collection = $this->getGameMasterJsonCollection(); |
| 57 | 57 | |
| 58 | 58 | $finded = $collection |
| 59 | - ->filter(function ($line) { |
|
| 59 | + ->filter(function($line) { |
|
| 60 | 60 | if (isset($line->pokemonSettings)) { |
| 61 | 61 | return true; |
| 62 | 62 | } |
| 63 | 63 | return false; |
| 64 | 64 | }) |
| 65 | - ->filter(function ($line) use ($family) { |
|
| 65 | + ->filter(function($line) use ($family) { |
|
| 66 | 66 | return $line->pokemonSettings->familyId === strtoupper($family); |
| 67 | 67 | }) |
| 68 | - ->sortBy(function ($line) { |
|
| 68 | + ->sortBy(function($line) { |
|
| 69 | 69 | return $line->pokemonSettings->stats->baseStamina; |
| 70 | 70 | }) |
| 71 | 71 | ; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | return $this->getIvCombinaisons() |
| 100 | 100 | ->sortBy( |
| 101 | - function (IvCombinaison $combinaison) { |
|
| 101 | + function(IvCombinaison $combinaison) { |
|
| 102 | 102 | return $combinaison->getPerfection(); |
| 103 | 103 | }) |
| 104 | 104 | ->last(); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | return $this->getIvCombinaisons() |
| 114 | 114 | ->sortBy( |
| 115 | - function (IvCombinaison $combinaison) { |
|
| 115 | + function(IvCombinaison $combinaison) { |
|
| 116 | 116 | return $combinaison->getPerfection(); |
| 117 | 117 | }) |
| 118 | 118 | ->first(); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | public function getAveragePerfection(): ?float |
| 126 | 126 | { |
| 127 | 127 | return $this->getIvCombinaisons()->average( |
| 128 | - function (IvCombinaison $combinaison) { |
|
| 128 | + function(IvCombinaison $combinaison) { |
|
| 129 | 129 | return $combinaison->getPerfection(); |
| 130 | 130 | }); |
| 131 | 131 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | public function getMinAttack(): ?int |
| 138 | 138 | { |
| 139 | 139 | return $this->getIvCombinaisons()->min( |
| 140 | - function (IvCombinaison $combinaison) { |
|
| 140 | + function(IvCombinaison $combinaison) { |
|
| 141 | 141 | return $combinaison->getAttack(); |
| 142 | 142 | }); |
| 143 | 143 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | public function getMaxAttack(): ?int |
| 150 | 150 | { |
| 151 | 151 | return $this->getIvCombinaisons()->max( |
| 152 | - function (IvCombinaison $combinaison) { |
|
| 152 | + function(IvCombinaison $combinaison) { |
|
| 153 | 153 | return $combinaison->getAttack(); |
| 154 | 154 | }); |
| 155 | 155 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | public function getMinDefense(): ?int |
| 162 | 162 | { |
| 163 | 163 | return $this->getIvCombinaisons()->min( |
| 164 | - function (IvCombinaison $combinaison) { |
|
| 164 | + function(IvCombinaison $combinaison) { |
|
| 165 | 165 | return $combinaison->getDefense(); |
| 166 | 166 | }); |
| 167 | 167 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | public function getMaxDefense(): ?int |
| 174 | 174 | { |
| 175 | 175 | return $this->getIvCombinaisons()->max( |
| 176 | - function (IvCombinaison $combinaison) { |
|
| 176 | + function(IvCombinaison $combinaison) { |
|
| 177 | 177 | return $combinaison->getDefense(); |
| 178 | 178 | }); |
| 179 | 179 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | public function getMinStamina(): ?int |
| 186 | 186 | { |
| 187 | 187 | return $this->getIvCombinaisons()->min( |
| 188 | - function (IvCombinaison $combinaison) { |
|
| 188 | + function(IvCombinaison $combinaison) { |
|
| 189 | 189 | return $combinaison->getStamina(); |
| 190 | 190 | }); |
| 191 | 191 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | public function getMaxStamina(): ?int |
| 198 | 198 | { |
| 199 | 199 | return $this->getIvCombinaisons()->max( |
| 200 | - function (IvCombinaison $combinaison) { |
|
| 200 | + function(IvCombinaison $combinaison) { |
|
| 201 | 201 | return $combinaison->getStamina(); |
| 202 | 202 | }); |
| 203 | 203 | } |
@@ -209,10 +209,10 @@ discard block |
||
| 209 | 209 | public function getMinLevel(): ?float |
| 210 | 210 | { |
| 211 | 211 | return $this->getIvCombinaisons() |
| 212 | - ->map(function (IvCombinaison $combinaison) { |
|
| 212 | + ->map(function(IvCombinaison $combinaison) { |
|
| 213 | 213 | return $combinaison->getLevel()->getLevel(); |
| 214 | 214 | }) |
| 215 | - ->sortBy(function ($value) { |
|
| 215 | + ->sortBy(function($value) { |
|
| 216 | 216 | return $value; |
| 217 | 217 | }) |
| 218 | 218 | ->first(); |
@@ -225,10 +225,10 @@ discard block |
||
| 225 | 225 | public function getMaxLevel(): ?float |
| 226 | 226 | { |
| 227 | 227 | return $this->getIvCombinaisons() |
| 228 | - ->map(function (IvCombinaison $combinaison) { |
|
| 228 | + ->map(function(IvCombinaison $combinaison) { |
|
| 229 | 229 | return $combinaison->getLevel()->getLevel(); |
| 230 | 230 | }) |
| 231 | - ->sortBy(function ($value) { |
|
| 231 | + ->sortBy(function($value) { |
|
| 232 | 232 | return $value; |
| 233 | 233 | }) |
| 234 | 234 | ->last(); |
@@ -53,8 +53,8 @@ |
||
| 53 | 53 | public function getIntervalLevelFiltered(float $min, float $max) |
| 54 | 54 | { |
| 55 | 55 | return $this->getGameMasterJsonCollection() |
| 56 | - ->filter(function ($level) use ($min, $max) { |
|
| 57 | - return (int)$min<=$level->level && $level->level<=(int)$max ? true: false; |
|
| 56 | + ->filter(function($level) use ($min, $max) { |
|
| 57 | + return (int) $min <= $level->level && $level->level <= (int) $max ? true: false; |
|
| 58 | 58 | }); |
| 59 | 59 | } |
| 60 | 60 | } |