Passed
Push — master ( 5e5922...b57731 )
by Darko
10:53 queued 05:00
created
Blacklight/Genres.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
     private function getListQuery(string $type = '', bool $activeOnly = false): string
59 59
     {
60
-        if (! empty($type)) {
60
+        if (!empty($type)) {
61 61
             $typesql = sprintf(' AND g.type = %d', $type);
62 62
         } else {
63 63
             $typesql = '';
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
     public function getCount(string $type = '', bool $activeOnly = false): mixed
105 105
     {
106
-        if (! empty($type)) {
106
+        if (!empty($type)) {
107 107
             $typesql = sprintf(' AND g.type = %d', $type);
108 108
         } else {
109 109
             $typesql = '';
Please login to merge, or discard this patch.
Blacklight/Music.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 			%s %s %s
196 196
 			GROUP BY m.id
197 197
 			ORDER BY %s %s',
198
-            ! empty($musicIDs) ? 'WHERE m.id IN ('.implode(',', $musicIDs).')' : 'AND 1=1',
199
-            (! empty($releaseIDs)) ? 'AND r.id in ('.implode(',', $releaseIDs).')' : '',
198
+            !empty($musicIDs) ? 'WHERE m.id IN ('.implode(',', $musicIDs).')' : 'AND 1=1',
199
+            (!empty($releaseIDs)) ? 'AND r.id in ('.implode(',', $releaseIDs).')' : '',
200 200
             $catsrch,
201 201
             $order[0],
202 202
             $order[1]
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     {
262 262
         $browseby = ' ';
263 263
         foreach ($this->getBrowseByOptions() as $bbk => $bbv) {
264
-            if (! empty($_REQUEST[$bbk])) {
264
+            if (!empty($_REQUEST[$bbk])) {
265 265
                 $bbs = stripslashes($_REQUEST[$bbk]);
266 266
                 if (stripos($bbv, 'id') !== false) {
267 267
                     $browseby .= ' AND m.'.$bbv.' = '.$bbs;
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
             )
414 414
         );
415 415
 
416
-        if (! empty($res)) {
416
+        if (!empty($res)) {
417 417
             foreach ($res as $arr) {
418 418
                 $startTime = now();
419 419
                 $usedAmazon = false;
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
             $h = trim(preg_replace('/\s\s+/', ' ', $g));
487 487
             $newname = trim(preg_replace('/ [a-z]{2}$| [a-z]{3} \d{2,}$|\d{5,} \d{5,}$|-WEB$/i', '', $h));
488 488
 
489
-            if (! preg_match('/^[a-z0-9]+$/i', $newname) && strlen($newname) > 10) {
489
+            if (!preg_match('/^[a-z0-9]+$/i', $newname) && strlen($newname) > 10) {
490 490
                 $result['name'] = $newname;
491 491
 
492 492
                 return $result;
Please login to merge, or discard this patch.
Blacklight/Console.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
     {
276 276
         $browseBy = ' ';
277 277
         foreach ($this->getBrowseByOptions() as $bbk => $bbv) {
278
-            if (! empty($_REQUEST[$bbk])) {
278
+            if (!empty($_REQUEST[$bbk])) {
279 279
                 $bbs = stripslashes($_REQUEST[$bbk]);
280 280
                 $browseBy .= ' AND con.'.$bbv.' LIKE '.escapeString('%'.$bbs.'%');
281 281
             }
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
         $con['esrb'] = (string) $amaz->ItemAttributes->ESRBAgeRating;
401 401
         $con['releasedate'] = (string) $amaz->ItemAttributes->ReleaseDate;
402 402
 
403
-        if (! isset($con['releasedate'])) {
403
+        if (!isset($con['releasedate'])) {
404 404
             $con['releasedate'] = '';
405 405
         }
406 406
 
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
         if (config('config.credentials.client_id') !== '' && config('config.credentials.client_secret') !== '') {
629 629
             try {
630 630
                 $result = Game::where('name', $gameInfo)->get();
631
-                if (! empty($result)) {
631
+                if (!empty($result)) {
632 632
                     $bestMatchPct = 0;
633 633
                     foreach ($result as $res) {
634 634
                         similar_text(strtolower($gameInfo), strtolower($res->name), $percent);
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
                         ])->where('id', $bestMatch)->first();
647 647
 
648 648
                         $publishers = [];
649
-                        if (! empty($game->involved_companies)) {
649
+                        if (!empty($game->involved_companies)) {
650 650
                             foreach ($game->involved_companies as $publisher) {
651 651
                                 if ($publisher['publisher'] === true) {
652 652
                                     $company = Company::find($publisher['company']);
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 
658 658
                         $genres = [];
659 659
 
660
-                        if (! empty($game->themes)) {
660
+                        if (!empty($game->themes)) {
661 661
                             foreach ($game->themes as $theme) {
662 662
                                 $genres[] = $theme['name'];
663 663
                             }
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 
668 668
                         $platform = '';
669 669
 
670
-                        if (! empty($game->platforms)) {
670
+                        if (!empty($game->platforms)) {
671 671
                             foreach ($game->platforms as $platforms) {
672 672
                                 $percentCurrent = 0;
673 673
                                 $gamePlatforms = Platform::where('id', $platforms)->get();
@@ -686,13 +686,13 @@  discard block
 block discarded – undo
686 686
                             'title' => $game->name,
687 687
                             'asin' => $game->id,
688 688
                             'review' => $game->summary ?? '',
689
-                            'coverurl' => ! empty($game->cover->url) ? 'https:'.$game->cover->url : '',
690
-                            'releasedate' => ! empty($game->first_release_date) ? $game->first_release_date->format('Y-m-d') : now()->format('Y-m-d'),
691
-                            'esrb' => ! empty($game->aggregated_rating) ? round($game->aggregated_rating).'%' : 'Not Rated',
689
+                            'coverurl' => !empty($game->cover->url) ? 'https:'.$game->cover->url : '',
690
+                            'releasedate' => !empty($game->first_release_date) ? $game->first_release_date->format('Y-m-d') : now()->format('Y-m-d'),
691
+                            'esrb' => !empty($game->aggregated_rating) ? round($game->aggregated_rating).'%' : 'Not Rated',
692 692
                             'url' => $game->url ?? '',
693
-                            'publisher' => ! empty($publishers) ? implode(',', $publishers) : 'Unknown',
693
+                            'publisher' => !empty($publishers) ? implode(',', $publishers) : 'Unknown',
694 694
                             'platform' => $platform ?? '',
695
-                            'consolegenre' => ! empty($genres) ? implode(',', $genres) : 'Unknown',
695
+                            'consolegenre' => !empty($genres) ? implode(',', $genres) : 'Unknown',
696 696
                             'consolegenreid' => $genreKey ?? '',
697 697
                             'salesrank' => '',
698 698
                         ];
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
                 $platform = 'PSX';
836 836
             }
837 837
 
838
-            if (! empty($title) && stripos('XBLA', $platform) === 0 && stripos('dlc', $title) !== false) {
838
+            if (!empty($title) && stripos('XBLA', $platform) === 0 && stripos('dlc', $title) !== false) {
839 839
                 $platform = 'XBOX360';
840 840
             }
841 841
 
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
            Other option is to pass the $release->categories_id here if we don't find a platform but that
851 851
            would require an extra lookup to determine the name. In either case we should have a title at the minimum. */
852 852
 
853
-        return (isset($result['title'], $result['platform']) && ! empty($result['title'])) ? $result : false;
853
+        return (isset($result['title'], $result['platform']) && !empty($result['title'])) ? $result : false;
854 854
     }
855 855
 
856 856
     public function getBrowseNode($platform): string
Please login to merge, or discard this patch.
Blacklight/XXX.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 			%s %s %s %s
160 160
 			GROUP BY xxx.id
161 161
 			ORDER BY %s %s",
162
-            (! empty($xxxIDs) ? implode(',', $xxxIDs) : -1),
162
+            (!empty($xxxIDs) ? implode(',', $xxxIDs) : -1),
163 163
             $this->showPasswords,
164 164
             $this->getBrowseBy(),
165 165
             $catSrch,
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     {
212 212
         $browseBy = ' ';
213 213
         foreach (['title', 'director', 'actors', 'genre', 'id'] as $bb) {
214
-            if (! empty($_REQUEST[$bb])) {
214
+            if (!empty($_REQUEST[$bb])) {
215 215
                 $bbv = stripslashes($_REQUEST[$bb]);
216 216
                 if ($bb === 'genre') {
217 217
                     $bbv = $this->getGenreID($bbv);
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         string $cover = '',
247 247
         string $backdrop = ''
248 248
     ): void {
249
-        if (! empty($id)) {
249
+        if (!empty($id)) {
250 250
             XxxInfo::query()->where('id', $id)->update(
251 251
                 [
252 252
                     'title' => $title,
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
     public function getGenres(bool $activeOnly = false, $gid = null): mixed
289 289
     {
290 290
         if ($activeOnly) {
291
-            return Genre::query()->where(['disabled' => 0, 'type' => Category::XXX_ROOT])->when($gid !== null, function ($query) use ($gid) {
291
+            return Genre::query()->where(['disabled' => 0, 'type' => Category::XXX_ROOT])->when($gid !== null, function($query) use ($gid) {
292 292
                 return $query->where('id', $gid);
293 293
             })->orderBy('title')->first(['title']);
294 294
         }
295 295
 
296
-        return Genre::query()->where(['type' => Category::XXX_ROOT])->when($gid !== null, function ($query) use ($gid) {
296
+        return Genre::query()->where(['type' => Category::XXX_ROOT])->when($gid !== null, function($query) use ($gid) {
297 297
             return $query->where('id', $gid);
298 298
         })->orderBy('title')->first(['title']);
299 299
     }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
     {
309 309
         $ret = null;
310 310
 
311
-        if (! \is_array($arr)) {
311
+        if (!\is_array($arr)) {
312 312
             $res = Genre::query()->where('title', $arr)->first(['id']);
313 313
             if ($res !== null) {
314 314
                 return $res['id'];
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
     public function insertSwf($whichClass, $res): string
349 349
     {
350 350
         $ret = '';
351
-        if (($whichClass === 'ade') && ! empty($res)) {
351
+        if (($whichClass === 'ade') && !empty($res)) {
352 352
             $trailers = unserialize($res, 'ade');
353 353
             $ret .= "<object width='360' height='240' type='application/x-shockwave-flash' id='EmpireFlashPlayer' name='EmpireFlashPlayer' data='".$trailers['url']."'>";
354 354
             $ret .= "<param name='flashvars' value= 'streamID=".$trailers['streamid'].'&amp;autoPlay=false&amp;BaseStreamingUrl='.$trailers['baseurl']."'>";
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 
357 357
             return $ret;
358 358
         }
359
-        if (($whichClass === 'pop') && ! empty($res)) {
359
+        if (($whichClass === 'pop') && !empty($res)) {
360 360
             $trailers = unserialize($res, 'pop');
361 361
             $ret .= "<embed id='trailer' width='480' height='360'";
362 362
             $ret .= "flashvars='".$trailers['flashvars']."' allowfullscreen='true' allowscriptaccess='always' quality='high' name='trailer' style='undefined'";
@@ -433,22 +433,22 @@  discard block
 block discarded – undo
433 433
             return -2;
434 434
         }
435 435
 
436
-        $res['cast'] = ! empty($res['cast']) ? implode(',', $res['cast']) : '';
437
-        $res['genres'] = ! empty($res['genres']) ? $this->getGenreID($res['genres']) : '';
436
+        $res['cast'] = !empty($res['cast']) ? implode(',', $res['cast']) : '';
437
+        $res['genres'] = !empty($res['genres']) ? $this->getGenreID($res['genres']) : '';
438 438
 
439 439
         $mov = [
440
-            'trailers' => ! empty($res['trailers']) ? serialize($res['trailers']) : '',
441
-            'extras' => ! empty($res['extras']) ? serialize($res['extras']) : '',
442
-            'productinfo' => ! empty($res['productinfo']) ? serialize($res['productinfo']) : '',
443
-            'backdrop' => ! empty($res['backcover']) ? $res['backcover'] : 0,
444
-            'cover' => ! empty($res['boxcover']) ? $res['boxcover'] : 0,
445
-            'title' => ! empty($res['title']) ? html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8') : '',
446
-            'plot' => ! empty($res['synopsis']) ? html_entity_decode($res['synopsis'], ENT_QUOTES, 'UTF-8') : '',
447
-            'tagline' => ! empty($res['tagline']) ? html_entity_decode($res['tagline'], ENT_QUOTES, 'UTF-8') : '',
448
-            'genre' => ! empty($res['genres']) ? html_entity_decode($res['genres'], ENT_QUOTES, 'UTF-8') : '',
449
-            'director' => ! empty($res['director']) ? html_entity_decode($res['director'], ENT_QUOTES, 'UTF-8') : '',
450
-            'actors' => ! empty($res['cast']) ? html_entity_decode($res['cast'], ENT_QUOTES, 'UTF-8') : '',
451
-            'directurl' => ! empty($res['directurl']) ? html_entity_decode($res['directurl'], ENT_QUOTES, 'UTF-8') : '',
440
+            'trailers' => !empty($res['trailers']) ? serialize($res['trailers']) : '',
441
+            'extras' => !empty($res['extras']) ? serialize($res['extras']) : '',
442
+            'productinfo' => !empty($res['productinfo']) ? serialize($res['productinfo']) : '',
443
+            'backdrop' => !empty($res['backcover']) ? $res['backcover'] : 0,
444
+            'cover' => !empty($res['boxcover']) ? $res['boxcover'] : 0,
445
+            'title' => !empty($res['title']) ? html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8') : '',
446
+            'plot' => !empty($res['synopsis']) ? html_entity_decode($res['synopsis'], ENT_QUOTES, 'UTF-8') : '',
447
+            'tagline' => !empty($res['tagline']) ? html_entity_decode($res['tagline'], ENT_QUOTES, 'UTF-8') : '',
448
+            'genre' => !empty($res['genres']) ? html_entity_decode($res['genres'], ENT_QUOTES, 'UTF-8') : '',
449
+            'director' => !empty($res['director']) ? html_entity_decode($res['director'], ENT_QUOTES, 'UTF-8') : '',
450
+            'actors' => !empty($res['cast']) ? html_entity_decode($res['cast'], ENT_QUOTES, 'UTF-8') : '',
451
+            'directurl' => !empty($res['directurl']) ? html_entity_decode($res['directurl'], ENT_QUOTES, 'UTF-8') : '',
452 452
             'classused' => $this->whichClass,
453 453
         ];
454 454
 
@@ -458,12 +458,12 @@  discard block
 block discarded – undo
458 458
             $xxxID = $check['id'];
459 459
 
460 460
             // Update BoxCover.
461
-            if (! empty($mov['cover'])) {
461
+            if (!empty($mov['cover'])) {
462 462
                 $cover = $this->releaseImage->saveImage($xxxID.'-cover', $mov['cover'], $this->imgSavePath);
463 463
             }
464 464
 
465 465
             // BackCover.
466
-            if (! empty($mov['backdrop'])) {
466
+            if (!empty($mov['backdrop'])) {
467 467
                 $backdrop = $this->releaseImage->saveImage($xxxID.'-backdrop', $mov['backdrop'], $this->imgSavePath, 1920, 1024);
468 468
             }
469 469
 
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
                 ]
492 492
             );
493 493
             // Update BoxCover.
494
-            if (! empty($mov['cover'])) {
494
+            if (!empty($mov['cover'])) {
495 495
                 $cover = $this->releaseImage->saveImage($xxxID.'-cover', $mov['cover'], $this->imgSavePath);
496 496
             }
497 497
 
498 498
             // BackCover.
499
-            if (! empty($mov['backdrop'])) {
499
+            if (!empty($mov['backdrop'])) {
500 500
                 $backdrop = $this->releaseImage->saveImage($xxxID.'-backdrop', $mov['backdrop'], $this->imgSavePath, 1920, 1024);
501 501
             }
502 502
 
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
             $name = trim(preg_replace('/(brazilian|chinese|croatian|danish|deutsch|dutch|estonian|flemish|finnish|french|german|greek|hebrew|icelandic|italian|latin|nordic|norwegian|polish|portuguese|japenese|japanese|russian|serbian|slovenian|spanish|spanisch|swedish|thai|turkish)$/i', '', $name));
610 610
 
611 611
             // Check if the name is long enough and not just numbers and not file (d) of (d) and does not contain Episodes and any dated 00.00.00 which are site rips..
612
-            if (\strlen($name) > 5 && ! preg_match('/^\d+$/', $name) && ! preg_match('/( File \d+ of \d+|\d+.\d+.\d+)/', $name) && ! preg_match('/(E\d+)/', $name) && ! preg_match('/\d\d\.\d\d.\d\d/', $name)) {
612
+            if (\strlen($name) > 5 && !preg_match('/^\d+$/', $name) && !preg_match('/( File \d+ of \d+|\d+.\d+.\d+)/', $name) && !preg_match('/(E\d+)/', $name) && !preg_match('/\d\d\.\d\d.\d\d/', $name)) {
613 613
                 $this->currentTitle = $name;
614 614
 
615 615
                 return true;
Please login to merge, or discard this patch.
Blacklight/Books.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 			%s
170 170
 			GROUP BY boo.id
171 171
 			ORDER BY %s %s',
172
-            \is_array($bookIDs) && ! empty($bookIDs) ? implode(',', $bookIDs) : -1,
173
-            \is_array($releaseIDs) && ! empty($releaseIDs) ? implode(',', $releaseIDs) : -1,
172
+            \is_array($bookIDs) && !empty($bookIDs) ? implode(',', $bookIDs) : -1,
173
+            \is_array($releaseIDs) && !empty($releaseIDs) ? implode(',', $releaseIDs) : -1,
174 174
             $catsrch,
175 175
             $order[0],
176 176
             $order[1]
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
     {
236 236
         $browseby = ' ';
237 237
         foreach ($this->getBrowseByOptions() as $bbk => $bbv) {
238
-            if (! empty($_REQUEST[$bbk])) {
238
+            if (!empty($_REQUEST[$bbk])) {
239 239
                 $bbs = stripslashes($_REQUEST[$bbk]);
240 240
                 $browseby .= ' AND boo.'.$bbv.' '.'LIKE '.escapeString('%'.$bbs.'%');
241 241
             }
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
                 return false;
366 366
             }
367 367
 
368
-            if (preg_match('/^([a-z0-9ü!]+ ){1,2}(N|Vol)?\d{1,4}([abc])?$|^([a-z0-9]+ ){1,2}(Jan( |unar|$)|Feb( |ruary|$)|Mar( |ch|$)|Apr( |il|$)|May(?![a-z0-9])|Jun([ e$])|Jul([ y$])|Aug( |ust|$)|Sep( |tember|$)|O([ck])t( |ober|$)|Nov( |ember|$)|De([cz])( |ember|$))/ui', $releasename) && ! preg_match('/Part \d+/i', $releasename)) {
368
+            if (preg_match('/^([a-z0-9ü!]+ ){1,2}(N|Vol)?\d{1,4}([abc])?$|^([a-z0-9]+ ){1,2}(Jan( |unar|$)|Feb( |ruary|$)|Mar( |ch|$)|Apr( |il|$)|May(?![a-z0-9])|Jun([ e$])|Jul([ y$])|Aug( |ust|$)|Sep( |tember|$)|O([ck])t( |ober|$)|Nov( |ember|$)|De([cz])( |ember|$))/ui', $releasename) && !preg_match('/Part \d+/i', $releasename)) {
369 369
                 if ($this->echooutput) {
370 370
                     $this->colorCli->headerOver('Changing category to magazines: ').$this->colorCli->primary($releasename);
371 371
                 }
@@ -373,14 +373,14 @@  discard block
 block discarded – undo
373 373
 
374 374
                 return false;
375 375
             }
376
-            if (! empty($releasename) && ! preg_match('/^[a-z0-9]+$|^([0-9]+ ){1,}$|Part \d+/i', $releasename)) {
376
+            if (!empty($releasename) && !preg_match('/^[a-z0-9]+$|^([0-9]+ ){1,}$|Part \d+/i', $releasename)) {
377 377
                 return $releasename;
378 378
             }
379 379
 
380 380
             return false;
381 381
         }
382 382
         if ($releasetype === 'audiobook') {
383
-            if (! empty($releasename) && ! preg_match('/^[a-z0-9]+$|^([0-9]+ ){1,}$|Part \d+/i', $releasename)) {
383
+            if (!empty($releasename) && !preg_match('/^[a-z0-9]+$|^([0-9]+ ){1,}$|Part \d+/i', $releasename)) {
384 384
                 // we can skip category for audiobooks, since we already know it, so as long as the release name is valid return it so that it is postprocessed by amazon.  In the future, determining the type of audiobook could be added (Lecture or book), since we can skip lookups on lectures, but for now handle them all the same way
385 385
                 return $releasename;
386 386
             }
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 
405 405
         $book = false;
406 406
         if ($bookInfo !== '') {
407
-            if (! $book) {
407
+            if (!$book) {
408 408
                 $this->colorCli->info('Fetching data from iTunes for '.$bookInfo);
409 409
                 $book = $this->fetchItunesBookProperties($bookInfo);
410 410
             } elseif ($amazdata !== null) {
@@ -511,12 +511,12 @@  discard block
 block discarded – undo
511 511
                 'salesrank' => '',
512 512
                 'publisher' => '',
513 513
                 'pages' => '',
514
-                'coverurl' => ! empty($iTunesBook->getCover()) ? str_replace('100x100', '800x800', $iTunesBook->getCover()) : '',
514
+                'coverurl' => !empty($iTunesBook->getCover()) ? str_replace('100x100', '800x800', $iTunesBook->getCover()) : '',
515 515
                 'genre' => implode(', ', $iTunesBook->getGenre()),
516 516
                 'overview' => strip_tags($iTunesBook->getDescription()),
517 517
                 'publishdate' => $iTunesBook->getReleaseDate()->format('Y-m-d'),
518 518
             ];
519
-            if (! empty($book['coverurl'])) {
519
+            if (!empty($book['coverurl'])) {
520 520
                 $book['cover'] = 1;
521 521
             } else {
522 522
                 $book['cover'] = 0;
Please login to merge, or discard this patch.
Blacklight/Movie.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $this->config->language = $this->lookuplanguage;
138 138
         $this->config->throwHttpExceptions = false;
139 139
         $cacheDir = storage_path('framework/cache/imdb_cache');
140
-        if (! File::isDirectory($cacheDir)) {
140
+        if (!File::isDirectory($cacheDir)) {
141 141
             File::makeDirectory($cacheDir, 0777, false, true);
142 142
         }
143 143
         $this->config->cachedir = $cacheDir;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 					ORDER BY %s %s %s",
191 191
                 $this->showPasswords,
192 192
                 $this->getBrowseBy(),
193
-                (! empty($catsrch) ? $catsrch : ''),
193
+                (!empty($catsrch) ? $catsrch : ''),
194 194
                 (
195 195
                     $maxAge > 0
196 196
                         ? 'AND r.postdate > NOW() - INTERVAL '.$maxAge.'DAY '
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             Cache::put(md5($moviesSql.$page), $movies, $expiresAt);
211 211
         }
212 212
         $movieIDs = $releaseIDs = [];
213
-        if (! empty($movies['result'])) {
213
+        if (!empty($movies['result'])) {
214 214
             foreach ($movies['result'] as $movie => $id) {
215 215
                 $movieIDs[] = $id->imdbid;
216 216
                 $releaseIDs[] = $id->grp_release_id;
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
 			AND r.id IN (%s) %s
250 250
 			GROUP BY m.imdbid
251 251
 			ORDER BY %s %s",
252
-            (\is_array($movieIDs) && ! empty($movieIDs) ? implode(',', $movieIDs) : -1),
253
-            (\is_array($releaseIDs) && ! empty($releaseIDs) ? implode(',', $releaseIDs) : -1),
254
-            (! empty($catsrch) ? $catsrch : ''),
252
+            (\is_array($movieIDs) && !empty($movieIDs) ? implode(',', $movieIDs) : -1),
253
+            (\is_array($releaseIDs) && !empty($releaseIDs) ? implode(',', $releaseIDs) : -1),
254
+            (!empty($catsrch) ? $catsrch : ''),
255 255
             $order[0],
256 256
             $order[1]
257 257
         );
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         $browseBy = ' ';
298 298
         $browseByArr = ['title', 'director', 'actors', 'genre', 'rating', 'year', 'imdb'];
299 299
         foreach ($browseByArr as $bb) {
300
-            if (request()->has($bb) && ! empty(request()->input($bb))) {
300
+            if (request()->has($bb) && !empty(request()->input($bb))) {
301 301
                 $bbv = stripslashes(request()->input($bb));
302 302
                 if ($bb === 'rating') {
303 303
                     $bbv .= '.';
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
         if ($this->traktcheck !== null) {
332 332
             $data = $this->traktTv->client->movieSummary('tt'.$imdbId, 'full');
333
-            if (($data !== false) && ! empty($data['trailer'])) {
333
+            if (($data !== false) && !empty($data['trailer'])) {
334 334
                 return $data['trailer'];
335 335
             }
336 336
         }
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
             return false;
357 357
         }
358 358
 
359
-        if (! empty($data['trailer'])) {
359
+        if (!empty($data['trailer'])) {
360 360
             $data['trailer'] = str_ireplace(
361 361
                 ['watch?v=', 'http://'],
362 362
                 ['embed/', 'https://'],
@@ -390,17 +390,17 @@  discard block
 block discarded – undo
390 390
      */
391 391
     private function checkTraktValue($value)
392 392
     {
393
-        if (\is_array($value) && ! empty($value)) {
393
+        if (\is_array($value) && !empty($value)) {
394 394
             $temp = '';
395 395
             foreach ($value as $val) {
396
-                if (! \is_array($val) && ! \is_object($val)) {
396
+                if (!\is_array($val) && !\is_object($val)) {
397 397
                     $temp .= $val;
398 398
                 }
399 399
             }
400 400
             $value = $temp;
401 401
         }
402 402
 
403
-        return ! empty($value) ? $value : '';
403
+        return !empty($value) ? $value : '';
404 404
     }
405 405
 
406 406
     /**
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
      */
422 422
     public function update(array $values): bool
423 423
     {
424
-        if (! \count($values)) {
424
+        if (!\count($values)) {
425 425
             return false;
426 426
         }
427 427
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
         $onDuplicateKey = ['created_at' => now()];
430 430
         $found = 0;
431 431
         foreach ($values as $key => $value) {
432
-            if (! empty($value)) {
432
+            if (!empty($value)) {
433 433
                 $found++;
434 434
                 if (\in_array($key, ['genre', 'language'], false)) {
435 435
                     $value = substr($value, 0, 64);
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                 $onDuplicateKey += [$key => $value];
439 439
             }
440 440
         }
441
-        if (! $found) {
441
+        if (!$found) {
442 442
             return false;
443 443
         }
444 444
         foreach ($query as $key => $value) {
@@ -455,19 +455,19 @@  discard block
 block discarded – undo
455 455
      */
456 456
     protected function setVariables(string|array $variable1, string|array $variable2, string|array $variable3, string|array $variable4, string|array $variable5)
457 457
     {
458
-        if (! empty($variable1)) {
458
+        if (!empty($variable1)) {
459 459
             return $variable1;
460 460
         }
461
-        if (! empty($variable2)) {
461
+        if (!empty($variable2)) {
462 462
             return $variable2;
463 463
         }
464
-        if (! empty($variable3)) {
464
+        if (!empty($variable3)) {
465 465
             return $variable3;
466 466
         }
467
-        if (! empty($variable4)) {
467
+        if (!empty($variable4)) {
468 468
             return $variable4;
469 469
         }
470
-        if (! empty($variable5)) {
470
+        if (!empty($variable5)) {
471 471
             return $variable5;
472 472
         }
473 473
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 
503 503
         $iTunes = $this->fetchItunesMovieProperties($this->currentTitle);
504 504
 
505
-        if (! $imdb && ! $tmdb && ! $trakt && ! $omdb && empty($iTunes)) {
505
+        if (!$imdb && !$tmdb && !$trakt && !$omdb && empty($iTunes)) {
506 506
             return false;
507 507
         }
508 508
 
@@ -515,36 +515,36 @@  discard block
 block discarded – undo
515 515
         $mov['type'] = $mov['director'] = $mov['actors'] = $mov['language'] = '';
516 516
 
517 517
         $mov['imdbid'] = $imdbId;
518
-        $mov['tmdbid'] = (! isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid'];
519
-        $mov['traktid'] = (! isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id'];
518
+        $mov['tmdbid'] = (!isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid'];
519
+        $mov['traktid'] = (!isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id'];
520 520
 
521 521
         // Prefer Fanart.tv cover over TMDB,TMDB over IMDB,IMDB over OMDB and OMDB over iTunes.
522
-        if (! empty($fanart['cover'])) {
522
+        if (!empty($fanart['cover'])) {
523 523
             $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $fanart['cover'], $this->imgSavePath);
524
-        } elseif (! empty($tmdb['cover'])) {
524
+        } elseif (!empty($tmdb['cover'])) {
525 525
             $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $tmdb['cover'], $this->imgSavePath);
526
-        } elseif (! empty($imdb['cover'])) {
526
+        } elseif (!empty($imdb['cover'])) {
527 527
             $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $imdb['cover'], $this->imgSavePath);
528
-        } elseif (! empty($omdb['cover'])) {
528
+        } elseif (!empty($omdb['cover'])) {
529 529
             $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $omdb['cover'], $this->imgSavePath);
530
-        } elseif (! empty($iTunes['cover'])) {
530
+        } elseif (!empty($iTunes['cover'])) {
531 531
             $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $iTunes['cover'], $this->imgSavePath);
532 532
         }
533 533
 
534 534
         // Backdrops.
535
-        if (! empty($fanart['backdrop'])) {
535
+        if (!empty($fanart['backdrop'])) {
536 536
             $mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $fanart['backdrop'], $this->imgSavePath, 1920, 1024);
537
-        } elseif (! empty($tmdb['backdrop'])) {
537
+        } elseif (!empty($tmdb['backdrop'])) {
538 538
             $mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $tmdb['backdrop'], $this->imgSavePath, 1920, 1024);
539 539
         }
540 540
 
541 541
         // Banner
542
-        if (! empty($fanart['banner'])) {
542
+        if (!empty($fanart['banner'])) {
543 543
             $mov['banner'] = $this->releaseImage->saveImage($imdbId.'-banner', $fanart['banner'], $this->imgSavePath);
544 544
         }
545 545
 
546 546
         // RottenTomatoes rating from OmdbAPI
547
-        if ($omdb !== false && ! empty($omdb['rtRating'])) {
547
+        if ($omdb !== false && !empty($omdb['rtRating'])) {
548 548
             $mov['rtrating'] = $omdb['rtRating'];
549 549
         }
550 550
 
@@ -555,29 +555,29 @@  discard block
 block discarded – undo
555 555
         $mov['year'] = $this->setVariables($imdb['year'] ?? '', $tmdb['year'] ?? '', $trakt['year'] ?? '', $omdb['year'] ?? '', $iTunes['year'] ?? '');
556 556
         $mov['genre'] = $this->setVariables($imdb['genre'] ?? '', $tmdb['genre'] ?? '', $trakt['genres'] ?? '', $omdb['genre'] ?? '', $iTunes['genre'] ?? '');
557 557
 
558
-        if (! empty($imdb['type'])) {
558
+        if (!empty($imdb['type'])) {
559 559
             $mov['type'] = $imdb['type'];
560 560
         }
561 561
 
562
-        if (! empty($imdb['director'])) {
562
+        if (!empty($imdb['director'])) {
563 563
             $mov['director'] = \is_array($imdb['director']) ? implode(', ', array_unique($imdb['director'])) : $imdb['director'];
564
-        } elseif (! empty($omdb['director'])) {
564
+        } elseif (!empty($omdb['director'])) {
565 565
             $mov['director'] = \is_array($omdb['director']) ? implode(', ', array_unique($omdb['director'])) : $omdb['director'];
566
-        } elseif (! empty($tmdb['director'])) {
566
+        } elseif (!empty($tmdb['director'])) {
567 567
             $mov['director'] = \is_array($tmdb['director']) ? implode(', ', array_unique($tmdb['director'])) : $tmdb['director'];
568 568
         }
569 569
 
570
-        if (! empty($imdb['actors'])) {
570
+        if (!empty($imdb['actors'])) {
571 571
             $mov['actors'] = \is_array($imdb['actors']) ? implode(', ', array_unique($imdb['actors'])) : $imdb['actors'];
572
-        } elseif (! empty($omdb['actors'])) {
572
+        } elseif (!empty($omdb['actors'])) {
573 573
             $mov['actors'] = \is_array($omdb['actors']) ? implode(', ', array_unique($omdb['actors'])) : $omdb['actors'];
574
-        } elseif (! empty($tmdb['actors'])) {
574
+        } elseif (!empty($tmdb['actors'])) {
575 575
             $mov['actors'] = \is_array($tmdb['actors']) ? implode(', ', array_unique($tmdb['actors'])) : $tmdb['actors'];
576 576
         }
577 577
 
578
-        if (! empty($imdb['language'])) {
578
+        if (!empty($imdb['language'])) {
579 579
             $mov['language'] = \is_array($imdb['language']) ? implode(', ', array_unique($imdb['language'])) : $imdb['language'];
580
-        } elseif (! empty($omdb['language']) && ! is_bool($omdb['language'])) {
580
+        } elseif (!empty($omdb['language']) && !is_bool($omdb['language'])) {
581 581
             $mov['language'] = \is_array($omdb['language']) ? implode(', ', array_unique($omdb['language'])) : $omdb['language'];
582 582
         }
583 583
 
@@ -635,20 +635,20 @@  discard block
 block discarded – undo
635 635
         if ($this->fanartapikey !== null) {
636 636
             $art = $this->fanart->getMovieFanArt('tt'.$imdbId);
637 637
 
638
-            if (! empty($art)) {
638
+            if (!empty($art)) {
639 639
                 if (isset($art['status']) && $art['status'] === 'error') {
640 640
                     return false;
641 641
                 }
642 642
                 $ret = [];
643
-                if (! empty($art['moviebackground'][0]['url'])) {
643
+                if (!empty($art['moviebackground'][0]['url'])) {
644 644
                     $ret['backdrop'] = $art['moviebackground'][0]['url'];
645
-                } elseif (! empty($art['moviethumb'][0]['url'])) {
645
+                } elseif (!empty($art['moviethumb'][0]['url'])) {
646 646
                     $ret['backdrop'] = $art['moviethumb'][0]['url'];
647 647
                 }
648
-                if (! empty($art['movieposter'][0]['url'])) {
648
+                if (!empty($art['movieposter'][0]['url'])) {
649 649
                     $ret['cover'] = $art['movieposter'][0]['url'];
650 650
                 }
651
-                if (! empty($art['moviebanner'][0]['url'])) {
651
+                if (!empty($art['moviebanner'][0]['url'])) {
652 652
                     $ret['banner'] = $art['moviebanner'][0]['url'];
653 653
                 }
654 654
 
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
             return false;
686 686
         }
687 687
 
688
-        if (! empty($tmdbLookup)) {
688
+        if (!empty($tmdbLookup)) {
689 689
             if ($this->currentTitle !== '') {
690 690
                 // Check the similarity.
691 691
                 similar_text($this->currentTitle, $tmdbLookup['title'], $percent);
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
                 $ret['rating'] = '';
715 715
             }
716 716
             $actors = Arr::pluck($tmdbLookup['credits']['cast'], 'name');
717
-            if (! empty($actors)) {
717
+            if (!empty($actors)) {
718 718
                 $ret['actors'] = $actors;
719 719
             } else {
720 720
                 $ret['actors'] = '';
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
                 }
726 726
             }
727 727
             $overview = $tmdbLookup['overview'];
728
-            if (! empty($overview)) {
728
+            if (!empty($overview)) {
729 729
                 $ret['plot'] = $overview;
730 730
             } else {
731 731
                 $ret['plot'] = '';
@@ -735,13 +735,13 @@  discard block
 block discarded – undo
735 735
             $ret['tagline'] = $tagline ?? '';
736 736
 
737 737
             $released = $tmdbLookup['release_date'];
738
-            if (! empty($released)) {
738
+            if (!empty($released)) {
739 739
                 $ret['year'] = Carbon::parse($released)->year;
740 740
             } else {
741 741
                 $ret['year'] = '';
742 742
             }
743 743
             $genresa = $tmdbLookup['genres'];
744
-            if (! empty($genresa) && \count($genresa) > 0) {
744
+            if (!empty($genresa) && \count($genresa) > 0) {
745 745
                 $genres = [];
746 746
                 foreach ($genresa as $genre) {
747 747
                     $genres[] = $genre['name'];
@@ -751,13 +751,13 @@  discard block
 block discarded – undo
751 751
                 $ret['genre'] = '';
752 752
             }
753 753
             $posterp = $tmdbLookup['poster_path'];
754
-            if (! empty($posterp)) {
754
+            if (!empty($posterp)) {
755 755
                 $ret['cover'] = 'https://image.tmdb.org/t/p/original'.$posterp;
756 756
             } else {
757 757
                 $ret['cover'] = '';
758 758
             }
759 759
             $backdrop = $tmdbLookup['backdrop_path'];
760
-            if (! empty($backdrop)) {
760
+            if (!empty($backdrop)) {
761 761
                 $ret['backdrop'] = 'https://image.tmdb.org/t/p/original'.$backdrop;
762 762
             } else {
763 763
                 $ret['backdrop'] = '';
@@ -779,9 +779,9 @@  discard block
 block discarded – undo
779 779
     {
780 780
         $realId = (new Title($imdbId, $this->config))->real_id();
781 781
         $result = new Title($realId, $this->config);
782
-        $title = ! empty($result->orig_title()) ? $result->orig_title() : $result->title();
783
-        if (! empty($title)) {
784
-            if (! empty($this->currentTitle)) {
782
+        $title = !empty($result->orig_title()) ? $result->orig_title() : $result->title();
783
+        if (!empty($title)) {
784
+            if (!empty($this->currentTitle)) {
785 785
                 similar_text($this->currentTitle, $title, $percent);
786 786
                 if ($percent >= self::MATCH_PERCENT) {
787 787
                     similar_text($this->currentYear, $result->year(), $percent);
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
                             'title' => $title,
791 791
                             'tagline' => $result->tagline() ?? '',
792 792
                             'plot' => Arr::get($result->plot_split(), '0.plot'),
793
-                            'rating' => ! empty($result->rating()) ? $result->rating() : '',
793
+                            'rating' => !empty($result->rating()) ? $result->rating() : '',
794 794
                             'year' => $result->year() ?? '',
795 795
                             'cover' => $result->photo() ?? '',
796 796
                             'genre' => $result->genre() ?? '',
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
                 'title' => $title,
816 816
                 'tagline' => $result->tagline() ?? '',
817 817
                 'plot' => Arr::get($result->plot_split(), '0.plot'),
818
-                'rating' => ! empty($result->rating()) ? $result->rating() : '',
818
+                'rating' => !empty($result->rating()) ? $result->rating() : '',
819 819
                 'year' => $result->year() ?? '',
820 820
                 'cover' => $result->photo() ?? '',
821 821
                 'genre' => $result->genre() ?? '',
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
         if ($this->omdbapikey !== null) {
890 890
             $resp = $this->omdbApi->fetch('i', 'tt'.$imdbId);
891 891
 
892
-            if (\is_object($resp) && $resp->message === 'OK' && ! Str::contains($resp->data->Response, 'Error:') && $resp->data->Response !== 'False') {
892
+            if (\is_object($resp) && $resp->message === 'OK' && !Str::contains($resp->data->Response, 'Error:') && $resp->data->Response !== 'False') {
893 893
                 similar_text($this->currentTitle, $resp->data->Title, $percent);
894 894
                 if ($percent >= self::MATCH_PERCENT) {
895 895
                     similar_text($this->currentYear, $resp->data->Year, $percent);
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
             // Loop over releases.
1056 1056
             foreach ($res as $arr) {
1057 1057
                 // Try to get a name/year.
1058
-                if (! $this->parseMovieSearchName($arr['searchname'])) {
1058
+                if (!$this->parseMovieSearchName($arr['searchname'])) {
1059 1059
                     //We didn't find a name, so set to all 0's so we don't parse again.
1060 1060
                     Release::query()->where('id', $arr['id'])->update(['imdbid' => 0000000]);
1061 1061
 
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
                     try {
1090 1090
                         $imdbSearch = new TitleSearch($this->config);
1091 1091
                         foreach ($imdbSearch->search($this->currentTitle, [TitleSearch::MOVIE]) as $imdbTitle) {
1092
-                            if (! empty($imdbTitle->title())) {
1092
+                            if (!empty($imdbTitle->title())) {
1093 1093
                                 similar_text($imdbTitle->title(), $this->currentTitle, $percent);
1094 1094
                                 if ($percent >= self::MATCH_PERCENT) {
1095 1095
                                     similar_text($this->currentYear, $imdbTitle->year(), $percent);
@@ -1119,10 +1119,10 @@  discard block
 block discarded – undo
1119 1119
                             $buffer = $this->omdbApi->search($omdbTitle, 'movie');
1120 1120
                         }
1121 1121
 
1122
-                        if (\is_object($buffer) && $buffer->message === 'OK' && ! Str::contains($buffer->data->Response, 'Error:') && $buffer->data->Response === 'True') {
1122
+                        if (\is_object($buffer) && $buffer->message === 'OK' && !Str::contains($buffer->data->Response, 'Error:') && $buffer->data->Response === 'True') {
1123 1123
                             $getIMDBid = $buffer->data->Search[0]->imdbID;
1124 1124
 
1125
-                            if (! empty($getIMDBid)) {
1125
+                            if (!empty($getIMDBid)) {
1126 1126
                                 $imdbId = $this->doMovieUpdate($getIMDBid, 'OMDbAPI', $arr['id']);
1127 1127
                                 if ($imdbId !== false) {
1128 1128
                                     $movieUpdated = true;
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
                     $data = $this->traktTv->client->movieSummary($movieName, 'full');
1138 1138
                     if ($data !== false) {
1139 1139
                         $this->parseTraktTv($data);
1140
-                        if (! empty($data['ids']['imdb'])) {
1140
+                        if (!empty($data['ids']['imdb'])) {
1141 1141
                             $imdbId = $this->doMovieUpdate($data['ids']['imdb'], 'Trakt', $arr['id']);
1142 1142
                             if ($imdbId !== false) {
1143 1143
                                 $movieUpdated = true;
@@ -1150,13 +1150,13 @@  discard block
 block discarded – undo
1150 1150
                 if ($movieUpdated === false) {
1151 1151
                     try {
1152 1152
                         $data = Tmdb::getSearchApi()->searchMovies($this->currentTitle);
1153
-                        if (($data['total_results'] > 0) && ! empty($data['results'])) {
1153
+                        if (($data['total_results'] > 0) && !empty($data['results'])) {
1154 1154
                             foreach ($data['results'] as $result) {
1155
-                                if (! empty($result['id']) && ! empty($result['release_date'])) {
1155
+                                if (!empty($result['id']) && !empty($result['release_date'])) {
1156 1156
                                     similar_text($this->currentYear, Carbon::parse($result['release_date'])->year, $percent);
1157 1157
                                     if ($percent >= self::YEAR_MATCH_PERCENT) {
1158 1158
                                         $ret = $this->fetchTMDBProperties($result['id'], true);
1159
-                                        if ($ret !== false && ! empty($ret['imdbid'])) {
1159
+                                        if ($ret !== false && !empty($ret['imdbid'])) {
1160 1160
                                             $imdbId = $this->doMovieUpdate('tt'.$ret['imdbid'], 'TMDB', $arr['id']);
1161 1161
                                             if ($imdbId !== false) {
1162 1162
                                                 $movieUpdated = true;
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
             // Finally remove multiple spaces and trim leading spaces.
1258 1258
             $name = trim(preg_replace('/\s{2,}/', ' ', $name));
1259 1259
             // Check if the name is long enough and not just numbers.
1260
-            if (\strlen($name) > 4 && ! preg_match('/^\d+$/', $name)) {
1260
+            if (\strlen($name) > 4 && !preg_match('/^\d+$/', $name)) {
1261 1261
                 $this->currentTitle = $name;
1262 1262
                 $this->currentYear = $year;
1263 1263
 
Please login to merge, or discard this patch.
Blacklight/Games.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     {
299 299
         $browseBy = ' ';
300 300
         foreach ($this->getBrowseByOptions() as $bbk => $bbv) {
301
-            if (! empty($_REQUEST[$bbk])) {
301
+            if (!empty($_REQUEST[$bbk])) {
302 302
                 $bbs = stripslashes($_REQUEST[$bbk]);
303 303
                 if ($bbk === 'year') {
304 304
                     $browseBy .= ' AND YEAR (gi.releasedate) '.'LIKE '.escapeString('%'.$bbs.'%');
@@ -362,11 +362,11 @@  discard block
 block discarded – undo
362 362
                 if (empty($this->_gameResults['title'])) {
363 363
                     return false;
364 364
                 }
365
-                if (! empty($this->_gameResults['cover'])) {
365
+                if (!empty($this->_gameResults['cover'])) {
366 366
                     $game['coverurl'] = (string) $this->_gameResults['cover'];
367 367
                 }
368 368
 
369
-                if (! empty($this->_gameResults['backdrop'])) {
369
+                if (!empty($this->_gameResults['backdrop'])) {
370 370
                     $game['backdropurl'] = (string) $this->_gameResults['backdrop'];
371 371
                 }
372 372
 
@@ -374,41 +374,41 @@  discard block
 block discarded – undo
374 374
                 $game['asin'] = $this->_gameResults['steamid'];
375 375
                 $game['url'] = (string) $this->_gameResults['directurl'];
376 376
 
377
-                if (! empty($this->_gameResults['publisher'])) {
377
+                if (!empty($this->_gameResults['publisher'])) {
378 378
                     $game['publisher'] = (string) $this->_gameResults['publisher'];
379 379
                 } else {
380 380
                     $game['publisher'] = 'Unknown';
381 381
                 }
382 382
 
383
-                if (! empty($this->_gameResults['rating'])) {
383
+                if (!empty($this->_gameResults['rating'])) {
384 384
                     $game['esrb'] = (string) $this->_gameResults['rating'];
385 385
                 } else {
386 386
                     $game['esrb'] = 'Not Rated';
387 387
                 }
388 388
 
389
-                if (! empty($this->_gameResults['releasedate'])) {
389
+                if (!empty($this->_gameResults['releasedate'])) {
390 390
                     $dateReleased = strtotime($this->_gameResults['releasedate']) === false ? '' : $this->_gameResults['releasedate'];
391 391
                     $game['releasedate'] = ($this->_gameResults['releasedate'] === '' || strtotime($this->_gameResults['releasedate']) === false) ? null : Carbon::createFromFormat('M j, Y', Carbon::parse($dateReleased)->toFormattedDateString())->format('Y-m-d');
392 392
                 }
393 393
 
394
-                if (! empty($this->_gameResults['description'])) {
394
+                if (!empty($this->_gameResults['description'])) {
395 395
                     $game['review'] = (string) $this->_gameResults['description'];
396 396
                 }
397 397
 
398
-                if (! empty($this->_gameResults['genres'])) {
398
+                if (!empty($this->_gameResults['genres'])) {
399 399
                     $genres = $this->_gameResults['genres'];
400 400
                     $genreName = $this->_matchGenre($genres);
401 401
                 }
402 402
             }
403 403
         }
404 404
 
405
-        if (! empty($this->publicKey)) {
405
+        if (!empty($this->publicKey)) {
406 406
             if ($steamGameID === false || $this->_gameResults === false) {
407 407
                 $bestMatch = false;
408 408
                 $this->_classUsed = 'GiantBomb';
409 409
                 try {
410 410
                     $result = $this->giantBomb->search($gameInfo['title'], 'Game');
411
-                    if (! \is_object($result)) {
411
+                    if (!\is_object($result)) {
412 412
                         $bestMatchPct = 0;
413 413
                         foreach ($result as $res) {
414 414
                             similar_text(strtolower($gameInfo['title']), strtolower($res->name), $percent1);
@@ -421,17 +421,17 @@  discard block
 block discarded – undo
421 421
                         if ($bestMatch !== false) {
422 422
                             $this->_gameResults = $this->giantBomb->findWithResourceID('Game', '3030-'.$bestMatch);
423 423
 
424
-                            if (! empty($this->_gameResults->image['medium_url'])) {
424
+                            if (!empty($this->_gameResults->image['medium_url'])) {
425 425
                                 $game['coverurl'] = (string) $this->_gameResults->image['medium_url'];
426 426
                             }
427 427
 
428
-                            if (! empty($this->_gameResults->image['screen_url'])) {
428
+                            if (!empty($this->_gameResults->image['screen_url'])) {
429 429
                                 $game['backdropurl'] = (string) $this->_gameResults->image['screen_url'];
430 430
                             }
431 431
 
432 432
                             $game['title'] = (string) $this->_gameResults->get('name');
433 433
                             $game['asin'] = $this->_gameResults->get('id');
434
-                            if (! empty($this->_gameResults->get('site_detail_url'))) {
434
+                            if (!empty($this->_gameResults->get('site_detail_url'))) {
435 435
                                 $game['url'] = (string) $this->_gameResults->get('site_detail_url');
436 436
                             } else {
437 437
                                 $game['url'] = '';
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
                                 $game['publisher'] = 'Unknown';
444 444
                             }
445 445
 
446
-                            if (! empty($this->_gameResults->original_game_rating[0]['name'])) {
446
+                            if (!empty($this->_gameResults->original_game_rating[0]['name'])) {
447 447
                                 $game['esrb'] = $this->_gameResults->original_game_rating[0]['name'] ?? 'Not Rated';
448 448
                             } else {
449 449
                                 $game['esrb'] = 'Not Rated';
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
                     $bestMatch = false;
481 481
                     $this->_classUsed = 'IGDB';
482 482
                     $result = Game::where('name', $gameInfo['title'])->get();
483
-                    if (! empty($result)) {
483
+                    if (!empty($result)) {
484 484
                         $bestMatchPct = 0;
485 485
                         foreach ($result as $res) {
486 486
                             similar_text(strtolower($gameInfo['title']), strtolower($res->name), $percent1);
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
                             ])->where('id', $bestMatch)->first();
499 499
 
500 500
                             $publishers = [];
501
-                            if (! empty($this->_gameResults->involved_companies)) {
501
+                            if (!empty($this->_gameResults->involved_companies)) {
502 502
                                 foreach ($this->_gameResults->involved_companies as $publisher) {
503 503
                                     if ($publisher['publisher'] === true) {
504 504
                                         $company = Company::find($publisher['company']);
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 
510 510
                             $genres = [];
511 511
 
512
-                            if (! empty($this->_gameResults->themes)) {
512
+                            if (!empty($this->_gameResults->themes)) {
513 513
                                 foreach ($this->_gameResults->themes as $theme) {
514 514
                                     $genres[] = $theme['name'];
515 515
                                 }
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
                                 'esrb' => isset($this->_gameResults->aggregated_rating) ? round($this->_gameResults->aggregated_rating).'%' : 'Not Rated',
532 532
                                 'url' => $this->_gameResults->url ?? '',
533 533
                                 'backdropurl' => isset($this->_gameResults->screenshots) ? 'https:'.str_replace('t_thumb', 't_cover_big', $this->_gameResults->screenshots[0]['url']) : '',
534
-                                'publisher' => ! empty($publishers) ? implode(',', $publishers) : 'Unknown',
534
+                                'publisher' => !empty($publishers) ? implode(',', $publishers) : 'Unknown',
535 535
                             ];
536 536
                         } else {
537 537
                             $this->colorCli->notice('IGDB returned no valid results');
@@ -565,20 +565,20 @@  discard block
 block discarded – undo
565 565
         } else {
566 566
             $game['backdrop'] = 0;
567 567
         }
568
-        if (! isset($game['trailer'])) {
568
+        if (!isset($game['trailer'])) {
569 569
             $game['trailer'] = 0;
570 570
         }
571 571
         if (empty($game['title'])) {
572 572
             $game['title'] = $gameInfo['title'];
573 573
         }
574
-        if (! isset($game['releasedate'])) {
574
+        if (!isset($game['releasedate'])) {
575 575
             $game['releasedate'] = '';
576 576
         }
577 577
 
578 578
         if ($game['releasedate'] === '') {
579 579
             $game['releasedate'] = '';
580 580
         }
581
-        if (! isset($game['review'])) {
581
+        if (!isset($game['review'])) {
582 582
             $game['review'] = 'No Review';
583 583
         }
584 584
         $game['classused'] = $this->_classUsed;
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
         $game['gamesgenre'] = $genreName;
597 597
         $game['gamesgenreID'] = $genreKey;
598 598
 
599
-        if (! empty($game['asin'])) {
599
+        if (!empty($game['asin'])) {
600 600
             $check = GamesInfo::query()->where('asin', $game['asin'])->first();
601 601
             if ($check === null) {
602 602
                 $gamesId = GamesInfo::query()
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
             }
642 642
         }
643 643
 
644
-        if (! empty($gamesId)) {
644
+        if (!empty($gamesId)) {
645 645
             if ($this->echoOutput) {
646 646
                 $this->colorCli->header('Added/updated game: ').
647 647
                 $this->colorCli->alternateOver('   Title:    ').
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
             $this->colorCli->primary($game['title'].' (PC)');
661 661
         }
662 662
 
663
-        return ! empty($gamesId) ? $gamesId : false;
663
+        return !empty($gamesId) ? $gamesId : false;
664 664
     }
665 665
 
666 666
     /**
Please login to merge, or discard this patch.