From fa757dbc5319ef8ccf832e7aed8635fcb03758a1 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Fri, 26 Jan 2018 12:04:16 +0000 Subject: [PATCH] Apply fixes from StyleCI [ci skip] [skip ci] --- app/Console/Commands/NntmuxResetDb.php | 9 ++++----- misc/testing/DB/reset_truncate.php | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Console/Commands/NntmuxResetDb.php b/app/Console/Commands/NntmuxResetDb.php index 759222bb3..abe4fce22 100644 --- a/app/Console/Commands/NntmuxResetDb.php +++ b/app/Console/Commands/NntmuxResetDb.php @@ -4,11 +4,11 @@ namespace App\Console\Commands; use App\Models\Group; use App\Models\Settings; -use Illuminate\Console\Command; +use nntmux\SphinxSearch; use Illuminate\Support\Carbon; +use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\File; -use nntmux\SphinxSearch; class NntmuxResetDb extends Command { @@ -41,7 +41,6 @@ class NntmuxResetDb extends Command */ public function handle() { - if ($this->confirm('This script removes all releases, nzb files, samples, previews , nfos, truncates all article tables and resets all groups. Are you sure you want reset the DB?')) { $timestart = Carbon::now(); @@ -50,7 +49,7 @@ class NntmuxResetDb extends Command 'first_record_postdate' => null, 'last_record' => 0, 'last_record_postdate' => null, - 'last_updated' => null + 'last_updated' => null, ]); $this->info('Reseting all groups completed.'); @@ -115,4 +114,4 @@ class NntmuxResetDb extends Command $this->info('Script execution stopped'); } } -} \ No newline at end of file +} diff --git a/misc/testing/DB/reset_truncate.php b/misc/testing/DB/reset_truncate.php index e76b05885..2c2b5410c 100644 --- a/misc/testing/DB/reset_truncate.php +++ b/misc/testing/DB/reset_truncate.php @@ -2,10 +2,10 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; +use nntmux\ColorCLI; use App\Models\Group; use App\Models\Release; use Illuminate\Support\Facades\DB; -use nntmux\ColorCLI; if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'drop')) { Group::query()->update(['first_record' => 0, 'first_record_postdate' => null, 'last_record' => 0, 'last_record_postdate' => null, 'last_updated' => null]); @@ -38,7 +38,7 @@ if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'drop')) { } else { $rel = DB::unprepared("TRUNCATE TABLE $tbl"); DB::commit(); - if ($rel ===true) { + if ($rel === true) { echo ColorCLI::primary("Truncating $tbl completed."); } } @@ -53,7 +53,7 @@ if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'drop')) { ColorCLI::doEcho(ColorCLI::error( 'This script removes releases with no NZBs, resets all groups, truncates or drops(tpg) article tables. All other releases are left alone. - php '. $argv[0].' [true, drop] ...: To reset all groups and truncate/drop the tables.' + php '.$argv[0].' [true, drop] ...: To reset all groups and truncate/drop the tables.' ) ); exit;