From 5c1becaf7f8994d60462a3f05a1aae41a497bd33 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Fri, 19 Oct 2018 09:31:28 +0000 Subject: [PATCH] Apply fixes from StyleCI [ci skip] [skip ci] --- Blacklight/Music.php | 8 +++----- Blacklight/NameFixer.php | 1 - Blacklight/XXX.php | 3 +-- Blacklight/db/populate/AniDB.php | 12 ++++-------- Blacklight/libraries/Forking.php | 11 ++++------- Blacklight/libraries/ForkingImportNZB.php | 3 +-- Blacklight/processing/post/AniDB.php | 1 - app/Extensions/helper/helpers.php | 1 - cli/data/populate_anidb.php | 3 +-- misc/testing/PostProc/getXXXSamples.php | 4 ++-- misc/testing/PostProc/updateGamesImages.php | 4 ++-- 11 files changed, 18 insertions(+), 33 deletions(-) diff --git a/Blacklight/Music.php b/Blacklight/Music.php index a064ffdbf..694bbdff6 100755 --- a/Blacklight/Music.php +++ b/Blacklight/Music.php @@ -499,8 +499,7 @@ class Music if ($musicId) { if ($this->echooutput) { - - ColorCLI::header(PHP_EOL.'Added/updated album: '). + ColorCLI::header(PHP_EOL.'Added/updated album: '). ColorCLI::alternateOver(' Artist: '). ColorCLI::primary($mus['artist']). ColorCLI::alternateOver(' Title: '). @@ -517,7 +516,7 @@ class Music $artist = 'Artist: '.$mus['artist'].', Album: '; } - ColorCLI::headerOver('Nothing to update: '). + ColorCLI::headerOver('Nothing to update: '). ColorCLI::primaryOver( $artist. $mus['title']. @@ -632,8 +631,7 @@ class Music })->whereIn('categories_id', [Category::MUSIC_MP3, Category::MUSIC_LOSSLESS, Category::MUSIC_OTHER])->orderBy('postdate', 'DESC')->limit($this->musicqty)->get(['searchname', 'id']); if ($res instanceof \Traversable && ! empty($res)) { if ($this->echooutput) { - - ColorCLI::header( + ColorCLI::header( 'Processing '.$res->count().' music release(s).' ); } diff --git a/Blacklight/NameFixer.php b/Blacklight/NameFixer.php index 77e0dbff2..a7a213ea9 100755 --- a/Blacklight/NameFixer.php +++ b/Blacklight/NameFixer.php @@ -874,7 +874,6 @@ class NameFixer echo PHP_EOL; - ColorCLI::headerOver('New name: '). ColorCLI::primary(substr($newName, 0, 299)). ColorCLI::headerOver('Old name: '). diff --git a/Blacklight/XXX.php b/Blacklight/XXX.php index 511a5090b..5a774d62e 100755 --- a/Blacklight/XXX.php +++ b/Blacklight/XXX.php @@ -601,8 +601,7 @@ class XXX } if ($this->echoOutput) { - - ColorCLI::headerOver(($xxxID !== false ? 'Added/updated XXX movie: '.ColorCLI::primary($mov['title']) : 'Nothing to update for XXX movie: '.ColorCLI::primary($mov['title']))); + ColorCLI::headerOver(($xxxID !== false ? 'Added/updated XXX movie: '.ColorCLI::primary($mov['title']) : 'Nothing to update for XXX movie: '.ColorCLI::primary($mov['title']))); } return $xxxID; diff --git a/Blacklight/db/populate/AniDB.php b/Blacklight/db/populate/AniDB.php index 4fba893bb..d088c28fa 100755 --- a/Blacklight/db/populate/AniDB.php +++ b/Blacklight/db/populate/AniDB.php @@ -399,16 +399,14 @@ class AniDB $AniDBAPIArray = $this->getAniDbAPI($anidb['anidbid']); if ($this->banned === true) { - - ColorCLI::error( + ColorCLI::error( 'AniDB Banned, import will fail, please wait 24 hours before retrying.' ); exit; } if ($AniDBAPIArray === false && $this->echooutput) { - - ColorCLI::info( + ColorCLI::info( 'Anime ID: '.$anidb['anidbid'].' not available for update yet.' ); } else { @@ -420,16 +418,14 @@ class AniDB $AniDBAPIArray = $this->getAniDbAPI($anidbId); if ($this->banned === true) { - - ColorCLI::error( + ColorCLI::error( 'AniDB Banned, import will fail, please wait 24 hours before retrying.' ); exit; } if ($AniDBAPIArray === false && $this->echooutput) { - - ColorCLI::info( + ColorCLI::info( 'Anime ID: '.$anidbId.' not available for update yet.' ); } else { diff --git a/Blacklight/libraries/Forking.php b/Blacklight/libraries/Forking.php index acfdb11a3..ee2cf543c 100755 --- a/Blacklight/libraries/Forking.php +++ b/Blacklight/libraries/Forking.php @@ -211,8 +211,7 @@ class Forking extends \fork_daemon $this->processEndWork(); if (config('nntmux.echocli')) { - - ColorCLI::header( + ColorCLI::header( 'Multi-processing for '.$this->workType.' finished in '.(microtime(true) - $startTime). ' seconds at '.date(DATE_RFC2822).'.'.PHP_EOL ); @@ -304,8 +303,7 @@ class Forking extends \fork_daemon $this->_workCount = \count($this->work); if ($this->_workCount > 0) { if (config('nntmux.echocli')) { - - ColorCLI::header( + ColorCLI::header( 'Multi-processing started at '.date(DATE_RFC2822).' for '.$this->workType.' with '.$this->_workCount. ' job(s) to do using a max of '.$this->maxProcesses.' child process(es).' ); @@ -314,8 +312,7 @@ class Forking extends \fork_daemon $this->addwork($this->work); $this->process_work(true); } elseif (config('nntmux.echocli')) { - - ColorCLI::header('No work to do!'); + ColorCLI::header('No work to do!'); } } @@ -1102,7 +1099,7 @@ class Forking extends \fork_daemon public function childExit($pid, $identifier = '') { if (config('nntmux.echocli')) { - ColorCLI::header( + ColorCLI::header( 'Process ID #'.$pid.' has completed.'.PHP_EOL. 'There are '.($this->forked_children_count - 1).' process(es) still active with '. (--$this->_workCount).' job(s) left in the queue.'.PHP_EOL diff --git a/Blacklight/libraries/ForkingImportNZB.php b/Blacklight/libraries/ForkingImportNZB.php index 2ed1b73fa..be6c188a8 100755 --- a/Blacklight/libraries/ForkingImportNZB.php +++ b/Blacklight/libraries/ForkingImportNZB.php @@ -86,8 +86,7 @@ class ForkingImportNZB extends Forking $this->process_work(true); if (config('nntmux.echocli')) { - - ColorCLI::header( + ColorCLI::header( 'Multi-processing for import finished in '.(microtime(true) - $startTime). ' seconds at '.date(DATE_RFC2822).'.'.PHP_EOL ); diff --git a/Blacklight/processing/post/AniDB.php b/Blacklight/processing/post/AniDB.php index 79c47bc99..077de36f8 100755 --- a/Blacklight/processing/post/AniDB.php +++ b/Blacklight/processing/post/AniDB.php @@ -254,7 +254,6 @@ class AniDB $this->updateRelease($anidbId->anidbid, $release->id); - ColorCLI::headerOver('Matched '.$type.' AniDB ID: '). ColorCLI::primary($anidbId->anidbid). ColorCLI::alternateOver(' Title: '). diff --git a/app/Extensions/helper/helpers.php b/app/Extensions/helper/helpers.php index bcde8b807..be1628370 100644 --- a/app/Extensions/helper/helpers.php +++ b/app/Extensions/helper/helpers.php @@ -1,6 +1,5 @@ 1 && $argv[1] === 'true' && isset($argv[2])) { } } } else { - - ColorCLI::error( + ColorCLI::error( 'To execute this script you must provide a boolean argument.'.PHP_EOL. 'Argument1: true|false to run this script or not'.PHP_EOL. 'Argument2: full|info for what type of data to populate.'.PHP_EOL. diff --git a/misc/testing/PostProc/getXXXSamples.php b/misc/testing/PostProc/getXXXSamples.php index 5219ab3d9..fa2322efb 100644 --- a/misc/testing/PostProc/getXXXSamples.php +++ b/misc/testing/PostProc/getXXXSamples.php @@ -50,8 +50,8 @@ if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) { } ColorCLI::header('Total releases missing samples that '.$couldbe.'their samples updated = '.number_format($counterfixed)); } else { - ColorCLI::header("\nThis script checks if XXX release samples actually exist on disk.\n\n" + ColorCLI::header("\nThis script checks if XXX release samples actually exist on disk.\n\n" ."php $argv[0] check ...: Dry run, displays missing samples.\n" ."php $argv[0] true ...: Update XXX releases missing samples.\n"); - exit(); + exit(); } diff --git a/misc/testing/PostProc/updateGamesImages.php b/misc/testing/PostProc/updateGamesImages.php index 6844554c9..8bd60a39d 100644 --- a/misc/testing/PostProc/updateGamesImages.php +++ b/misc/testing/PostProc/updateGamesImages.php @@ -11,8 +11,8 @@ use Illuminate\Support\Facades\DB; $covers = $updated = $deleted = 0; if ($argc === 1 || $argv[1] !== 'true') { - ColorCLI::error("\nThis script will check all images in covers/games and compare to db->gamesinfo.\nTo run:\nphp $argv[0] true\n"); - exit(); + ColorCLI::error("\nThis script will check all images in covers/games and compare to db->gamesinfo.\nTo run:\nphp $argv[0] true\n"); + exit(); } $pdo = DB::connection()->getPdo();