Passed
Push — master ( 0b9cbc...153c68 )
by Kylian
01:27
created
lib/BeatSaverAPI.php 1 patch
Braces   +54 added lines, -19 removed lines patch added patch discarded remove patch
@@ -191,8 +191,9 @@  discard block
 block discarded – undo
191 191
                 if($apiResult === false || $apiResult == "Not Found") {
192 192
                     $response->setErrorStatus(true)->setErrorMessage("[getMaps] Something went wrong with the API call while calling page number " . $i . ".");
193 193
 
194
-                    if($apiResult == "Not Found")
195
-                        return $response;
194
+                    if($apiResult == "Not Found") {
195
+                                            return $response;
196
+                    }
196 197
                 }
197 198
 
198 199
                 foreach ($apiResult->docs as $beatmap) {
@@ -273,23 +274,57 @@  discard block
 block discarded – undo
273 274
 
274 275
         $endpoint = "/search/text/page?sortOrder=" . $sort[$sortOrder];
275 276
 
276
-        if($mapName)                $endpoint .= "&q=" . urlencode($mapName);
277
-        if($startDate)              $endpoint .= "&from=" . $startDate->format("Y-m-d");
278
-        if($endDate)                $endpoint .= "&to=" . $endDate->format("Y-m-d");
279
-        if($ranked)                 $endpoint .= "&ranked=" . /** @scrutinizer ignore-type */ var_export($ranked, true);
280
-        if($automapper)             $endpoint .= "&automapper=" . /** @scrutinizer ignore-type */ var_export($automapper, true);
281
-        if($chroma)                 $endpoint .= "&chroma=" . /** @scrutinizer ignore-type */ var_export($chroma, true);
282
-        if($noodle)                 $endpoint .= "&noodle=" . /** @scrutinizer ignore-type */ var_export($noodle, true);
283
-        if($cinema)                 $endpoint .= "&cinema=" . /** @scrutinizer ignore-type */ var_export($cinema, true);
284
-        if($fullSpread)             $endpoint .= "&fullSpread=" . /** @scrutinizer ignore-type */ var_export($fullSpread, true);
285
-        if($minBpm)                 $endpoint .= "&minBpm=" . /** @scrutinizer ignore-type */ $minBpm;
286
-        if($maxBpm)                 $endpoint .= "&maxBpm=" . /** @scrutinizer ignore-type */ $maxBpm;
287
-        if($minNps)                 $endpoint .= "&minNps=" . /** @scrutinizer ignore-type */ $minNps;
288
-        if($maxNps)                 $endpoint .= "&maxNps=" . /** @scrutinizer ignore-type */ $maxNps;
289
-        if($minRating)              $endpoint .= "&minRating=" . /** @scrutinizer ignore-type */ $minRating;
290
-        if($maxRating)              $endpoint .= "&maxRating=" . /** @scrutinizer ignore-type */ $maxRating;
291
-        if($minDuration !== null)   $endpoint .= "&minDuration=" . /** @scrutinizer ignore-type */ $minDuration;
292
-        if($maxDuration !== null)   $endpoint .= "&maxDuration=" . /** @scrutinizer ignore-type */ $maxDuration;
277
+        if($mapName) {
278
+            $endpoint .= "&q=" . urlencode($mapName);
279
+        }
280
+        if($startDate) {
281
+            $endpoint .= "&from=" . $startDate->format("Y-m-d");
282
+        }
283
+        if($endDate) {
284
+            $endpoint .= "&to=" . $endDate->format("Y-m-d");
285
+        }
286
+        if($ranked) {
287
+            $endpoint .= "&ranked=" . /** @scrutinizer ignore-type */ var_export($ranked, true);
288
+        }
289
+        if($automapper) {
290
+            $endpoint .= "&automapper=" . /** @scrutinizer ignore-type */ var_export($automapper, true);
291
+        }
292
+        if($chroma) {
293
+            $endpoint .= "&chroma=" . /** @scrutinizer ignore-type */ var_export($chroma, true);
294
+        }
295
+        if($noodle) {
296
+            $endpoint .= "&noodle=" . /** @scrutinizer ignore-type */ var_export($noodle, true);
297
+        }
298
+        if($cinema) {
299
+            $endpoint .= "&cinema=" . /** @scrutinizer ignore-type */ var_export($cinema, true);
300
+        }
301
+        if($fullSpread) {
302
+            $endpoint .= "&fullSpread=" . /** @scrutinizer ignore-type */ var_export($fullSpread, true);
303
+        }
304
+        if($minBpm) {
305
+            $endpoint .= "&minBpm=" . /** @scrutinizer ignore-type */ $minBpm;
306
+        }
307
+        if($maxBpm) {
308
+            $endpoint .= "&maxBpm=" . /** @scrutinizer ignore-type */ $maxBpm;
309
+        }
310
+        if($minNps) {
311
+            $endpoint .= "&minNps=" . /** @scrutinizer ignore-type */ $minNps;
312
+        }
313
+        if($maxNps) {
314
+            $endpoint .= "&maxNps=" . /** @scrutinizer ignore-type */ $maxNps;
315
+        }
316
+        if($minRating) {
317
+            $endpoint .= "&minRating=" . /** @scrutinizer ignore-type */ $minRating;
318
+        }
319
+        if($maxRating) {
320
+            $endpoint .= "&maxRating=" . /** @scrutinizer ignore-type */ $maxRating;
321
+        }
322
+        if($minDuration !== null) {
323
+            $endpoint .= "&minDuration=" . /** @scrutinizer ignore-type */ $minDuration;
324
+        }
325
+        if($maxDuration !== null) {
326
+            $endpoint .= "&maxDuration=" . /** @scrutinizer ignore-type */ $maxDuration;
327
+        }
293 328
 
294 329
         return $this->getMapsByEndpoint($endpoint, $numberOfPage, $startPage);
295 330
     }
Please login to merge, or discard this patch.