@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $url = self::API_URL."shows/{$id}/seasons/{$season}/episodes/{$ep}"; |
| 58 | 58 | |
| 59 | 59 | $array = $this->getJsonArray($url, $extended); |
| 60 | - if (! \is_array($array)) { |
|
| 60 | + if (!\is_array($array)) { |
|
| 61 | 61 | return false; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $array = $this->getJsonArray( |
| 73 | 73 | self::API_URL.'movies/boxoffice' |
| 74 | 74 | ); |
| 75 | - if (! $array) { |
|
| 75 | + if (!$array) { |
|
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $array = $this->getJsonArray( |
| 88 | 88 | self::API_URL.'calendars/all/shows/'.$start.'/'.$days |
| 89 | 89 | ); |
| 90 | - if (! $array) { |
|
| 90 | + if (!$array) { |
|
| 91 | 91 | return false; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $extendedString = '?extended='.$extended; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if (! empty($this->requestHeaders)) { |
|
| 110 | + if (!empty($this->requestHeaders)) { |
|
| 111 | 111 | try { |
| 112 | 112 | $json = $this->client->get( |
| 113 | 113 | $URI.$extendedString, |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | return false; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - if (! empty($json)) { |
|
| 124 | + if (!empty($json)) { |
|
| 125 | 125 | $json = json_decode($json, true); |
| 126 | - if (! \is_array($json) || (isset($json['status']) && $json['status'] === 'failure')) { |
|
| 126 | + if (!\is_array($json) || (isset($json['status']) && $json['status'] === 'failure')) { |
|
| 127 | 127 | return false; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | default => 'min', |
| 147 | 147 | }; |
| 148 | 148 | $array = $this->getJsonArray(self::API_URL.'movies/'.Str::slug($movie), $extended); |
| 149 | - if (! $array) { |
|
| 149 | + if (!$array) { |
|
| 150 | 150 | return false; |
| 151 | 151 | } |
| 152 | 152 | if ($type === 'imdbid' && isset($array['ids']['imdb'])) { |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public function searchId(int|string $id, string $site = 'trakt', int|string $type = 0) |
| 165 | 165 | { |
| 166 | - if (! \in_array($site, self::$types, false) || ! ctype_digit($id)) { |
|
| 166 | + if (!\in_array($site, self::$types, false) || !ctype_digit($id)) { |
|
| 167 | 167 | return; |
| 168 | 168 | } |
| 169 | 169 | if ($site === 'imdb') { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | foreach ($directories as $directory) { |
| 63 | 63 | $pool = Pool::create()->concurrency($maxProcesses)->timeout(3600); |
| 64 | - $pool->add(function () use ($directory) { |
|
| 64 | + $pool->add(function() use ($directory) { |
|
| 65 | 65 | $this->_executeCommand( |
| 66 | 66 | $this->importPath.'"'. |
| 67 | 67 | $directory.'" '. |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | $this->useFileName.' '. |
| 71 | 71 | $this->maxPerProcess |
| 72 | 72 | ); |
| 73 | - })->then(function () { |
|
| 73 | + })->then(function() { |
|
| 74 | 74 | $this->colorCli->header('Finished importing new nzbs', true); |
| 75 | - })->catch(function (\Throwable $exception) { |
|
| 75 | + })->catch(function(\Throwable $exception) { |
|
| 76 | 76 | // Handle exception |
| 77 | 77 | }); |
| 78 | 78 | $pool->wait(); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $this->colorCli->header($dMessage); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - if ($articles !== '' && ! is_numeric($articles)) { |
|
| 89 | + if ($articles !== '' && !is_numeric($articles)) { |
|
| 90 | 90 | $articles = 20000; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -181,8 +181,7 @@ discard block |
||
| 181 | 181 | $dMessage = |
| 182 | 182 | 'We have hit the maximum we can backfill for '. |
| 183 | 183 | $groupName. |
| 184 | - ($this->_disableBackfillGroup ? ', disabling backfill on it.' : |
|
| 185 | - ', skipping it, consider disabling backfill on it.'); |
|
| 184 | + ($this->_disableBackfillGroup ? ', disabling backfill on it.' : ', skipping it, consider disabling backfill on it.'); |
|
| 186 | 185 | |
| 187 | 186 | if ($this->_disableBackfillGroup) { |
| 188 | 187 | UsenetGroup::updateGroupStatus($groupArr['id'], 'backfill', 0); |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | $buffer .= sprintf($this->tmpMasks[3], 'File System', 'Used', 'Free'); |
| 406 | 406 | $buffer .= $this->_getSeparator(); |
| 407 | 407 | |
| 408 | - if (! empty($monitor_path) && file_exists($monitor_path)) { |
|
| 408 | + if (!empty($monitor_path) && file_exists($monitor_path)) { |
|
| 409 | 409 | $disk_use = $this->decodeSize(disk_total_space($monitor_path) - disk_free_space($monitor_path)); |
| 410 | 410 | $disk_free = $this->decodeSize(disk_free_space($monitor_path)); |
| 411 | 411 | if (basename($monitor_path) === '') { |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | $buffer .= sprintf($this->tmpMasks[4], $show, $disk_use, $disk_free); |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | - if (! empty($monitor_path_a) && file_exists($monitor_path_a)) { |
|
| 419 | + if (!empty($monitor_path_a) && file_exists($monitor_path_a)) { |
|
| 420 | 420 | $disk_use = $this->decodeSize(disk_total_space($monitor_path_a) - disk_free_space($monitor_path_a)); |
| 421 | 421 | $disk_free = $this->decodeSize(disk_free_space($monitor_path_a)); |
| 422 | 422 | if (basename($monitor_path_a) === '') { |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | $buffer .= sprintf($this->tmpMasks[4], $show, $disk_use, $disk_free); |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | - if (! empty($monitor_path_b) && file_exists($monitor_path_b)) { |
|
| 430 | + if (!empty($monitor_path_b) && file_exists($monitor_path_b)) { |
|
| 431 | 431 | $disk_use = $this->decodeSize(disk_total_space($monitor_path_b) - disk_free_space($monitor_path_b)); |
| 432 | 432 | $disk_free = $this->decodeSize(disk_free_space($monitor_path_b)); |
| 433 | 433 | if (basename($monitor_path_b) === '') { |
@@ -298,7 +298,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | /** |
@@ -195,8 +195,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -49,19 +49,19 @@ discard block |
||
| 49 | 49 | $path = $params[0]; |
| 50 | 50 | |
| 51 | 51 | // Check if the path ends with dir separator. |
| 52 | - if (! Str::endsWith($path, '/')) { |
|
| 52 | + if (!Str::endsWith($path, '/')) { |
|
| 53 | 53 | $path .= '/'; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // Check if it's a directory. |
| 57 | - if (! File::isDirectory($path)) { |
|
| 57 | + if (!File::isDirectory($path)) { |
|
| 58 | 58 | $this->echoOut('Folder does not exist: '.$path); |
| 59 | 59 | |
| 60 | 60 | return $this->returnValue(); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | // Check if we can write to it. |
| 64 | - if (! is_writable($path)) { |
|
| 64 | + if (!is_writable($path)) { |
|
| 65 | 65 | $this->echoOut('Folder is not writable: '.$path); |
| 66 | 66 | |
| 67 | 67 | return $this->returnValue(); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | // Check if the from date is the proper format. |
| 71 | 71 | if (isset($params[1]) && $params[1] !== '') { |
| 72 | - if (! $this->checkDate($params[1])) { |
|
| 72 | + if (!$this->checkDate($params[1])) { |
|
| 73 | 73 | return $this->returnValue(); |
| 74 | 74 | } |
| 75 | 75 | $fromDate = $params[1]; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // Check if the to date is the proper format. |
| 79 | 79 | if (isset($params[2]) && $params[2] !== '') { |
| 80 | - if (! $this->checkDate($params[2])) { |
|
| 80 | + if (!$this->checkDate($params[2])) { |
|
| 81 | 81 | return $this->returnValue(); |
| 82 | 82 | } |
| 83 | 83 | $toDate = $params[2]; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | // Check if the group_id exists. |
| 87 | 87 | if (isset($params[3]) && $params[3] !== 0) { |
| 88 | - if (! is_numeric($params[3])) { |
|
| 88 | + if (!is_numeric($params[3])) { |
|
| 89 | 89 | $this->echoOut('The group ID is not a number: '.$params[3]); |
| 90 | 90 | |
| 91 | 91 | return $this->returnValue(); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | // Create a path to store the new NZB files. |
| 122 | 122 | $currentPath = $path.$this->safeFilename($group['name']).'/'; |
| 123 | - if (! File::isDirectory($currentPath) && ! File::makeDirectory($currentPath) && ! File::isDirectory($currentPath)) { |
|
| 123 | + if (!File::isDirectory($currentPath) && !File::makeDirectory($currentPath) && !File::isDirectory($currentPath)) { |
|
| 124 | 124 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $currentPath)); |
| 125 | 125 | } |
| 126 | 126 | foreach ($releases as $release) { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | // Check if the user wants them in gzip, copy it if so. |
| 142 | 142 | if ($gzip) { |
| 143 | - if (! copy($nzbFile, $currentFile.'.nzb.gz')) { |
|
| 143 | + if (!copy($nzbFile, $currentFile.'.nzb.gz')) { |
|
| 144 | 144 | if ($this->echoCLI) { |
| 145 | 145 | echo 'Unable to export NZB with GUID: '.$release['guid']; |
| 146 | 146 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | // If not, decompress it and create a file to store it in. |
| 151 | 151 | } else { |
| 152 | 152 | $nzbContents = Utility::unzipGzipFile($nzbFile); |
| 153 | - if (! $nzbContents) { |
|
| 153 | + if (!$nzbContents) { |
|
| 154 | 154 | if ($this->echoCLI) { |
| 155 | 155 | echo 'Unable to export NZB with GUID: '.$release['guid']; |
| 156 | 156 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | protected function checkDate($date): bool |
| 192 | 192 | { |
| 193 | - if (! preg_match('/^(\d{2}\/){2}\d{4}$/', $date)) { |
|
| 193 | + if (!preg_match('/^(\d{2}\/){2}\d{4}$/', $date)) { |
|
| 194 | 194 | $this->echoOut('Wrong date format: '.$date); |
| 195 | 195 | |
| 196 | 196 | return false; |
@@ -687,7 +687,7 @@ |
||
| 687 | 687 | { |
| 688 | 688 | $sharing = (array) Arr::first(DB::select('SELECT enabled, posting, fetching FROM sharing')); |
| 689 | 689 | |
| 690 | - if (! empty($sharing) && (int) $sharing['enabled'] === 1 && (int) $runVar['settings']['run_sharing'] === 1 && ((int) $sharing['posting'] === 1 || (int) $sharing['fetching'] === 1) && shell_exec("tmux list-panes -t{$runVar['constants']['tmux_session']}:{$pane} | grep ^0 | grep -c dead") == 1) { |
|
| 690 | + if (!empty($sharing) && (int) $sharing['enabled'] === 1 && (int) $runVar['settings']['run_sharing'] === 1 && ((int) $sharing['posting'] === 1 || (int) $sharing['fetching'] === 1) && shell_exec("tmux list-panes -t{$runVar['constants']['tmux_session']}:{$pane} | grep ^0 | grep -c dead") == 1) { |
|
| 691 | 691 | shell_exec( |
| 692 | 692 | "tmux respawnp -t{$runVar['constants']['tmux_session']}:{$pane}.0 ' \ |
| 693 | 693 | {$runVar['commands']['_php']} {$runVar['paths']['misc']}/update/multiprocessing/postprocess.php sha; \ |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | protected function generic(): array |
| 108 | 108 | { |
| 109 | 109 | // For non music groups. |
| 110 | - if (! preg_match('/\.(flac|lossless|mp3|music|sounds)/', $this->groupName)) { |
|
| 110 | + if (!preg_match('/\.(flac|lossless|mp3|music|sounds)/', $this->groupName)) { |
|
| 111 | 111 | // File/part count. |
| 112 | 112 | // File extensions. |
| 113 | 113 | // File extensions - If it was not in quotes. |