From 9d3bdd132497504daf5720b6634644ccf01a9d65 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 13 Aug 2024 22:13:34 +0200 Subject: [PATCH] Code style fixes --- Blacklight/Backfill.php | 6 ++-- Blacklight/Binaries.php | 6 ++-- Blacklight/Books.php | 6 ++-- Blacklight/ColorCLI.php | 2 +- Blacklight/Console.php | 6 ++-- Blacklight/Games.php | 6 ++-- Blacklight/IRCScraper.php | 6 ++-- Blacklight/ManticoreSearch.php | 2 +- Blacklight/Movie.php | 10 +++--- Blacklight/Music.php | 8 ++--- Blacklight/NZB.php | 2 +- Blacklight/NZBContents.php | 8 ++--- Blacklight/NZBExport.php | 4 +-- Blacklight/NZBImport.php | 10 +++--- Blacklight/NameFixer.php | 22 ++++++------ Blacklight/Nfo.php | 6 ++-- Blacklight/PopulateAniDB.php | 4 +-- Blacklight/ReleaseImage.php | 2 +- Blacklight/ReleaseRemover.php | 12 +++---- Blacklight/Releases.php | 8 ++--- Blacklight/Steam.php | 4 +-- Blacklight/Tmux.php | 2 +- Blacklight/XXX.php | 14 ++++---- Blacklight/libraries/Forking.php | 4 +-- Blacklight/libraries/TraktAPI.php | 2 +- Blacklight/processing/PostProcess.php | 6 ++-- Blacklight/processing/ProcessReleases.php | 16 ++++----- Blacklight/processing/adult/AdultMovies.php | 2 +- Blacklight/processing/post/AniDB.php | 4 +-- .../processing/post/ProcessAdditional.php | 36 +++++++++---------- Blacklight/processing/tv/TMDB.php | 2 +- Blacklight/processing/tv/TV.php | 2 +- Blacklight/processing/tv/TVDB.php | 4 +-- Blacklight/processing/tv/TVMaze.php | 4 +-- Blacklight/processing/tv/TraktTv.php | 2 +- app/Console/Commands/CleanNZB.php | 8 ++--- app/Console/Commands/ImportNzbs.php | 4 +-- .../Commands/NntmuxPopulateSearchIndexes.php | 10 +++--- app/Console/Commands/NntmuxPopulateSteam.php | 2 +- .../Commands/NntmuxPopulateSteamApps.php | 2 +- .../Commands/NntmuxRemoveBadReleases.php | 4 +-- app/Console/Commands/NntmuxResetDb.php | 2 +- app/Console/Commands/RecategorizeReleases.php | 2 +- app/Console/Commands/TmuxUIStart.php | 2 +- app/Console/Commands/TmuxUIStop.php | 2 +- app/Console/Commands/UpdateNNTmux.php | 4 +-- app/Console/Commands/UpdateNNTmuxGit.php | 2 +- app/Extensions/helper/helpers.php | 6 ++-- .../Admin/AdminAnidbController.php | 4 +-- .../Admin/AdminBlacklistController.php | 2 +- .../Controllers/Admin/AdminBookController.php | 2 +- .../Admin/AdminConsoleController.php | 2 +- .../Admin/AdminContentController.php | 6 ++-- .../Admin/AdminMovieController.php | 2 +- .../Admin/AdminMusicController.php | 4 +-- .../Controllers/Admin/AdminNzbController.php | 2 +- .../Admin/AdminReleasesController.php | 2 +- app/Http/Controllers/AdultController.php | 2 +- app/Http/Controllers/AnimeController.php | 4 +-- app/Http/Controllers/Api/ApiController.php | 2 +- .../Controllers/Api/ApiInformController.php | 2 +- app/Http/Controllers/Api/ApiV2Controller.php | 10 +++--- app/Http/Controllers/Api/RSS.php | 2 +- app/Http/Controllers/Api/XML_Response.php | 2 +- app/Http/Controllers/BasePageController.php | 4 +-- app/Http/Controllers/BrowseController.php | 6 ++-- app/Http/Controllers/ConsoleController.php | 4 +-- app/Http/Controllers/ContentController.php | 2 +- app/Http/Controllers/DetailsController.php | 12 +++---- app/Http/Controllers/FileListController.php | 2 +- app/Http/Controllers/GetNzbController.php | 2 +- app/Http/Controllers/MyMoviesController.php | 2 +- app/Http/Controllers/MyShowsController.php | 2 +- app/Http/Controllers/RssController.php | 10 +++--- app/Http/Controllers/SearchController.php | 2 +- app/Http/Controllers/SeriesController.php | 2 +- app/Models/Predb.php | 12 +++---- app/Models/Release.php | 12 +++---- app/Models/ReleaseFile.php | 4 +-- app/Models/UsenetGroup.php | 8 ++--- misc/testing/DB/mark_as_passworded.php | 2 +- misc/testing/DB/reset_postprocessing.php | 4 +-- misc/testing/Dev/clean_nzbs.php | 8 ++--- misc/testing/Dev/test-ReleaseCleaner.php | 4 +-- misc/testing/NZB/nzb-reorg.php | 4 +-- misc/testing/PostProc/check_covers.php | 2 +- misc/testing/PostProc/check_previews.php | 10 +++--- misc/testing/PostProc/getConsole.php | 2 +- misc/testing/PostProc/getGameCovers.php | 2 +- misc/testing/PostProc/getImdb.php | 2 +- misc/testing/PostProc/getMovieCovers.php | 2 +- misc/testing/PostProc/getTraktData.php | 2 +- misc/testing/PostProc/getXXXCovers.php | 4 +-- misc/testing/PostProc/getXXXSamples.php | 4 +-- misc/testing/PostProc/updateBookImages.php | 2 +- misc/testing/PostProc/updateConsoleImages.php | 2 +- misc/testing/PostProc/updateGamesImages.php | 2 +- misc/testing/PostProc/updateMovieImages.php | 2 +- misc/testing/PostProc/updateMusicImages.php | 2 +- misc/testing/PostProc/updateXXXImages.php | 2 +- misc/testing/Releases/delete_releases.php | 4 +-- misc/testing/Releases/fixReleaseNames.php | 6 ++-- misc/testing/Releases/recategorize.php | 10 +++--- misc/testing/Releases/removeCrapReleases.php | 4 +-- misc/testing/Tests/test_fanarttv_API.php | 2 +- misc/testing/Tests/test_omdb_API.php | 2 +- misc/testing/Tests/test_tmdb_API.php | 2 +- misc/testing/Tests/test_trakt_API.php | 4 +-- misc/testing/Tests/test_tvdb_API.php | 4 +-- misc/testing/Tests/test_tvmaze_API.php | 4 +-- misc/testing/nzb-export.php | 2 +- misc/testing/nzb-import.php | 2 +- misc/testing/resend_activation_email.php | 2 +- misc/update/backfill.php | 4 +-- misc/update/match_prefiles.php | 4 +-- misc/update/multiprocessing/backfill.php | 2 +- misc/update/multiprocessing/binaries.php | 2 +- misc/update/multiprocessing/fixrelnames.php | 2 +- misc/update/multiprocessing/import.php | 2 +- misc/update/multiprocessing/postprocess.php | 2 +- misc/update/multiprocessing/releases.php | 2 +- misc/update/multiprocessing/requestid.php | 2 +- misc/update/multiprocessing/safe.php | 2 +- .../multiprocessing/update_per_group.php | 2 +- misc/update/postprocess.php | 4 +-- misc/update/tmux/bin/groupfixrelnames.php | 8 ++--- misc/update/tmux/bin/showsleep.php | 2 +- misc/update/tmux/bin/update_groups.php | 6 ++-- misc/update/tmux/monitor.php | 10 +++--- misc/update/tmux/run.php | 2 +- misc/update/update_binaries.php | 4 +-- routes/console.php | 2 +- 132 files changed, 301 insertions(+), 301 deletions(-) diff --git a/Blacklight/Backfill.php b/Blacklight/Backfill.php index be71f1944..fcc103640 100755 --- a/Blacklight/Backfill.php +++ b/Blacklight/Backfill.php @@ -49,10 +49,10 @@ class Backfill { $this->_echoCLI = config('nntmux.echocli'); - $this->_nntp = new NNTP(); - $this->_binaries = new Binaries(); + $this->_nntp = new NNTP; + $this->_binaries = new Binaries; - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; $this->_compressedHeaders = (int) Settings::settingValue('..compressedheaders') === 1; $this->_safeBackFillDate = Settings::settingValue('..safebackfilldate') !== '' ? (string) Settings::settingValue('safebackfilldate') : '2012-08-14'; diff --git a/Blacklight/Binaries.php b/Blacklight/Binaries.php index b16572cd4..6b0bbef92 100644 --- a/Blacklight/Binaries.php +++ b/Blacklight/Binaries.php @@ -176,9 +176,9 @@ class Binaries $this->_echoCLI = config('nntmux.echocli'); $this->_pdo = DB::connection()->getPdo(); - $this->colorCli = new ColorCLI(); - $this->_nntp = new NNTP(); - $this->_collectionsCleaning = new CollectionsCleaning(); + $this->colorCli = new ColorCLI; + $this->_nntp = new NNTP; + $this->_collectionsCleaning = new CollectionsCleaning; $this->messageBuffer = Settings::settingValue('..maxmssgs') !== '' ? (int) Settings::settingValue('..maxmssgs') : 20000; diff --git a/Blacklight/Books.php b/Blacklight/Books.php index 4fdd68153..259597ab9 100755 --- a/Blacklight/Books.php +++ b/Blacklight/Books.php @@ -61,7 +61,7 @@ class Books { $this->echooutput = config('nntmux.echocli'); - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; $this->pubkey = Settings::settingValue('APIs..amazonpubkey'); $this->privkey = Settings::settingValue('APIs..amazonprivkey'); @@ -127,7 +127,7 @@ class Books %s %s %s GROUP BY boo.id ORDER BY %s %s %s", - (new Releases())->showPasswords(), + (new Releases)->showPasswords(), $browseby, $catsrch, $exccatlist, @@ -398,7 +398,7 @@ class Books */ public function updateBookInfo(string $bookInfo = '', $amazdata = null) { - $ri = new ReleaseImage(); + $ri = new ReleaseImage; $bookId = -2; diff --git a/Blacklight/ColorCLI.php b/Blacklight/ColorCLI.php index c3a24e88c..a75fb8eaa 100755 --- a/Blacklight/ColorCLI.php +++ b/Blacklight/ColorCLI.php @@ -16,7 +16,7 @@ class ColorCLI */ public function __construct() { - $this->climate = new CLImate(); + $this->climate = new CLImate; } public function debug(string $str, bool $newline = false): void diff --git a/Blacklight/Console.php b/Blacklight/Console.php index c35b75f55..67f744528 100755 --- a/Blacklight/Console.php +++ b/Blacklight/Console.php @@ -88,7 +88,7 @@ class Console { $this->echooutput = config('nntmux.echocli'); - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; $this->pubkey = Settings::settingValue('APIs..amazonpubkey'); $this->privkey = Settings::settingValue('APIs..amazonprivkey'); @@ -161,7 +161,7 @@ class Console %s %s %s GROUP BY con.id ORDER BY %s %s %s", - (new Releases())->showPasswords(), + (new Releases)->showPasswords(), $browseBy, $catsrch, $exccatlist, @@ -564,7 +564,7 @@ class Console */ protected function _updateConsoleTable(array $con = []) { - $ri = new ReleaseImage(); + $ri = new ReleaseImage; $check = ConsoleInfo::query()->where('asin', $con['asin'])->first(); diff --git a/Blacklight/Games.php b/Blacklight/Games.php index e9d583ca6..767300181 100755 --- a/Blacklight/Games.php +++ b/Blacklight/Games.php @@ -82,7 +82,7 @@ class Games { $this->echoOutput = config('nntmux.echocli'); - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; $this->publicKey = config('nntmux_api.giantbomb_api_key'); $this->gameQty = Settings::settingValue('..maxgamesprocessed') !== '' ? (int) Settings::settingValue('..maxgamesprocessed') : 150; @@ -195,7 +195,7 @@ class Games %s %s %s %s GROUP BY gi.id ORDER BY %s %s %s", - (new Releases())->showPasswords(), + (new Releases)->showPasswords(), $browseBy, $catsrch, $maxAge, @@ -343,7 +343,7 @@ class Games //wait 10 seconds before proceeding (steam api limit) sleep(10); $gen = new Genres(['Settings' => null]); - $ri = new ReleaseImage(); + $ri = new ReleaseImage; $game = []; diff --git a/Blacklight/IRCScraper.php b/Blacklight/IRCScraper.php index abbd46f18..cd8c23f25 100755 --- a/Blacklight/IRCScraper.php +++ b/Blacklight/IRCScraper.php @@ -130,8 +130,8 @@ class IRCScraper extends IRCClient $this->_titleIgnoreRegex = config('irc_settings.scrape_irc_title_ignore'); } - $this->elasticsearch = new ElasticSearchSiteSearch(); - $this->manticoreSearch = new ManticoreSearch(); + $this->elasticsearch = new ElasticSearchSiteSearch; + $this->manticoreSearch = new ManticoreSearch; $this->_groupList = []; $this->_silent = $silent; @@ -284,7 +284,7 @@ class IRCScraper extends IRCClient protected function _insertNewPre(): void { if (config('nntmux.elasticsearch_enabled') === true) { - $indexData = (new ElasticSearchSiteSearch())->predbIndexSearch($this->_curPre['title']); + $indexData = (new ElasticSearchSiteSearch)->predbIndexSearch($this->_curPre['title']); } else { $indexData = $this->manticoreSearch->searchIndexes('predb_rt', $this->_curPre['title'], ['title']); } diff --git a/Blacklight/ManticoreSearch.php b/Blacklight/ManticoreSearch.php index 2c7d512d4..bb2cc32c0 100644 --- a/Blacklight/ManticoreSearch.php +++ b/Blacklight/ManticoreSearch.php @@ -39,7 +39,7 @@ class ManticoreSearch $this->connection = ['host' => $this->config['host'], 'port' => $this->config['port']]; $this->manticoresearch = new Client($this->connection); $this->search = new Search($this->manticoresearch); - $this->cli = new ColorCLI(); + $this->cli = new ColorCLI; } /** diff --git a/Blacklight/Movie.php b/Blacklight/Movie.php index b94e2438f..caf8e2408 100755 --- a/Blacklight/Movie.php +++ b/Blacklight/Movie.php @@ -116,13 +116,13 @@ class Movie public function __construct() { - $this->releaseImage = new ReleaseImage(); - $this->colorCli = new ColorCLI(); + $this->releaseImage = new ReleaseImage; + $this->colorCli = new ColorCLI; $this->traktcheck = config('nntmux_api.trakttv_api_key'); if ($this->traktcheck !== null) { $this->traktTv = new TraktTv(['Settings' => null]); } - $this->client = new Client(); + $this->client = new Client; $this->fanartapikey = config('nntmux_api.fanarttv_api_key'); if ($this->fanartapikey !== null) { $this->fanart = new FanartTV($this->fanartapikey); @@ -133,7 +133,7 @@ class Movie } $this->lookuplanguage = Settings::settingValue('indexer.categorise.imdblanguage') !== '' ? (string) Settings::settingValue('indexer.categorise.imdblanguage') : 'en'; - $this->config = new Config(); + $this->config = new Config; $this->config->language = $this->lookuplanguage; $this->config->throwHttpExceptions = false; $cacheDir = storage_path('framework/cache/imdb_cache'); @@ -144,7 +144,7 @@ class Movie $this->imdburl = (int) Settings::settingValue('indexer.categorise.imdburl') !== 0; $this->movieqty = Settings::settingValue('..maximdbprocessed') !== '' ? (int) Settings::settingValue('..maximdbprocessed') : 100; - $this->showPasswords = (new Releases())->showPasswords(); + $this->showPasswords = (new Releases)->showPasswords(); $this->echooutput = config('nntmux.echocli'); $this->imgSavePath = storage_path('covers/movies/'); diff --git a/Blacklight/Music.php b/Blacklight/Music.php index 0b7868463..fc455dfbf 100755 --- a/Blacklight/Music.php +++ b/Blacklight/Music.php @@ -78,7 +78,7 @@ class Music { $this->echooutput = config('nntmux.echocli'); - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; $this->pubkey = Settings::settingValue('APIs..amazonpubkey'); $this->privkey = Settings::settingValue('APIs..amazonprivkey'); @@ -153,7 +153,7 @@ class Music %s %s %s GROUP BY m.id ORDER BY %s %s %s", - (new Releases())->showPasswords(), + (new Releases)->showPasswords(), $browseby, $catsrch, $exccatlist, @@ -300,7 +300,7 @@ class Music */ public function updateMusicInfo($title, $year, $amazdata = null) { - $ri = new ReleaseImage(); + $ri = new ReleaseImage; $mus = []; if ($amazdata !== null) { @@ -612,7 +612,7 @@ class Music { $mus = true; // Load genres. - $defaultGenres = (new Genres())->loadGenres(Genres::MUSIC_TYPE); + $defaultGenres = (new Genres)->loadGenres(Genres::MUSIC_TYPE); try { $album = iTunes::load('album')->fetchOneByName($title); diff --git a/Blacklight/NZB.php b/Blacklight/NZB.php index b11196dd0..997a3ed75 100755 --- a/Blacklight/NZB.php +++ b/Blacklight/NZB.php @@ -93,7 +93,7 @@ class NZB return false; } - $XMLWriter = new \XMLWriter(); + $XMLWriter = new \XMLWriter; $XMLWriter->openMemory(); $XMLWriter->setIndent(true); $XMLWriter->setIndentString(' '); diff --git a/Blacklight/NZBContents.php b/Blacklight/NZBContents.php index b61286abb..89c771869 100755 --- a/Blacklight/NZBContents.php +++ b/Blacklight/NZBContents.php @@ -36,10 +36,10 @@ class NZBContents { $this->echooutput = config('nntmux.echocli'); - $this->nntp = new NNTP(); - $this->nfo = new Nfo(); - $this->pp = new PostProcess(); - $this->nzb = new NZB(); + $this->nntp = new NNTP; + $this->nfo = new Nfo; + $this->pp = new PostProcess; + $this->nzb = new NZB; $this->lookuppar2 = (int) Settings::settingValue('..lookuppar2') === 1; $this->alternateNNTP = (int) Settings::settingValue('..alternate_nntp') === 1; } diff --git a/Blacklight/NZBExport.php b/Blacklight/NZBExport.php index 5e693510e..1cddd088f 100755 --- a/Blacklight/NZBExport.php +++ b/Blacklight/NZBExport.php @@ -31,8 +31,8 @@ class NZBExport public function __construct() { $this->echoCLI = config('nntmux.echocli'); - $this->releases = new Releases(); - $this->nzb = new NZB(); + $this->releases = new Releases; + $this->nzb = new NZB; } /** diff --git a/Blacklight/NZBImport.php b/Blacklight/NZBImport.php index 177fde404..fefed92c2 100755 --- a/Blacklight/NZBImport.php +++ b/Blacklight/NZBImport.php @@ -65,11 +65,11 @@ class NZBImport public function __construct(array $options = []) { $this->echoCLI = config('nntmux.echocli'); - $this->binaries = new Binaries(); - $this->category = new Categorize(); - $this->nzb = new NZB(); - $this->releaseCleaner = new ReleaseCleaning(); - $this->colorCli = new ColorCLI(); + $this->binaries = new Binaries; + $this->category = new Categorize; + $this->nzb = new NZB; + $this->releaseCleaner = new ReleaseCleaning; + $this->colorCli = new ColorCLI; $this->crossPostt = Settings::settingValue('..crossposttime') !== '' ? Settings::settingValue('..crossposttime') : 2; // Set properties from options diff --git a/Blacklight/NameFixer.php b/Blacklight/NameFixer.php index 2fe3b6b8c..a1e3ef2a1 100755 --- a/Blacklight/NameFixer.php +++ b/Blacklight/NameFixer.php @@ -130,10 +130,10 @@ class NameFixer $this->fullall = ''; $this->_fileName = ''; $this->done = $this->matched = false; - $this->colorCLI = new ColorCLI(); - $this->category = new Categorize(); - $this->manticore = new ManticoreSearch(); - $this->elasticsearch = new ElasticSearchSiteSearch(); + $this->colorCLI = new ColorCLI; + $this->category = new Categorize; + $this->manticore = new ManticoreSearch; + $this->elasticsearch = new ElasticSearchSiteSearch; } /** @@ -507,8 +507,8 @@ class NameFixer $this->_totalReleases = $total; $this->colorCLI->climate()->info(number_format($total).' releases to process.'); - $Nfo = new Nfo(); - $nzbContents = new NZBContents(); + $Nfo = new Nfo; + $nzbContents = new NZBContents; foreach ($releases as $release) { if ($nzbContents->checkPAR2($release->guid, $release->releases_id, $release->groups_id, $nameStatus, $show)) { @@ -792,7 +792,7 @@ class NameFixer 'Renamed Releases: ['. number_format($this->fixed). '] '. - (new ConsoleTools())->percentString($this->checked, $this->_totalReleases) + (new ConsoleTools)->percentString($this->checked, $this->_totalReleases) ); } } @@ -814,7 +814,7 @@ class NameFixer $release->releases_id = $release->id; } if ($this->relid !== $release->releases_id) { - $newName = (new ReleaseCleaning())->fixerCleaner($name); + $newName = (new ReleaseCleaning)->fixerCleaner($name); if (strtolower($newName) !== strtolower($release->searchname)) { $this->matched = true; $this->relid = (int) $release->releases_id; @@ -990,7 +990,7 @@ class NameFixer 'method' => '', ] ): void { - $colorCLI = new ColorCLI(); + $colorCLI = new ColorCLI; echo PHP_EOL; $colorCLI->info('New name: ').$colorCLI->primaryOver($data['new_name']). @@ -1122,7 +1122,7 @@ class NameFixer $counted++; } if ($show === 0) { - $this->colorCLI->climate()->info('Renamed Releases: ['.number_format($counted).'] '.(new ConsoleTools())->percentString(++$counter, $total)); + $this->colorCLI->climate()->info('Renamed Releases: ['.number_format($counted).'] '.(new ConsoleTools)->percentString(++$counter, $total)); } } $this->colorCLI->climate()->info(PHP_EOL.'Renamed '.number_format($counted).' releases in '.now()->diffInSeconds($timeStart, true).' seconds'.'.'); @@ -1294,7 +1294,7 @@ class NameFixer $updated += $this->matchPredbHash($hits[0], $row, $echo, $nameStatus, $show); } if ($show === 2) { - $this->colorCLI->climate()->info('Renamed Releases: ['.number_format($updated).'] '.(new ConsoleTools())->percentString($checked++, $total)); + $this->colorCLI->climate()->info('Renamed Releases: ['.number_format($updated).'] '.(new ConsoleTools)->percentString($checked++, $total)); } } if ($echo === 1) { diff --git a/Blacklight/Nfo.php b/Blacklight/Nfo.php index 68dcbf084..d5d6b006e 100755 --- a/Blacklight/Nfo.php +++ b/Blacklight/Nfo.php @@ -72,7 +72,7 @@ class Nfo $this->maxRetries = $this->maxRetries < -8 ? -8 : $this->maxRetries; $this->maxSize = (int) Settings::settingValue('..maxsizetoprocessnfo'); $this->minSize = (int) Settings::settingValue('..minsizetoprocessnfo'); - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; $this->tmpPath = config('nntmux.tmp_unrar_path'); if (! preg_match('/[\/\\\\]$/', $this->tmpPath)) { @@ -164,11 +164,11 @@ class Nfo } // Check if it's a par2. - $par2info = new Par2Info(); + $par2info = new Par2Info; $par2info->setData($possibleNFO); if ($par2info->error) { // Check if it's an SFV. - $sfv = new SfvInfo(); + $sfv = new SfvInfo; $sfv->setData($possibleNFO); if ($sfv->error) { return true; diff --git a/Blacklight/PopulateAniDB.php b/Blacklight/PopulateAniDB.php index 9a1029bef..068416cb5 100644 --- a/Blacklight/PopulateAniDB.php +++ b/Blacklight/PopulateAniDB.php @@ -52,7 +52,7 @@ class PopulateAniDB public function __construct() { $this->echooutput = config('nntmux.echocli'); - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; $anidbupdint = Settings::settingValue('APIs.AniDB.max_update_frequency'); $lastupdated = Settings::settingValue('APIs.AniDB.last_full_update'); @@ -430,7 +430,7 @@ class PopulateAniDB } if (! empty($picture) && ! file_exists($this->imgSavePath.$aniDbId.'.jpg')) { - (new ReleaseImage())->saveImage( + (new ReleaseImage)->saveImage( $aniDbId, 'http://img7.anidb.net/pics/anime/'.$picture, $this->imgSavePath diff --git a/Blacklight/ReleaseImage.php b/Blacklight/ReleaseImage.php index d0657218f..79358dabe 100755 --- a/Blacklight/ReleaseImage.php +++ b/Blacklight/ReleaseImage.php @@ -48,7 +48,7 @@ class ReleaseImage */ public function __construct() { - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; $this->audSavePath = storage_path('covers/audiosample/'); $this->imgSavePath = storage_path('covers/preview/'); $this->jpgSavePath = storage_path('covers/sample/'); diff --git a/Blacklight/ReleaseRemover.php b/Blacklight/ReleaseRemover.php index 134d05ca7..ed0a16d7f 100755 --- a/Blacklight/ReleaseRemover.php +++ b/Blacklight/ReleaseRemover.php @@ -58,10 +58,10 @@ class ReleaseRemover public function __construct() { - $this->colorCLI = new ColorCLI(); - $this->releases = new Releases(); - $this->nzb = new NZB(); - $this->releaseImage = new ReleaseImage(); + $this->colorCLI = new ColorCLI; + $this->releases = new Releases; + $this->nzb = new NZB; + $this->releaseImage = new ReleaseImage; $this->query = ''; $this->error = ''; @@ -724,9 +724,9 @@ class ReleaseRemover if ($opTypeName === 'Subject') { if (config('nntmux.elasticsearch_enabled') === true) { - $searchResult = (new ElasticSearchSiteSearch())->indexSearch($regexMatch, 100); + $searchResult = (new ElasticSearchSiteSearch)->indexSearch($regexMatch, 100); } else { - $searchResult = (new ManticoreSearch())->searchIndexes('releases_rt', $regexMatch, ['name,searchname']); + $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $regexMatch, ['name,searchname']); if (! empty($searchResult)) { $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); } diff --git a/Blacklight/Releases.php b/Blacklight/Releases.php index 646df6efc..5e74cb385 100644 --- a/Blacklight/Releases.php +++ b/Blacklight/Releases.php @@ -38,8 +38,8 @@ class Releases extends Release public function __construct() { parent::__construct(); - $this->manticoreSearch = new ManticoreSearch(); - $this->elasticSearch = new ElasticSearchSiteSearch(); + $this->manticoreSearch = new ManticoreSearch; + $this->elasticSearch = new ElasticSearchSiteSearch; } /** @@ -325,8 +325,8 @@ class Releases extends Release { $list = (array) $list; - $nzb = new NZB(); - $releaseImage = new ReleaseImage(); + $nzb = new NZB; + $releaseImage = new ReleaseImage; foreach ($list as $identifier) { $this->deleteSingle(['g' => $identifier, 'i' => false], $nzb, $releaseImage); diff --git a/Blacklight/Steam.php b/Blacklight/Steam.php index 62341b517..fa1495542 100755 --- a/Blacklight/Steam.php +++ b/Blacklight/Steam.php @@ -46,7 +46,7 @@ class Steam ] ); - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; } /** @@ -135,7 +135,7 @@ class Steam */ public function populateSteamAppsTable(): void { - $bar = new ProgressBar(); + $bar = new ProgressBar; $lastUpdate = Settings::settingValue('APIs.Steam.last_update'); $this->lastUpdate = $lastUpdate > 0 ? $lastUpdate : 0; if ((time() - (int) $this->lastUpdate) > 86400) { diff --git a/Blacklight/Tmux.php b/Blacklight/Tmux.php index 49ed47cae..37de4c7ac 100755 --- a/Blacklight/Tmux.php +++ b/Blacklight/Tmux.php @@ -27,7 +27,7 @@ class Tmux public function __construct() { $this->pdo = DB::connection()->getPdo(); - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; } /** diff --git a/Blacklight/XXX.php b/Blacklight/XXX.php index 19462df89..a54b3ec00 100755 --- a/Blacklight/XXX.php +++ b/Blacklight/XXX.php @@ -46,11 +46,11 @@ class XXX public function __construct() { - $this->releaseImage = new ReleaseImage(); - $this->colorCli = new ColorCLI(); + $this->releaseImage = new ReleaseImage; + $this->colorCli = new ColorCLI; $this->movieQty = Settings::settingValue('..maxxxxprocessed') !== '' ? (int) Settings::settingValue('..maxxxxprocessed') : 100; - $this->showPasswords = (new Releases())->showPasswords(); + $this->showPasswords = (new Releases)->showPasswords(); $this->echoOutput = config('nntmux.echocli'); $this->imgSavePath = storage_path('covers/xxx/'); $this->cookie = resource_path('tmp/xxx.cookie'); @@ -369,7 +369,7 @@ class XXX $cover = $backdrop = 0; $xxxID = -2; $this->whichClass = 'aebn'; - $mov = new AEBN(); + $mov = new AEBN; $mov->cookie = $this->cookie; $this->colorCli->info('Checking AEBN for movie info'); $res = $mov->processSite($movie); @@ -384,7 +384,7 @@ class XXX if ($res === false) { $this->whichClass = 'adm'; - $mov = new ADM(); + $mov = new ADM; $mov->cookie = $this->cookie; $this->colorCli->info('Checking ADM for movie info'); $res = $mov->processSite($movie); @@ -392,14 +392,14 @@ class XXX if ($res === false) { $this->whichClass = 'ade'; - $mov = new ADE(); + $mov = new ADE; $this->colorCli->info('Checking ADE for movie info'); $res = $mov->processSite($movie); } if ($res === false) { $this->whichClass = 'hotm'; - $mov = new Hotmovies(); + $mov = new Hotmovies; $mov->cookie = $this->cookie; $this->colorCli->info('Checking HotMovies for movie info'); $res = $mov->processSite($movie); diff --git a/Blacklight/libraries/Forking.php b/Blacklight/libraries/Forking.php index b1d900221..d58e8aaf8 100755 --- a/Blacklight/libraries/Forking.php +++ b/Blacklight/libraries/Forking.php @@ -93,7 +93,7 @@ class Forking public function __construct() { SerializableClosure::removeSecurityProvider(); - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; $this->dnr_path = PHP_BINARY.' misc/update/multiprocessing/.do_not_run/switch.php "php '; @@ -851,7 +851,7 @@ class Forking { $sharing = DB::select('SELECT enabled FROM sharing'); if ($sharing > 0 && (int) $sharing[0]->enabled === 1) { - $nntp = new NNTP(); + $nntp = new NNTP; if ((int) (Settings::settingValue('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) === true) { (new PostProcess(['ColorCLI' => $this->colorCli]))->processSharing($nntp); } diff --git a/Blacklight/libraries/TraktAPI.php b/Blacklight/libraries/TraktAPI.php index 0af3975dc..5005214fd 100755 --- a/Blacklight/libraries/TraktAPI.php +++ b/Blacklight/libraries/TraktAPI.php @@ -41,7 +41,7 @@ class TraktAPI } $this->requestHeaders = $headers; - $this->client = new Client(); + $this->client = new Client; } /** diff --git a/Blacklight/processing/PostProcess.php b/Blacklight/processing/PostProcess.php index 77d008a84..c3c1c18c3 100755 --- a/Blacklight/processing/PostProcess.php +++ b/Blacklight/processing/PostProcess.php @@ -54,9 +54,9 @@ class PostProcess $this->echooutput = config('nntmux.echocli'); // Class instances. - $this->_par2Info = new Par2Info(); - $this->nameFixer = new NameFixer(); - $this->Nfo = new Nfo(); + $this->_par2Info = new Par2Info; + $this->nameFixer = new NameFixer; + $this->Nfo = new Nfo; // Site settings. $this->addpar2 = (int) Settings::settingValue('..addpar2') !== 0; diff --git a/Blacklight/processing/ProcessReleases.php b/Blacklight/processing/ProcessReleases.php index a715732b8..382f475e6 100755 --- a/Blacklight/processing/ProcessReleases.php +++ b/Blacklight/processing/ProcessReleases.php @@ -76,11 +76,11 @@ class ProcessReleases { $this->echoCLI = config('nntmux.echocli'); - $this->colorCLI = new ColorCLI(); - $this->nzb = new NZB(); - $this->releaseCleaning = new ReleaseCleaning(); - $this->releases = new Releases(); - $this->releaseImage = new ReleaseImage(); + $this->colorCLI = new ColorCLI; + $this->nzb = new NZB; + $this->releaseCleaning = new ReleaseCleaning; + $this->releases = new Releases; + $this->releaseImage = new ReleaseImage; $dummy = Settings::settingValue('..delaytime'); $this->collectionDelayTime = ($dummy !== '' ? (int) $dummy : 2); @@ -178,7 +178,7 @@ class ProcessReleases */ public function categorizeRelease(string $type, $groupId): int { - $cat = new Categorize(); + $cat = new Categorize; $categorized = $total = 0; $releasesQuery = Release::query()->where(['categories_id' => Category::OTHER_MISC, 'iscategorized' => 0]); if (! empty($groupId)) { @@ -384,7 +384,7 @@ class ProcessReleases { $startTime = now()->toImmutable(); - $categorize = new Categorize(); + $categorize = new Categorize; $returnCount = $duplicate = 0; if ($this->echoCLI) { @@ -809,7 +809,7 @@ class ProcessReleases public function deleteReleases(): void { $startTime = now()->toImmutable(); - $genres = new Genres(); + $genres = new Genres; $passwordDeleted = $duplicateDeleted = $retentionDeleted = $completionDeleted = $disabledCategoryDeleted = 0; $disabledGenreDeleted = $miscRetentionDeleted = $miscHashedDeleted = $categoryMinSizeDeleted = 0; diff --git a/Blacklight/processing/adult/AdultMovies.php b/Blacklight/processing/adult/AdultMovies.php index f1d819cfe..8a0b1a481 100644 --- a/Blacklight/processing/adult/AdultMovies.php +++ b/Blacklight/processing/adult/AdultMovies.php @@ -17,7 +17,7 @@ abstract class AdultMovies */ public function __construct() { - $this->_html = new HtmlDomParser(); + $this->_html = new HtmlDomParser; } /** diff --git a/Blacklight/processing/post/AniDB.php b/Blacklight/processing/post/AniDB.php index 40bff6c56..3952cf036 100755 --- a/Blacklight/processing/post/AniDB.php +++ b/Blacklight/processing/post/AniDB.php @@ -43,8 +43,8 @@ class AniDB public function __construct() { $this->echooutput = config('nntmux.echocli'); - $this->padb = new PaDb(); - $this->colorCli = new ColorCLI(); + $this->padb = new PaDb; + $this->colorCli = new ColorCLI; $quantity = (int) Settings::settingValue('..maxanidbprocessed'); $this->aniqty = $quantity ?? 100; diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index 70dac78d6..d3d2cdf6f 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -259,21 +259,21 @@ class ProcessAdditional { $this->_echoCLI = config('nntmux.echocli'); - $this->_nntp = new NNTP(); + $this->_nntp = new NNTP; - $this->_nzb = new NZB(); - $this->_archiveInfo = new ArchiveInfo(); - $this->_categorize = new Categorize(); - $this->_nameFixer = new NameFixer(); - $this->_releaseExtra = new ReleaseExtra(); - $this->_releaseImage = new ReleaseImage(); - $this->_par2Info = new Par2Info(); - $this->_nfo = new Nfo(); - $this->manticore = new ManticoreSearch(); - $this->elasticsearch = new ElasticSearchSiteSearch(); + $this->_nzb = new NZB; + $this->_archiveInfo = new ArchiveInfo; + $this->_categorize = new Categorize; + $this->_nameFixer = new NameFixer; + $this->_releaseExtra = new ReleaseExtra; + $this->_releaseImage = new ReleaseImage; + $this->_par2Info = new Par2Info; + $this->_nfo = new Nfo; + $this->manticore = new ManticoreSearch; + $this->elasticsearch = new ElasticSearchSiteSearch; $this->ffmpeg = FFMpeg::create(['timeout' => Settings::settingValue('..timeoutseconds')]); $this->ffprobe = FFProbe::create(); - $this->mediaInfo = new MediaInfo(); + $this->mediaInfo = new MediaInfo; $this->mediaInfo->setConfig('use_oldxml_mediainfo_output_format', true); $this->mediaInfo->setConfig('command', Settings::settingValue('apps..mediainfopath')); @@ -894,14 +894,14 @@ class ProcessAdditional if (preg_match(NameFixer::PREDB_REGEX, $rarFileName[0], $hit)) { $preCheck = Predb::whereTitle($hit[0])->first(); $this->_release->preid = $preCheck !== null ? $preCheck->value('id') : 0; - (new NameFixer())->updateRelease($this->_release, $preCheck->title ?? ucwords($hit[0], '.'), 'RarInfo FileName Match', true, 'Filenames, ', true, true, $this->_release->preid); + (new NameFixer)->updateRelease($this->_release, $preCheck->title ?? ucwords($hit[0], '.'), 'RarInfo FileName Match', true, 'Filenames, ', true, true, $this->_release->preid); } elseif (! empty($dataSummary['archives']) && ! empty($dataSummary['archives'][$rarFileName[0]]['file_list'])) { $archiveData = $dataSummary['archives'][$rarFileName[0]]['file_list']; $archiveFileName = Arr::pluck($archiveData, 'name'); if (preg_match(NameFixer::PREDB_REGEX, $archiveFileName[0], $match2)) { $preCheck = Predb::whereTitle($match2[0])->first(); $this->_release->preid = $preCheck !== null ? $preCheck->value('id') : 0; - (new NameFixer())->updateRelease($this->_release, $preCheck->title ?? ucwords($match2[0], '.'), 'RarInfo FileName Match', true, 'Filenames, ', true, true, $this->_release->preid); + (new NameFixer)->updateRelease($this->_release, $preCheck->title ?? ucwords($match2[0], '.'), 'RarInfo FileName Match', true, 'Filenames, ', true, true, $this->_release->preid); } } } @@ -1572,7 +1572,7 @@ class ProcessAdditional if ($this->ffprobe->isValid($fileLocation)) { try { $audioSample = $this->ffmpeg->open($fileLocation); - $format = new Vorbis(); + $format = new Vorbis; $audioSample->clip(TimeCode::fromSeconds(30), TimeCode::fromSeconds(30)); $audioSample->save($format, $this->tmpPath.$audioFileName); } catch (\InvalidArgumentException $e) { @@ -1774,7 +1774,7 @@ class ProcessAdditional try { $video = $this->ffmpeg->open($fileLocation); $videoSample = $video->clip(TimeCode::fromString($lowestLength), TimeCode::fromSeconds($this->_ffMPEGDuration)); - $format = new Ogg(); + $format = new Ogg; $format->setAudioCodec('libvorbis'); $videoSample->filters()->resize(new Dimension(320, -1), ResizeFilter::RESIZEMODE_SCALE_HEIGHT); $videoSample->save($format, $fileName); @@ -1793,7 +1793,7 @@ class ProcessAdditional try { $video = $this->ffmpeg->open($fileLocation); $videoSample = $video->clip(TimeCode::fromSeconds(0), TimeCode::fromSeconds($this->_ffMPEGDuration)); - $format = new Ogg(); + $format = new Ogg; $format->setAudioCodec('libvorbis'); $videoSample->filters()->resize(new Dimension(320, -1), ResizeFilter::RESIZEMODE_SCALE_HEIGHT); $videoSample->save($format, $fileName); @@ -2085,7 +2085,7 @@ class ProcessAdditional protected function _echo(string $string, string $type): void { if ($this->_echoCLI) { - (new ColorCLI())->$type($string); + (new ColorCLI)->$type($string); } } diff --git a/Blacklight/processing/tv/TMDB.php b/Blacklight/processing/tv/TMDB.php index 7061ef1b8..71ed1bc3a 100644 --- a/Blacklight/processing/tv/TMDB.php +++ b/Blacklight/processing/tv/TMDB.php @@ -259,7 +259,7 @@ class TMDB extends TV */ public function getPoster(int $videoId): int { - $ri = new ReleaseImage(); + $ri = new ReleaseImage; $hascover = 0; diff --git a/Blacklight/processing/tv/TV.php b/Blacklight/processing/tv/TV.php index 11c454b68..fe79edd07 100755 --- a/Blacklight/processing/tv/TV.php +++ b/Blacklight/processing/tv/TV.php @@ -78,7 +78,7 @@ abstract class TV extends Videos public function __construct() { parent::__construct(); - $this->colorCli = new ColorCLI(); + $this->colorCli = new ColorCLI; $this->catWhere = 'categories_id BETWEEN '.Category::TV_ROOT.' AND '.Category::TV_OTHER.' AND categories_id != '.Category::TV_ANIME; $this->tvqty = Settings::settingValue('..maxrageprocessed') !== '' ? (int) Settings::settingValue('..maxrageprocessed') : 75; $this->imgSavePath = storage_path('covers/tvshows/'); diff --git a/Blacklight/processing/tv/TVDB.php b/Blacklight/processing/tv/TVDB.php index 46438a02f..a52c6d7d3 100755 --- a/Blacklight/processing/tv/TVDB.php +++ b/Blacklight/processing/tv/TVDB.php @@ -47,7 +47,7 @@ class TVDB extends TV public function __construct() { parent::__construct(); - $this->client = new TheTVDbAPI(); + $this->client = new TheTVDbAPI; $this->local = false; $this->authorizeTvdb(); @@ -277,7 +277,7 @@ class TVDB extends TV */ public function getPoster(int $videoId): int { - $ri = new ReleaseImage(); + $ri = new ReleaseImage; // Try to get the Poster $hasCover = $ri->saveImage($videoId, $this->posterUrl, $this->imgSavePath); diff --git a/Blacklight/processing/tv/TVMaze.php b/Blacklight/processing/tv/TVMaze.php index fcaddd3e1..2bc86a600 100644 --- a/Blacklight/processing/tv/TVMaze.php +++ b/Blacklight/processing/tv/TVMaze.php @@ -33,7 +33,7 @@ class TVMaze extends TV public function __construct() { parent::__construct(); - $this->client = new Client(); + $this->client = new Client; } /** @@ -290,7 +290,7 @@ class TVMaze extends TV */ public function getPoster(int $videoId): int { - $ri = new ReleaseImage(); + $ri = new ReleaseImage; $hasCover = 0; diff --git a/Blacklight/processing/tv/TraktTv.php b/Blacklight/processing/tv/TraktTv.php index 71c306bf7..1321718f1 100755 --- a/Blacklight/processing/tv/TraktTv.php +++ b/Blacklight/processing/tv/TraktTv.php @@ -212,7 +212,7 @@ class TraktTv extends TV public function getPoster(int $videoId): int { $hasCover = 0; - $ri = new ReleaseImage(); + $ri = new ReleaseImage; if ($this->posterUrl !== '') { // Try to get the Poster diff --git a/app/Console/Commands/CleanNZB.php b/app/Console/Commands/CleanNZB.php index edd7dfe7f..0a690c618 100644 --- a/app/Console/Commands/CleanNZB.php +++ b/app/Console/Commands/CleanNZB.php @@ -52,7 +52,7 @@ class CleanNZB extends Command private function GetNZBsWithNoDatabaseEntry($delete = false) { $this->info('Getting list of NZB files on disk to check if they exist in database'); - $releases = new Release(); + $releases = new Release; $checked = $deleted = 0; // Get the list of NZBs in the NZB folder $dirItr = new \RecursiveDirectoryIterator(Settings::settingValue('..nzbpath')); @@ -80,8 +80,8 @@ class CleanNZB extends Command private function GetReleasesWithNoNZBOnDisk($delete = false) { // Setup - $nzb = new NZB(); - $rel = new Releases(); + $nzb = new NZB; + $rel = new Releases; $checked = $deleted = 0; $this->info('Getting list of releases from database to check if they have a corresponding NZB on disk'); @@ -94,7 +94,7 @@ class CleanNZB extends Command if (! $nzb->NZBPath($r->guid)) { if ($delete) { - $rel->deleteSingle(['g' => $r->guid, 'i' => $r->id], $nzb, new ReleaseImage()); + $rel->deleteSingle(['g' => $r->guid, 'i' => $r->id], $nzb, new ReleaseImage); } $deleted++; $this->line("Deleted: $r->searchname -> $r->guid"); diff --git a/app/Console/Commands/ImportNzbs.php b/app/Console/Commands/ImportNzbs.php index d06467672..5074f4df2 100644 --- a/app/Console/Commands/ImportNzbs.php +++ b/app/Console/Commands/ImportNzbs.php @@ -53,7 +53,7 @@ class ImportNzbs extends Command if (empty($folders)) { $this->info('Importing NZB files from '.$importFolder); $files = File::allFiles($importFolder); - $NZBImport = new NZBImport(); + $NZBImport = new NZBImport; try { $NZBImport->beginImport($files, $useNzbName, $deleteNZB, $deleteFailedNZB); @@ -64,7 +64,7 @@ class ImportNzbs extends Command foreach ($folders as $folder) { $this->info('Importing NZB files from '.$folder); $files = File::allFiles($folder); - $NZBImport = new NZBImport(); + $NZBImport = new NZBImport; try { $NZBImport->beginImport($files, $useNzbName, $deleteNZB, $deleteFailedNZB); diff --git a/app/Console/Commands/NntmuxPopulateSearchIndexes.php b/app/Console/Commands/NntmuxPopulateSearchIndexes.php index 52566267a..3da5cad88 100644 --- a/app/Console/Commands/NntmuxPopulateSearchIndexes.php +++ b/app/Console/Commands/NntmuxPopulateSearchIndexes.php @@ -60,7 +60,7 @@ class NntmuxPopulateSearchIndexes extends Command */ private function manticoreReleases(): void { - $manticore = new ManticoreSearch(); + $manticore = new ManticoreSearch; $manticore->truncateRTIndex(Arr::wrap('releases_rt')); $data = []; $total = Release::count(); @@ -107,7 +107,7 @@ class NntmuxPopulateSearchIndexes extends Command */ private function manticorePreDB(): void { - $manticore = new ManticoreSearch(); + $manticore = new ManticoreSearch; $manticore->truncateRTIndex(['predb_rt']); $data = []; @@ -149,7 +149,7 @@ class NntmuxPopulateSearchIndexes extends Command private function elasticReleases(): void { $data = ['body' => []]; - $elastic = new ElasticSearchSiteSearch(); + $elastic = new ElasticSearchSiteSearch; $total = Release::count(); if (! $total) { $this->warn('Could not get database information for releases table.'); @@ -200,7 +200,7 @@ class NntmuxPopulateSearchIndexes extends Command private function elasticPreDB(): void { $data = ['body' => []]; - $elastic = new ElasticSearchSiteSearch(); + $elastic = new ElasticSearchSiteSearch; $total = Predb::count(); if (! $total) { $this->warn('Could not get database information for predb table.'); @@ -250,7 +250,7 @@ class NntmuxPopulateSearchIndexes extends Command { $this->info('Optimizing release_rt & predb_rt indexes'); try { - (new ManticoreSearch())->optimizeRTIndex(); + (new ManticoreSearch)->optimizeRTIndex(); } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/app/Console/Commands/NntmuxPopulateSteam.php b/app/Console/Commands/NntmuxPopulateSteam.php index 4aa0f453c..ab3846d2e 100644 --- a/app/Console/Commands/NntmuxPopulateSteam.php +++ b/app/Console/Commands/NntmuxPopulateSteam.php @@ -26,7 +26,7 @@ class NntmuxPopulateSteam extends Command */ public function handle(): void { - $steam = new Steam(); + $steam = new Steam; $steam->populateSteamAppsTable(); } diff --git a/app/Console/Commands/NntmuxPopulateSteamApps.php b/app/Console/Commands/NntmuxPopulateSteamApps.php index 220924477..48366b3f3 100644 --- a/app/Console/Commands/NntmuxPopulateSteamApps.php +++ b/app/Console/Commands/NntmuxPopulateSteamApps.php @@ -27,7 +27,7 @@ class NntmuxPopulateSteamApps extends Command public function handle(): void { try { - (new Steam())->populateSteamAppsTable(); + (new Steam)->populateSteamAppsTable(); } catch (\Exception $e) { $this->error($e->getMessage()); $this->error('There was an error populating the steam_apps table'); diff --git a/app/Console/Commands/NntmuxRemoveBadReleases.php b/app/Console/Commands/NntmuxRemoveBadReleases.php index ca1c4e617..7e967c924 100644 --- a/app/Console/Commands/NntmuxRemoveBadReleases.php +++ b/app/Console/Commands/NntmuxRemoveBadReleases.php @@ -49,7 +49,7 @@ class NntmuxRemoveBadReleases extends Command // Select releases with password status -2 and smaller and delete them. Also delete the files from the filesystem. $badReleases = Release::query()->where('passwordstatus', '<=', -2)->get(); foreach ($badReleases as $badRelease) { - $nzbPath = (new NZB())->getNZBPath($badRelease->guid); + $nzbPath = (new NZB)->getNZBPath($badRelease->guid); File::delete($nzbPath); (new ReleaseImage)->delete($badRelease->guid); if (config('nntmux.elasticsearch_enabled') === true) { @@ -68,7 +68,7 @@ class NntmuxRemoveBadReleases extends Command 'i' => $badRelease->id, ]; // Delete from sphinx. - (new ManticoreSearch())->deleteRelease($identifiers); + (new ManticoreSearch)->deleteRelease($identifiers); } $badRelease->delete(); } diff --git a/app/Console/Commands/NntmuxResetDb.php b/app/Console/Commands/NntmuxResetDb.php index 6274576eb..877c2030a 100644 --- a/app/Console/Commands/NntmuxResetDb.php +++ b/app/Console/Commands/NntmuxResetDb.php @@ -172,7 +172,7 @@ class NntmuxResetDb extends Command $this->info('All done! ElasticSearch indexes are deleted and recreated.'); } else { - (new ManticoreSearch())->truncateRTIndex(['releases_rt', 'predb_rt']); + (new ManticoreSearch)->truncateRTIndex(['releases_rt', 'predb_rt']); } $this->info('Deleting nzbfiles subfolders.'); diff --git a/app/Console/Commands/RecategorizeReleases.php b/app/Console/Commands/RecategorizeReleases.php index 5c6989d12..920ef5ecd 100644 --- a/app/Console/Commands/RecategorizeReleases.php +++ b/app/Console/Commands/RecategorizeReleases.php @@ -58,7 +58,7 @@ class RecategorizeReleases extends Command $count = $countQuery->count(); - $cat = new Categorize(); + $cat = new Categorize; $results = $countQuery->select(['id', 'searchname', 'fromname', 'groups_id', 'categories_id'])->get(); $bar = $this->output->createProgressBar($count); $bar->start(); diff --git a/app/Console/Commands/TmuxUIStart.php b/app/Console/Commands/TmuxUIStart.php index 8c88066ac..c5cbf2698 100644 --- a/app/Console/Commands/TmuxUIStart.php +++ b/app/Console/Commands/TmuxUIStart.php @@ -28,7 +28,7 @@ class TmuxUIStart extends Command */ public function handle(): void { - $tmux = new Tmux(); + $tmux = new Tmux; $tmux_session = Settings::settingValue('site.tmux.tmux_session') ?? 0; // Set running value to on. diff --git a/app/Console/Commands/TmuxUIStop.php b/app/Console/Commands/TmuxUIStop.php index dcf38c865..3109bf329 100644 --- a/app/Console/Commands/TmuxUIStop.php +++ b/app/Console/Commands/TmuxUIStop.php @@ -28,7 +28,7 @@ class TmuxUIStop extends Command */ public function handle(): void { - $tmux = new Tmux(); + $tmux = new Tmux; $tmux->stopIfRunning(); if ($this->option('kill') === true) { $sessionName = Settings::settingValue('site.tmux.tmux_session'); diff --git a/app/Console/Commands/UpdateNNTmux.php b/app/Console/Commands/UpdateNNTmux.php index 26efd5b51..043e78286 100644 --- a/app/Console/Commands/UpdateNNTmux.php +++ b/app/Console/Commands/UpdateNNTmux.php @@ -76,7 +76,7 @@ class UpdateNNTmux extends Command echo $process->errorOutput(); $this->info('Assets built successfully!'); - $cleared = (new Smarty())->setCompileDir(config('ytake-laravel-smarty.compile_path'))->clearCompiledTemplate(); + $cleared = (new Smarty)->setCompileDir(config('ytake-laravel-smarty.compile_path'))->clearCompiledTemplate(); if ($cleared) { $this->output->writeln('The Smarty compiled template cache has been cleaned for you'); } else { @@ -107,7 +107,7 @@ class UpdateNNTmux extends Command private function stopTmux(): bool { - if ((new Tmux())->isRunning() === true) { + if ((new Tmux)->isRunning() === true) { $this->call('tmux-ui:stop', ['--kill' => true]); return true; diff --git a/app/Console/Commands/UpdateNNTmuxGit.php b/app/Console/Commands/UpdateNNTmuxGit.php index 5947c474b..5f28c386d 100644 --- a/app/Console/Commands/UpdateNNTmuxGit.php +++ b/app/Console/Commands/UpdateNNTmuxGit.php @@ -34,7 +34,7 @@ class UpdateNNTmuxGit extends Command { $wasRunning = false; - if ((new Tmux())->isRunning()) { + if ((new Tmux)->isRunning()) { $wasRunning = true; $this->call('tmux-ui:stop', ['--kill' => true]); } diff --git a/app/Extensions/helper/helpers.php b/app/Extensions/helper/helpers.php index 3f089fc47..6c132750c 100644 --- a/app/Extensions/helper/helpers.php +++ b/app/Extensions/helper/helpers.php @@ -23,7 +23,7 @@ if (! function_exists('getRawHtml')) { */ function getRawHtml($url, $cookie = false) { - $cookieJar = new CookieJar(); + $cookieJar = new CookieJar; $client = new Client(['headers' => ['User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246']]); if ($cookie !== false) { $cookie = $cookieJar->setCookie(SetCookie::fromString($cookie)); @@ -67,7 +67,7 @@ if (! function_exists('makeFieldLinks')) { continue; } if ($type === 'xxx' && $field === 'genre') { - $ta = (new XXX())->getGenres(true, $ta); + $ta = (new XXX)->getGenres(true, $ta); $ta = $ta['title'] ?? ''; } if ($i > 7) { @@ -272,7 +272,7 @@ if (! function_exists('is_it_json')) { */ function getStreamingZip(array $guids = []): STS\ZipStream\ZipStream { - $nzb = new NZB(); + $nzb = new NZB; $zipped = ZipStream::create(now()->format('Ymdhis').'.zip'); foreach ($guids as $guid) { $nzbPath = $nzb->NZBPath($guid); diff --git a/app/Http/Controllers/Admin/AdminAnidbController.php b/app/Http/Controllers/Admin/AdminAnidbController.php index acd2fc4e7..5e63a50d7 100644 --- a/app/Http/Controllers/Admin/AdminAnidbController.php +++ b/app/Http/Controllers/Admin/AdminAnidbController.php @@ -16,7 +16,7 @@ class AdminAnidbController extends BasePageController { $this->setAdminPrefs(); - $AniDB = new AniDB(); + $AniDB = new AniDB; $title = $meta_title = 'AniDB List'; $aname = ''; @@ -43,7 +43,7 @@ class AdminAnidbController extends BasePageController { $this->setAdminPrefs(); - $AniDB = new AniDB(); + $AniDB = new AniDB; // Set the current action. $action = $request->input('action') ?? 'view'; diff --git a/app/Http/Controllers/Admin/AdminBlacklistController.php b/app/Http/Controllers/Admin/AdminBlacklistController.php index 0f3a38820..00590fde3 100644 --- a/app/Http/Controllers/Admin/AdminBlacklistController.php +++ b/app/Http/Controllers/Admin/AdminBlacklistController.php @@ -15,7 +15,7 @@ class AdminBlacklistController extends BasePageController public function index(): void { $this->setAdminPrefs(); - $binaries = new Binaries(); + $binaries = new Binaries; $meta_title = $title = 'Binary Black/White List'; diff --git a/app/Http/Controllers/Admin/AdminBookController.php b/app/Http/Controllers/Admin/AdminBookController.php index 54595ed09..9a789ad58 100644 --- a/app/Http/Controllers/Admin/AdminBookController.php +++ b/app/Http/Controllers/Admin/AdminBookController.php @@ -38,7 +38,7 @@ class AdminBookController extends BasePageController public function edit(Request $request) { $this->setAdminPrefs(); - $book = new Books(); + $book = new Books; $meta_title = $title = 'Book Edit'; diff --git a/app/Http/Controllers/Admin/AdminConsoleController.php b/app/Http/Controllers/Admin/AdminConsoleController.php index d127e8c35..0f7623112 100644 --- a/app/Http/Controllers/Admin/AdminConsoleController.php +++ b/app/Http/Controllers/Admin/AdminConsoleController.php @@ -39,7 +39,7 @@ class AdminConsoleController extends BasePageController { $this->setAdminPrefs(); $console = new Console(['Settings' => null]); - $gen = new Genres(); + $gen = new Genres; $meta_title = $title = 'Console Edit'; // set the current action diff --git a/app/Http/Controllers/Admin/AdminContentController.php b/app/Http/Controllers/Admin/AdminContentController.php index 04b424b34..4ae752046 100644 --- a/app/Http/Controllers/Admin/AdminContentController.php +++ b/app/Http/Controllers/Admin/AdminContentController.php @@ -16,7 +16,7 @@ class AdminContentController extends BasePageController public function index(): void { $this->setAdminPrefs(); - $contentList = (new Contents())->getAll(); + $contentList = (new Contents)->getAll(); $this->smarty->assign('contentlist', $contentList); $meta_title = 'Content List'; @@ -36,7 +36,7 @@ class AdminContentController extends BasePageController public function create(Request $request) { $this->setAdminPrefs(); - $contents = new Contents(); + $contents = new Contents; $meta_title = 'Content Add'; // Set the current action. @@ -110,7 +110,7 @@ class AdminContentController extends BasePageController public function destroy(Request $request): \Illuminate\Routing\Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application { if ($request->has('id')) { - $contents = new Contents(); + $contents = new Contents; $contents->delete($request->input('id')); } diff --git a/app/Http/Controllers/Admin/AdminMovieController.php b/app/Http/Controllers/Admin/AdminMovieController.php index ac1106092..fcf74c48d 100644 --- a/app/Http/Controllers/Admin/AdminMovieController.php +++ b/app/Http/Controllers/Admin/AdminMovieController.php @@ -86,7 +86,7 @@ class AdminMovieController extends BasePageController { $this->setAdminPrefs(); - $movie = new Movie(); + $movie = new Movie; $meta_title = $title = 'Add Movie'; // set the current action diff --git a/app/Http/Controllers/Admin/AdminMusicController.php b/app/Http/Controllers/Admin/AdminMusicController.php index 6a1219666..8a5b15635 100644 --- a/app/Http/Controllers/Admin/AdminMusicController.php +++ b/app/Http/Controllers/Admin/AdminMusicController.php @@ -36,8 +36,8 @@ class AdminMusicController extends BasePageController public function edit(Request $request) { $this->setAdminPrefs(); - $music = new Music(); - $gen = new Genres(); + $music = new Music; + $gen = new Genres; $meta_title = $title = 'Music Edit'; diff --git a/app/Http/Controllers/Admin/AdminNzbController.php b/app/Http/Controllers/Admin/AdminNzbController.php index d86405939..a9fcbf6f2 100644 --- a/app/Http/Controllers/Admin/AdminNzbController.php +++ b/app/Http/Controllers/Admin/AdminNzbController.php @@ -71,7 +71,7 @@ class AdminNzbController extends BasePageController public function export(Request $request): void { $this->setAdminPrefs(); - $rel = new Releases(); + $rel = new Releases; if ($this->isPostBack($request)) { $path = $request->input('folder'); diff --git a/app/Http/Controllers/Admin/AdminReleasesController.php b/app/Http/Controllers/Admin/AdminReleasesController.php index 958bc09c6..d9cd1515c 100644 --- a/app/Http/Controllers/Admin/AdminReleasesController.php +++ b/app/Http/Controllers/Admin/AdminReleasesController.php @@ -93,7 +93,7 @@ class AdminReleasesController extends BasePageController public function destroy($id): RedirectResponse { if ($id) { - $releases = new Releases(); + $releases = new Releases; $releases->deleteMultiple($id); } diff --git a/app/Http/Controllers/AdultController.php b/app/Http/Controllers/AdultController.php index 5ecaae1b5..2fb11988b 100644 --- a/app/Http/Controllers/AdultController.php +++ b/app/Http/Controllers/AdultController.php @@ -15,7 +15,7 @@ class AdultController extends BasePageController public function show(Request $request, string $id = ''): void { $this->setPreferences(); - $adult = new XXX(); + $adult = new XXX; $moviecats = Category::getChildren(Category::XXX_ROOT); $mtmp = []; diff --git a/app/Http/Controllers/AnimeController.php b/app/Http/Controllers/AnimeController.php index 3a6fbbf50..48f8e2aaa 100644 --- a/app/Http/Controllers/AnimeController.php +++ b/app/Http/Controllers/AnimeController.php @@ -27,8 +27,8 @@ class AnimeController extends BasePageController public function __construct() { parent::__construct(); - $this->aniDb = new AniDB(); - $this->releases = new Releases(); + $this->aniDb = new AniDB; + $this->releases = new Releases; } /** diff --git a/app/Http/Controllers/Api/ApiController.php b/app/Http/Controllers/Api/ApiController.php index f4e6325bd..a13ee90e8 100644 --- a/app/Http/Controllers/Api/ApiController.php +++ b/app/Http/Controllers/Api/ApiController.php @@ -114,7 +114,7 @@ class ApiController extends BasePageController } } - $releases = new Releases(); + $releases = new Releases; // Set Query Parameters based on Request objects $outputXML = ! ($request->has('o') && $request->input('o') === 'json'); diff --git a/app/Http/Controllers/Api/ApiInformController.php b/app/Http/Controllers/Api/ApiInformController.php index b5c288af6..1b55f3fd1 100644 --- a/app/Http/Controllers/Api/ApiInformController.php +++ b/app/Http/Controllers/Api/ApiInformController.php @@ -31,7 +31,7 @@ class ApiInformController extends Controller ReleaseInform::insertOrIgnore(['relOName' => $releaseObName, 'relPName' => $releasePrName, 'api_token' => $apiToken, 'created_at' => now(), 'updated_at' => now()]); $release = Release::whereSearchname($releaseObName)->first(); if (! empty($release)) { - (new NameFixer())->updateRelease($release, $releasePrName, 'Release Inform API', true, 'Filenames, ', 1, true); + (new NameFixer)->updateRelease($release, $releasePrName, 'Release Inform API', true, 'Filenames, ', 1, true); } return response()->json(['message' => 'Release Information Added!'], 200); diff --git a/app/Http/Controllers/Api/ApiV2Controller.php b/app/Http/Controllers/Api/ApiV2Controller.php index 37648923d..812a90c96 100644 --- a/app/Http/Controllers/Api/ApiV2Controller.php +++ b/app/Http/Controllers/Api/ApiV2Controller.php @@ -25,7 +25,7 @@ class ApiV2Controller extends BasePageController public function __construct() { - $this->api = new ApiController(); + $this->api = new ApiController; } public function capabilities(): JsonResponse @@ -53,7 +53,7 @@ class ApiV2Controller extends BasePageController 'movie-search' => ['available' => 'yes', 'supportedParams' => 'id, imdbid, tmdbid, traktid'], 'audio-search' => ['available' => 'no', 'supportedParams' => ''], ], - 'categories' => fractal($category, new CategoryTransformer()), + 'categories' => fractal($category, new CategoryTransformer), ]; return response()->json($capabilities); @@ -67,7 +67,7 @@ class ApiV2Controller extends BasePageController if ($request->missing('api_token') || ($request->has('api_token') && $request->isNotFilled('api_token'))) { return response()->json(['error' => 'Missing parameter (apikey)'], 403); } - $releases = new Releases(); + $releases = new Releases; $user = User::query()->where('api_token', $request->input('api_token'))->first(); $minSize = $request->has('minsize') && $request->input('minsize') > 0 ? $request->input('minsize') : 0; $maxAge = $this->api->maxAge($request); @@ -120,7 +120,7 @@ class ApiV2Controller extends BasePageController if ($request->missing('api_token') || $request->isNotFilled('api_token')) { return response()->json(['error' => 'Missing parameter (api_token)'], 403); } - $releases = new Releases(); + $releases = new Releases; $user = User::query()->where('api_token', $request->input('api_token'))->first(); $offset = $this->api->offset($request); $catExclusions = User::getCategoryExclusionForApi($request); @@ -185,7 +185,7 @@ class ApiV2Controller extends BasePageController if ($request->missing('api_token') || $request->isNotFilled('api_token')) { return response()->json(['error' => 'Missing parameter (api_token)'], 403); } - $releases = new Releases(); + $releases = new Releases; $user = User::query()->where('api_token', $request->input('api_token'))->first(); if ($user === null) { return response()->json(['error' => 'Invalid API Token'], 403); diff --git a/app/Http/Controllers/Api/RSS.php b/app/Http/Controllers/Api/RSS.php index defa94f0f..50cefa769 100644 --- a/app/Http/Controllers/Api/RSS.php +++ b/app/Http/Controllers/Api/RSS.php @@ -27,7 +27,7 @@ class RSS extends ApiController public function __construct() { parent::__construct(); - $this->releases = new Releases(); + $this->releases = new Releases; } /** diff --git a/app/Http/Controllers/Api/XML_Response.php b/app/Http/Controllers/Api/XML_Response.php index d5b586913..49eec3108 100644 --- a/app/Http/Controllers/Api/XML_Response.php +++ b/app/Http/Controllers/Api/XML_Response.php @@ -93,7 +93,7 @@ class XML_Response $this->offset = $options['Offset']; $this->type = $options['Type']; - $this->xml = new \XMLWriter(); + $this->xml = new \XMLWriter; $this->xml->openMemory(); $this->xml->setIndent(true); } diff --git a/app/Http/Controllers/BasePageController.php b/app/Http/Controllers/BasePageController.php index 2378e0f1d..94f65cd94 100644 --- a/app/Http/Controllers/BasePageController.php +++ b/app/Http/Controllers/BasePageController.php @@ -56,7 +56,7 @@ class BasePageController extends Controller { $this->middleware(['auth', 'web', '2fa'])->except('api', 'contact', 'showContactForm', 'callback', 'getNzb', 'terms', 'capabilities', 'movie', 'apiSearch', 'tv', 'details', 'failed', 'showRssDesc', 'fullFeedRss', 'categoryFeedRss', 'cartRss', 'myMoviesRss', 'myShowsRss', 'release'); // Buffer settings/DB connection. - $this->settings = new Settings(); + $this->settings = new Settings; $this->smarty = app('smarty.view'); foreach (Arr::get(config('ytake-laravel-smarty'), 'plugins_paths', []) as $plugins) { @@ -177,7 +177,7 @@ class BasePageController extends Controller $role = $this->userdata->roles_id; } - $content = new Contents(); + $content = new Contents; if ($this->userdata !== null) { $this->smarty->assign('recentforumpostslist', Forumpost::getPosts(Settings::settingValue('..showrecentforumposts'))); } diff --git a/app/Http/Controllers/BrowseController.php b/app/Http/Controllers/BrowseController.php index cb2bfe900..ad00bb262 100644 --- a/app/Http/Controllers/BrowseController.php +++ b/app/Http/Controllers/BrowseController.php @@ -15,7 +15,7 @@ class BrowseController extends BasePageController public function index(Request $request) { $this->setPreferences(); - $releases = new Releases(); + $releases = new Releases; $this->smarty->assign('category', -1); @@ -62,7 +62,7 @@ class BrowseController extends BasePageController public function show(Request $request, string $parentCategory, string $id = 'All'): void { $this->setPreferences(); - $releases = new Releases(); + $releases = new Releases; $parentId = RootCategory::query()->where('title', $parentCategory)->value('id'); @@ -156,7 +156,7 @@ class BrowseController extends BasePageController public function group(Request $request): void { $this->setPreferences(); - $releases = new Releases(); + $releases = new Releases; if ($request->has('g')) { $group = $request->input('g'); $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; diff --git a/app/Http/Controllers/ConsoleController.php b/app/Http/Controllers/ConsoleController.php index 7c5427f25..38bd2966a 100644 --- a/app/Http/Controllers/ConsoleController.php +++ b/app/Http/Controllers/ConsoleController.php @@ -19,8 +19,8 @@ class ConsoleController extends BasePageController if ($id === 'WiiVare') { $id = 'WiiVareVC'; } - $console = new Console(); - $gen = new Genres(); + $console = new Console; + $gen = new Genres; $concats = Category::getChildren(Category::GAME_ROOT); $ctmp = []; diff --git a/app/Http/Controllers/ContentController.php b/app/Http/Controllers/ContentController.php index 3d6f04c2f..e89ecff0a 100644 --- a/app/Http/Controllers/ContentController.php +++ b/app/Http/Controllers/ContentController.php @@ -15,7 +15,7 @@ class ContentController extends BasePageController public function show(Request $request) { $this->setPreferences(); - $contents = new Contents(); + $contents = new Contents; $role = $this->userdata->role ?? 0; diff --git a/app/Http/Controllers/DetailsController.php b/app/Http/Controllers/DetailsController.php index 05149ec4e..750a3f8f8 100644 --- a/app/Http/Controllers/DetailsController.php +++ b/app/Http/Controllers/DetailsController.php @@ -35,7 +35,7 @@ class DetailsController extends BasePageController $this->setPreferences(); if ($guid !== null) { - $releases = new Releases(); + $releases = new Releases; $re = new ReleaseExtra; $data = Release::getByGuid($guid); $cpapi = $this->userdata->cp_api; @@ -87,7 +87,7 @@ class DetailsController extends BasePageController $xxx = ''; if ($data['xxxinfo_id'] !== '' && $data['xxxinfo_id'] !== 0) { - $x = new XXX(); + $x = new XXX; $xxx = $x->getXXXInfo($data['xxxinfo_id']); if (isset($xxx['trailers'])) { @@ -106,7 +106,7 @@ class DetailsController extends BasePageController $game = ''; if ($data['gamesinfo_id'] !== '') { - $game = (new Games())->getGamesInfoById($data['gamesinfo_id']); + $game = (new Games)->getGamesInfoById($data['gamesinfo_id']); } $mus = ''; @@ -116,17 +116,17 @@ class DetailsController extends BasePageController $book = ''; if ($data['bookinfo_id'] !== '') { - $book = (new Books())->getBookInfo($data['bookinfo_id']); + $book = (new Books)->getBookInfo($data['bookinfo_id']); } $con = ''; if ($data['consoleinfo_id'] !== '') { - $con = (new Console())->getConsoleInfo($data['consoleinfo_id']); + $con = (new Console)->getConsoleInfo($data['consoleinfo_id']); } $AniDBAPIArray = ''; if ($data['anidbid'] > 0) { - $AniDBAPIArray = (new AniDB())->getAnimeInfo($data['anidbid']); + $AniDBAPIArray = (new AniDB)->getAnimeInfo($data['anidbid']); } $pre = Predb::getForRelease($data['predb_id']); diff --git a/app/Http/Controllers/FileListController.php b/app/Http/Controllers/FileListController.php index 4768ea561..2a09559c4 100644 --- a/app/Http/Controllers/FileListController.php +++ b/app/Http/Controllers/FileListController.php @@ -13,7 +13,7 @@ class FileListController extends BasePageController public function show(string $guid): void { $this->setPreferences(); - $nzb = new NZB(); + $nzb = new NZB; if ($guid !== null) { $rel = Release::getByGuid($guid); diff --git a/app/Http/Controllers/GetNzbController.php b/app/Http/Controllers/GetNzbController.php index 41cc054a9..44fa93793 100644 --- a/app/Http/Controllers/GetNzbController.php +++ b/app/Http/Controllers/GetNzbController.php @@ -84,7 +84,7 @@ class GetNzbController extends BasePageController return response()->json(['message' => 'Unable to create .zip file'], 404); } - $nzbPath = (new NZB())->getNZBPath($request->input('id')); + $nzbPath = (new NZB)->getNZBPath($request->input('id')); if (! File::exists($nzbPath)) { return Utility::showApiError(300, 'NZB file not found!'); diff --git a/app/Http/Controllers/MyMoviesController.php b/app/Http/Controllers/MyMoviesController.php index f9c85dad7..208d8db04 100644 --- a/app/Http/Controllers/MyMoviesController.php +++ b/app/Http/Controllers/MyMoviesController.php @@ -147,7 +147,7 @@ class MyMoviesController extends BasePageController } } - $ordering = (new Releases())->getBrowseOrdering(); + $ordering = (new Releases)->getBrowseOrdering(); $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; diff --git a/app/Http/Controllers/MyShowsController.php b/app/Http/Controllers/MyShowsController.php index e9c8fab26..bdc0e58ea 100644 --- a/app/Http/Controllers/MyShowsController.php +++ b/app/Http/Controllers/MyShowsController.php @@ -175,7 +175,7 @@ class MyShowsController extends BasePageController $shows = UserSerie::getShows($this->userdata->id); - $releases = new Releases(); + $releases = new Releases; $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; $offset = ($page - 1) * config('nntmux.items_per_page'); diff --git a/app/Http/Controllers/RssController.php b/app/Http/Controllers/RssController.php index 27e693623..f23a00488 100644 --- a/app/Http/Controllers/RssController.php +++ b/app/Http/Controllers/RssController.php @@ -46,7 +46,7 @@ class RssController extends BasePageController */ public function myShowsRss(Request $request) { - $rss = new RSS(); + $rss = new RSS; $offset = 0; $user = $this->userCheck($request); if (is_object($user)) { @@ -68,7 +68,7 @@ class RssController extends BasePageController public function fullFeedRss(Request $request) { $this->setPreferences(); - $rss = new RSS(); + $rss = new RSS; $offset = 0; $user = $this->userCheck($request); if (is_object($user)) { @@ -94,7 +94,7 @@ class RssController extends BasePageController public function showRssDesc(): void { $this->setPreferences(); - $rss = new RSS(); + $rss = new RSS; $title = 'Rss Info'; $meta_title = 'Rss Nzb Info'; @@ -137,7 +137,7 @@ class RssController extends BasePageController */ public function cartRss(Request $request): JsonResponse|array { - $rss = new RSS(); + $rss = new RSS; $offset = 0; $user = $this->userCheck($request); if (is_object($user)) { @@ -163,7 +163,7 @@ class RssController extends BasePageController */ public function categoryFeedRss(Request $request): JsonResponse|array { - $rss = new RSS(); + $rss = new RSS; $offset = 0; if ($request->missing('id')) { return response()->json(['error' => 'Category ID is missing'], '403'); diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 20caab610..427e71eb5 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -15,7 +15,7 @@ class SearchController extends BasePageController public function search(Request $request): void { $this->setPreferences(); - $releases = new Releases(); + $releases = new Releases; $meta_title = 'Search Nzbs'; $meta_keywords = 'search,nzb,description,details'; diff --git a/app/Http/Controllers/SeriesController.php b/app/Http/Controllers/SeriesController.php index b47172975..53675c609 100644 --- a/app/Http/Controllers/SeriesController.php +++ b/app/Http/Controllers/SeriesController.php @@ -16,7 +16,7 @@ class SeriesController extends BasePageController public function index(Request $request, string $id = ''): void { $this->setPreferences(); - $releases = new Releases(); + $releases = new Releases; $title = 'Series'; $meta_title = 'View TV Series'; $meta_keywords = 'view,series,tv,show,description,details'; diff --git a/app/Models/Predb.php b/app/Models/Predb.php index 992426552..5fdcba567 100644 --- a/app/Models/Predb.php +++ b/app/Models/Predb.php @@ -108,11 +108,11 @@ class Predb extends Model */ public static function checkPre(bool|int|string $dateLimit = false): void { - $consoleTools = new ConsoleTools(); + $consoleTools = new ConsoleTools; $updated = 0; if (config('nntmux.echocli')) { - (new ColorCLI())->header('Querying DB for release search names not matched with PreDB titles.'); + (new ColorCLI)->header('Querying DB for release search names not matched with PreDB titles.'); } $query = self::query() @@ -127,7 +127,7 @@ class Predb extends Model if ($res !== null) { $total = \count($res); - (new ColorCLI())->primary(number_format($total).' releases to match.'); + (new ColorCLI)->primary(number_format($total).' releases to match.'); foreach ($res as $row) { Release::query()->where('id', $row['releases_id'])->update(['predb_id' => $row['predb_id']]); @@ -143,7 +143,7 @@ class Predb extends Model } if (config('nntmux.echocli')) { - (new ColorCLI())->header( + (new ColorCLI)->header( 'Matched '.number_format(($updated > 0) ? $updated : 0).' PreDB titles to release search names.' ); } @@ -198,9 +198,9 @@ class Predb extends Model $sql = self::query()->leftJoin('releases', 'releases.predb_id', '=', 'predb.id')->orderByDesc('predb.predate'); if (! empty($search)) { if (config('nntmux.elasticsearch_enabled') === true) { - $ids = (new ElasticSearchSiteSearch())->predbIndexSearch($search); + $ids = (new ElasticSearchSiteSearch)->predbIndexSearch($search); } else { - $manticore = new ManticoreSearch(); + $manticore = new ManticoreSearch; $ids = Arr::get($manticore->searchIndexes('predb_rt', $search, ['title']), 'id'); } $sql->whereIn('predb.id', $ids); diff --git a/app/Models/Release.php b/app/Models/Release.php index d0d5ba6f0..4e224f221 100644 --- a/app/Models/Release.php +++ b/app/Models/Release.php @@ -261,9 +261,9 @@ class Release extends Model ); if (config('nntmux.elasticsearch_enabled') === true) { - (new ElasticSearchSiteSearch())->insertRelease($parameters); + (new ElasticSearchSiteSearch)->insertRelease($parameters); } else { - (new ManticoreSearch())->insertRelease($parameters); + (new ManticoreSearch)->insertRelease($parameters); } return $parameters['id']; @@ -298,9 +298,9 @@ class Release extends Model ); if (config('nntmux.elasticsearch_enabled') === true) { - (new ElasticSearchSiteSearch())->updateRelease($id); + (new ElasticSearchSiteSearch)->updateRelease($id); } else { - (new ManticoreSearch())->updateRelease($id); + (new ManticoreSearch)->updateRelease($id); } } @@ -528,9 +528,9 @@ class Release extends Model if (! empty($similar)) { if (config('nntmux.elasticsearch_enabled') === true) { - $searchResult = (new ElasticSearchSiteSearch())->indexSearch($similar[1], 10); + $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10); } else { - $searchResult = (new ManticoreSearch())->searchIndexes('releases_rt', $similar[1]); + $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]); if (! empty($searchResult)) { $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); } diff --git a/app/Models/ReleaseFile.php b/app/Models/ReleaseFile.php index 0161de2e4..ae59716c1 100644 --- a/app/Models/ReleaseFile.php +++ b/app/Models/ReleaseFile.php @@ -125,9 +125,9 @@ class ReleaseFile extends Model ParHash::insertOrIgnore(['releases_id' => $id, 'hash' => $hash]); } if (config('nntmux.elasticsearch_enabled') === true) { - (new ElasticSearchSiteSearch())->updateRelease($id); + (new ElasticSearchSiteSearch)->updateRelease($id); } else { - (new ManticoreSearch())->updateRelease($id); + (new ManticoreSearch)->updateRelease($id); } } diff --git a/app/Models/UsenetGroup.php b/app/Models/UsenetGroup.php index 4d9420157..2ce6bd091 100644 --- a/app/Models/UsenetGroup.php +++ b/app/Models/UsenetGroup.php @@ -391,9 +391,9 @@ class UsenetGroup extends Model $res->get(); - $releases = new Releases(); - $nzb = new NZB(); - $releaseImage = new ReleaseImage(); + $releases = new Releases; + $nzb = new NZB; + $releaseImage = new ReleaseImage; foreach ($res as $row) { $releases->deleteSingle( [ @@ -484,6 +484,6 @@ class UsenetGroup extends Model public static function disableIfNotExist(int $id): void { self::updateGroupStatus($id, 'active'); - (new ColorCLI())->error('Group does not exist on server, disabling'); + (new ColorCLI)->error('Group does not exist on server, disabling'); } } diff --git a/misc/testing/DB/mark_as_passworded.php b/misc/testing/DB/mark_as_passworded.php index ab40129ee..12ee8f70a 100644 --- a/misc/testing/DB/mark_as_passworded.php +++ b/misc/testing/DB/mark_as_passworded.php @@ -22,4 +22,4 @@ if ($passFiles->isNotEmpty()) { } } } -(new ColorCLI())->info($count2.' releases marked as passworded'); +(new ColorCLI)->info($count2.' releases marked as passworded'); diff --git a/misc/testing/DB/reset_postprocessing.php b/misc/testing/DB/reset_postprocessing.php index c7a57c168..a62cd23a0 100755 --- a/misc/testing/DB/reset_postprocessing.php +++ b/misc/testing/DB/reset_postprocessing.php @@ -7,8 +7,8 @@ use Blacklight\ColorCLI; use Blacklight\ConsoleTools; use Illuminate\Support\Facades\DB; -$consoletools = new ConsoleTools(); -$colorCli = new ColorCLI(); +$consoletools = new ConsoleTools; +$colorCli = new ColorCLI; $ran = false; if (isset($argv[1]) && $argv[1] === 'all' && isset($argv[2]) && $argv[2] === 'true') { diff --git a/misc/testing/Dev/clean_nzbs.php b/misc/testing/Dev/clean_nzbs.php index 776f1a093..1099a31f4 100644 --- a/misc/testing/Dev/clean_nzbs.php +++ b/misc/testing/Dev/clean_nzbs.php @@ -12,7 +12,7 @@ use Blacklight\utility\Utility; use Illuminate\Support\Facades\File; $dir = resource_path().'/movednzbs/'; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if (! isset($argv[1]) || ! in_array($argv[1], ['true', 'move'])) { $colorCli->error("This script can remove all nzbs not found in the db and all releases with no nzbs found. It can also move invalid nzbs.\n\n" @@ -25,9 +25,9 @@ if (! File::isDirectory($dir) && ! File::makeDirectory($dir)) { exit("ERROR: Could not create folder [$dir].".PHP_EOL); } -$releases = new Releases(); -$nzb = new NZB(); -$releaseImage = new ReleaseImage(); +$releases = new Releases; +$nzb = new NZB; +$releaseImage = new ReleaseImage; $timestart = now()->toRfc2822String(); $checked = $moved = 0; diff --git a/misc/testing/Dev/test-ReleaseCleaner.php b/misc/testing/Dev/test-ReleaseCleaner.php index 402785e8e..ca7813d6a 100755 --- a/misc/testing/Dev/test-ReleaseCleaner.php +++ b/misc/testing/Dev/test-ReleaseCleaner.php @@ -51,8 +51,8 @@ if (\count($releases) === 0) { exit('No releases found in your database for group '.$argv[1].PHP_EOL); } -$releaseCleaner = new ReleaseCleaning(); -$manticore = new ManticoreSearch(); +$releaseCleaner = new ReleaseCleaning; +$manticore = new ManticoreSearch; foreach ($releases as $release) { echo '.'; diff --git a/misc/testing/NZB/nzb-reorg.php b/misc/testing/NZB/nzb-reorg.php index 7a3d5a2b1..f7074fe26 100755 --- a/misc/testing/NZB/nzb-reorg.php +++ b/misc/testing/NZB/nzb-reorg.php @@ -10,8 +10,8 @@ if (! isset($argv[1]) || ! isset($argv[2])) { exit("ERROR: You must supply the level you want to reorganize it to, and the source directory (You would use: 3 .../newznab/resources/nzb/ to move it to 3 levels deep)\n"); } -$nzb = new NZB(); -$consoleTools = new ConsoleTools(); +$nzb = new NZB; +$consoleTools = new ConsoleTools; $newLevel = $argv[1]; $sourcePath = $argv[2]; diff --git a/misc/testing/PostProc/check_covers.php b/misc/testing/PostProc/check_covers.php index e9fda65a9..502ca6a72 100644 --- a/misc/testing/PostProc/check_covers.php +++ b/misc/testing/PostProc/check_covers.php @@ -10,7 +10,7 @@ use Blacklight\Movie; use Illuminate\Support\Facades\DB; $movie = new Movie(['Echo' => true]); -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; $path2cover = storage_path('covers/movies/'); diff --git a/misc/testing/PostProc/check_previews.php b/misc/testing/PostProc/check_previews.php index 764185a2c..b172174d2 100644 --- a/misc/testing/PostProc/check_previews.php +++ b/misc/testing/PostProc/check_previews.php @@ -14,15 +14,15 @@ use Blacklight\Releases; use Illuminate\Support\Facades\DB; $pdo = DB::connection()->getPdo(); -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; $path2preview = storage_path('covers/preview'); if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) { - $releases = new Releases(); - $nzb = new NZB(); - $releaseImage = new ReleaseImage(); - $consoletools = new ConsoleTools(); + $releases = new Releases; + $nzb = new NZB; + $releaseImage = new ReleaseImage; + $consoletools = new ConsoleTools; $couldbe = $argv[1] === 'true' ? $couldbe = 'were ' : 'could be '; $limit = $counterfixed = 0; if (isset($argv[2]) && is_numeric($argv[2])) { diff --git a/misc/testing/PostProc/getConsole.php b/misc/testing/PostProc/getConsole.php index d64f93c58..6089a414d 100644 --- a/misc/testing/PostProc/getConsole.php +++ b/misc/testing/PostProc/getConsole.php @@ -11,7 +11,7 @@ use Illuminate\Support\Facades\DB; $pdo = DB::connection()->getPdo(); $console = new Console(['Echo' => true]); -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; $res = $pdo->query( sprintf( diff --git a/misc/testing/PostProc/getGameCovers.php b/misc/testing/PostProc/getGameCovers.php index 9a7eafb44..bd8c7883b 100644 --- a/misc/testing/PostProc/getGameCovers.php +++ b/misc/testing/PostProc/getGameCovers.php @@ -10,7 +10,7 @@ use Illuminate\Support\Facades\DB; $pdo = DB::connection()->getPdo(); $game = new Games(['Echo' => true]); -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; $res = $pdo->query( sprintf('SELECT id, title FROM gamesinfo WHERE cover = 0 ORDER BY id DESC LIMIT 100') diff --git a/misc/testing/PostProc/getImdb.php b/misc/testing/PostProc/getImdb.php index fe7963c39..dff5d8bea 100644 --- a/misc/testing/PostProc/getImdb.php +++ b/misc/testing/PostProc/getImdb.php @@ -9,7 +9,7 @@ use Illuminate\Support\Facades\DB; $pdo = DB::connection()->getPdo(); $movie = new Movie(['Echo' => true]); -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; $movies = $pdo->query('SELECT imdbid FROM movieinfo WHERE tmdbid = 0 ORDER BY id ASC'); if ($movies instanceof Traversable) { diff --git a/misc/testing/PostProc/getMovieCovers.php b/misc/testing/PostProc/getMovieCovers.php index a0fca34ca..81995b6c0 100644 --- a/misc/testing/PostProc/getMovieCovers.php +++ b/misc/testing/PostProc/getMovieCovers.php @@ -8,7 +8,7 @@ use Blacklight\ColorCLI; use Blacklight\Movie; $movie = new Movie(['Echo' => true]); -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; $movies = MovieInfo::query()->where('cover', '=', 0)->orderBy('year')->orderByDesc('id')->get(['imdbid']); $count = $movies->count(); diff --git a/misc/testing/PostProc/getTraktData.php b/misc/testing/PostProc/getTraktData.php index c71a62b5f..f9756ae9e 100644 --- a/misc/testing/PostProc/getTraktData.php +++ b/misc/testing/PostProc/getTraktData.php @@ -9,7 +9,7 @@ use Blacklight\Movie; use Blacklight\processing\tv\TraktTv; $movie = new Movie(['Echo' => true]); -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; $movies = MovieInfo::query()->where('imdbid', '<>', 0)->where('traktid', '=', 0)->get(['imdbid']); $count = $movies->count(); diff --git a/misc/testing/PostProc/getXXXCovers.php b/misc/testing/PostProc/getXXXCovers.php index b5efeecbc..a5c496958 100644 --- a/misc/testing/PostProc/getXXXCovers.php +++ b/misc/testing/PostProc/getXXXCovers.php @@ -7,8 +7,8 @@ use Blacklight\ColorCLI; use Blacklight\XXX; use Illuminate\Support\Facades\DB; -$movie = new XXX(); -$c = new ColorCLI(); +$movie = new XXX; +$c = new ColorCLI; $movies = DB::select('SELECT title FROM xxxinfo WHERE cover = 0'); diff --git a/misc/testing/PostProc/getXXXSamples.php b/misc/testing/PostProc/getXXXSamples.php index 252dd4a7f..3fac13351 100644 --- a/misc/testing/PostProc/getXXXSamples.php +++ b/misc/testing/PostProc/getXXXSamples.php @@ -8,12 +8,12 @@ use Blacklight\ReleaseImage; use Illuminate\Support\Facades\DB; $pdo = DB::connection()->getPdo(); -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; $path2cover = storage_path('covers/sample/'); if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) { - $releaseImage = new ReleaseImage(); + $releaseImage = new ReleaseImage; $couldbe = $argv[1] === 'true' ? $couldbe = 'had ' : 'could have '; $limit = $counterfixed = 0; if (isset($argv[2]) && is_numeric($argv[2])) { diff --git a/misc/testing/PostProc/updateBookImages.php b/misc/testing/PostProc/updateBookImages.php index f2a0f1c19..cd01ba2d7 100644 --- a/misc/testing/PostProc/updateBookImages.php +++ b/misc/testing/PostProc/updateBookImages.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\File; require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; $covers = $updated = $deleted = 0; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if ($argc === 1 || $argv[1] !== 'true') { $colorCli->error("\nThis script will check all images in covers/book and compare to db->bookinfo.\nTo run:\nphp $argv[0] true\n"); diff --git a/misc/testing/PostProc/updateConsoleImages.php b/misc/testing/PostProc/updateConsoleImages.php index 593770c3a..0975a194e 100644 --- a/misc/testing/PostProc/updateConsoleImages.php +++ b/misc/testing/PostProc/updateConsoleImages.php @@ -7,7 +7,7 @@ use Blacklight\ColorCLI; use Illuminate\Support\Facades\File; $covers = $updated = $deleted = 0; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if ($argc === 1 || $argv[1] !== 'true') { $colorCli->error("\nThis script will check all images in covers/console and compare to db->consoleinfo.\nTo run:\nphp $argv[0] true\n"); diff --git a/misc/testing/PostProc/updateGamesImages.php b/misc/testing/PostProc/updateGamesImages.php index 8b004b33d..8a710555d 100644 --- a/misc/testing/PostProc/updateGamesImages.php +++ b/misc/testing/PostProc/updateGamesImages.php @@ -7,7 +7,7 @@ use Blacklight\ColorCLI; use Illuminate\Support\Facades\File; $covers = $updated = $deleted = 0; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; 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"); diff --git a/misc/testing/PostProc/updateMovieImages.php b/misc/testing/PostProc/updateMovieImages.php index 30d78cbe5..cebdb83a6 100644 --- a/misc/testing/PostProc/updateMovieImages.php +++ b/misc/testing/PostProc/updateMovieImages.php @@ -7,7 +7,7 @@ use Blacklight\ColorCLI; use Illuminate\Support\Facades\File; $covers = $updated = $deleted = 0; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if ($argc === 1 || $argv[1] !== 'true') { $colorCli->error("\nThis script will check all images in covers/movies and compare to db->movieinfo.\nTo run:\nphp $argv[0] true\n"); diff --git a/misc/testing/PostProc/updateMusicImages.php b/misc/testing/PostProc/updateMusicImages.php index 707683691..f867ed0c8 100644 --- a/misc/testing/PostProc/updateMusicImages.php +++ b/misc/testing/PostProc/updateMusicImages.php @@ -7,7 +7,7 @@ use Blacklight\ColorCLI; use Illuminate\Support\Facades\File; $covers = $updated = $deleted = 0; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if ($argc === 1 || $argv[1] !== 'true') { $colorCli->error("\nThis script will check all images in covers/music and compare to db->musicinfo.\nTo run:\nphp $argv[0] true\n"); diff --git a/misc/testing/PostProc/updateXXXImages.php b/misc/testing/PostProc/updateXXXImages.php index 8037db28e..bc61646ae 100644 --- a/misc/testing/PostProc/updateXXXImages.php +++ b/misc/testing/PostProc/updateXXXImages.php @@ -7,7 +7,7 @@ use Blacklight\ColorCLI; use Illuminate\Support\Facades\File; $covers = $updated = $deleted = 0; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if ($argc === 1 || $argv[1] !== 'true') { $colorCli->error("\nThis script will check all images in covers/xxx and compare to db->xxxinfo.\nTo run:\nphp $argv[0] true\n"); diff --git a/misc/testing/Releases/delete_releases.php b/misc/testing/Releases/delete_releases.php index ea8ce5a45..48a997d65 100644 --- a/misc/testing/Releases/delete_releases.php +++ b/misc/testing/Releases/delete_releases.php @@ -11,7 +11,7 @@ $n = PHP_EOL; // Include config.php // ColorCLI class. -$cli = new ColorCLI(); +$cli = new ColorCLI; // Print arguments/usage. $totalArgs = count($argv); @@ -52,6 +52,6 @@ if ($totalArgs < 2) { )); } -$RR = new ReleaseRemover(); +$RR = new ReleaseRemover; // Remove argv[0] and send the array. $RR->removeByCriteria(array_slice($argv, 1, $totalArgs - 1)); diff --git a/misc/testing/Releases/fixReleaseNames.php b/misc/testing/Releases/fixReleaseNames.php index 36be0d942..f9737b7c2 100755 --- a/misc/testing/Releases/fixReleaseNames.php +++ b/misc/testing/Releases/fixReleaseNames.php @@ -14,9 +14,9 @@ use Blacklight\ColorCLI; use Blacklight\NameFixer; use Blacklight\NNTP; -$nameFixer = new NameFixer(); -$colorCli = new ColorCLI(); -$nntp = new NNTP(); +$nameFixer = new NameFixer; +$colorCli = new ColorCLI; +$nntp = new NNTP; if (isset($argv[1], $argv[2], $argv[3], $argv[4])) { $update = $argv[2] === 'true'; diff --git a/misc/testing/Releases/recategorize.php b/misc/testing/Releases/recategorize.php index 91a82f116..d193f262b 100644 --- a/misc/testing/Releases/recategorize.php +++ b/misc/testing/Releases/recategorize.php @@ -8,7 +8,7 @@ use Blacklight\Categorize; use Blacklight\ColorCLI; use Blacklight\ConsoleTools; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if (! (isset($argv[1]) && ($argv[1] === 'all' || $argv[1] === 'misc' || preg_match('/\([\d, ]+\)/', $argv[1]) || is_numeric($argv[1])))) { $colorCli->error( @@ -28,7 +28,7 @@ reCategorize($argv); function reCategorize($argv): void { - $colorCli = new ColorCLI(); + $colorCli = new ColorCLI; if (isset($argv[1]) && (is_numeric($argv[1]) || preg_match('/\([\d, ]+\)/', $argv[1]))) { $colorCli->header('Categorizing all releases in '.$argv[1].' using searchname. This can take a while, be patient.'); @@ -63,13 +63,13 @@ function categorizeRelease($argv, $echoOutput = false): int $update = false; } $total = $query->count(); - $colorCli = new ColorCLI(); + $colorCli = new ColorCLI; $colorCli->header('Categorizing ['.$total.'] releases. This can take a while, be patient.'); - $consoleTools = new ConsoleTools(); + $consoleTools = new ConsoleTools; $relCount = $chgCount = 0; if ($total > 0) { $query->chunk('100', function ($results) use ($update, $relCount, $chgCount) { - $cat = new Categorize(); + $cat = new Categorize; foreach ($results as $result) { $catId = $cat->determineCategory($result->groups_id, $result->searchname, $result->fromname); if ((int) $result->categories_id !== (int) $catId['categories_id']) { diff --git a/misc/testing/Releases/removeCrapReleases.php b/misc/testing/Releases/removeCrapReleases.php index d19505f6c..0d80bf4a4 100755 --- a/misc/testing/Releases/removeCrapReleases.php +++ b/misc/testing/Releases/removeCrapReleases.php @@ -6,7 +6,7 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\ColorCLI; use Blacklight\ReleaseRemover; -$cli = new ColorCLI(); +$cli = new ColorCLI; $n = PHP_EOL; @@ -66,5 +66,5 @@ if (isset($argv[3]) && $argv[3] === 'blacklist' && isset($argv[4])) { $blacklistID = $argv[4]; } -$RR = new ReleaseRemover(); +$RR = new ReleaseRemover; $RR->removeCrap($argv[1] === 'true' ? true : false, $argv[2], $argv[3] ?? '', isset($blacklistID) ? $argv[4] : ''); diff --git a/misc/testing/Tests/test_fanarttv_API.php b/misc/testing/Tests/test_fanarttv_API.php index 7e3a575a0..3d59f4fc1 100644 --- a/misc/testing/Tests/test_fanarttv_API.php +++ b/misc/testing/Tests/test_fanarttv_API.php @@ -6,7 +6,7 @@ use Blacklight\ColorCLI; use Blacklight\libraries\FanartTV; $fanart = new FanartTV(config('nntmux_api.fanarttv_api_key')); -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if (! empty($argv[1])) { // Test if you can fetch Fanart.TV images diff --git a/misc/testing/Tests/test_omdb_API.php b/misc/testing/Tests/test_omdb_API.php index 567c7dbba..16a350307 100644 --- a/misc/testing/Tests/test_omdb_API.php +++ b/misc/testing/Tests/test_omdb_API.php @@ -6,7 +6,7 @@ use aharen\OMDbAPI; use Blacklight\ColorCLI; $omdb = new OMDbAPI(config('nntmux_api.omdb_api_key')); -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if (! empty($argv[1]) && ! empty($argv[2]) && ($argv[2] !== 'series' || $argv[2] !== 'movie')) { // Test if your OMDb API key and configuration are working diff --git a/misc/testing/Tests/test_tmdb_API.php b/misc/testing/Tests/test_tmdb_API.php index 6c6b48bf2..6c25c137e 100755 --- a/misc/testing/Tests/test_tmdb_API.php +++ b/misc/testing/Tests/test_tmdb_API.php @@ -5,7 +5,7 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\ColorCLI; use Tmdb\Laravel\Facades\Tmdb; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) { // Test if your TMDB API configuration is working diff --git a/misc/testing/Tests/test_trakt_API.php b/misc/testing/Tests/test_trakt_API.php index 1123cb69e..5b5fe20f1 100755 --- a/misc/testing/Tests/test_trakt_API.php +++ b/misc/testing/Tests/test_trakt_API.php @@ -4,8 +4,8 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\processing\tv\TraktTv; -$c = new Blacklight\ColorCLI(); -$trakt = new TraktTv(); +$c = new Blacklight\ColorCLI; +$trakt = new TraktTv; if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) { // Test if your Trakt API key and configuration are working diff --git a/misc/testing/Tests/test_tvdb_API.php b/misc/testing/Tests/test_tvdb_API.php index 0a5688d59..5631378aa 100755 --- a/misc/testing/Tests/test_tvdb_API.php +++ b/misc/testing/Tests/test_tvdb_API.php @@ -4,8 +4,8 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\processing\tv\TVDB; -$c = new Blacklight\ColorCLI(); -$tvDB = new TVDB(); +$c = new Blacklight\ColorCLI; +$tvDB = new TVDB; if (! empty($argv[1]) && isset($argv[2], $argv[3]) && is_numeric($argv[2]) && is_numeric($argv[3])) { // Test if your TvDB API key and configuration are working diff --git a/misc/testing/Tests/test_tvmaze_API.php b/misc/testing/Tests/test_tvmaze_API.php index c9e7f6120..f359fffc7 100755 --- a/misc/testing/Tests/test_tvmaze_API.php +++ b/misc/testing/Tests/test_tvmaze_API.php @@ -4,8 +4,8 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\processing\tv\TVMaze; -$c = new Blacklight\ColorCLI(); -$tvmaze = new TVMaze(); +$c = new Blacklight\ColorCLI; +$tvmaze = new TVMaze; if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) { // Test if your TVMaze API configuration is working diff --git a/misc/testing/nzb-export.php b/misc/testing/nzb-export.php index c84f35790..10b9121a7 100644 --- a/misc/testing/nzb-export.php +++ b/misc/testing/nzb-export.php @@ -23,7 +23,7 @@ if (count($argv) !== 6) { ); } -$NE = new NZBExport(); +$NE = new NZBExport; $NE->beginExport( [ // Path. diff --git a/misc/testing/nzb-import.php b/misc/testing/nzb-import.php index 00fd5b49c..f2b6669b2 100644 --- a/misc/testing/nzb-import.php +++ b/misc/testing/nzb-import.php @@ -75,7 +75,7 @@ if ($i > 1) { $useNzbName = ($argv[4] === 'true'); // Create a new instance of NZBImport and send it the file locations. - $NZBImport = new NZBImport(); + $NZBImport = new NZBImport; $NZBImport->beginImport($nzbFiles, $useNzbName, $deleteNZB, $deleteFailedNZB); } else { diff --git a/misc/testing/resend_activation_email.php b/misc/testing/resend_activation_email.php index f00c95167..a1b670eb0 100644 --- a/misc/testing/resend_activation_email.php +++ b/misc/testing/resend_activation_email.php @@ -6,7 +6,7 @@ use Jrean\UserVerification\Facades\UserVerification; require_once dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if (isset($argv[1]) && is_numeric($argv[1])) { $user = User::find($argv[1]); diff --git a/misc/update/backfill.php b/misc/update/backfill.php index 24ef51fcf..c14eb58c6 100644 --- a/misc/update/backfill.php +++ b/misc/update/backfill.php @@ -6,7 +6,7 @@ use Blacklight\Backfill; use Blacklight\NNTP; // Create the connection here and pass -$nntp = new NNTP(); +$nntp = new NNTP; if (isset($argv[1]) && $argv[1] === 'all' && ! isset($argv[2])) { $backfill = new Backfill(['NNTP' => $nntp]); @@ -27,7 +27,7 @@ if (isset($argv[1]) && $argv[1] === 'all' && ! isset($argv[2])) { $backfill = new Backfill(['NNTP' => $nntp]); $backfill->safeBackfill($argv[2]); } else { - exit((new Blacklight\ColorCLI())->error('Wrong set of arguments.' + exit((new Blacklight\ColorCLI)->error('Wrong set of arguments.' .'php backfill.php safe 200000 ...: Backfill an active group alphabetically, x articles, the script stops,' .' ...: if the group has reached reached 2012-06-24, the next group will backfill.' .'php backfill.php alph 200000 ...: Backfills all groups (sorted alphabetically) by number of articles' diff --git a/misc/update/match_prefiles.php b/misc/update/match_prefiles.php index 2e40784c8..533fc12d4 100755 --- a/misc/update/match_prefiles.php +++ b/misc/update/match_prefiles.php @@ -7,7 +7,7 @@ use Blacklight\NameFixer; if (empty($argv[1]) && ($argv[1] !== 'full' || ! is_numeric($argv[1]))) { exit( - (new ColorCLI())->error( + (new ColorCLI)->error( PHP_EOL .'This script tries to match release filenames to PreDB filenames.'.PHP_EOL .'To display the changes, use "show" as the second argument. The optional third argument will limit the amount of filenames to attempt to match.'.PHP_EOL.PHP_EOL @@ -18,7 +18,7 @@ if (empty($argv[1]) && ($argv[1] !== 'full' || ! is_numeric($argv[1]))) { } try { - $nameFixer = new NameFixer(); + $nameFixer = new NameFixer; } catch (Exception $e) { echo $e->getMessage(); } diff --git a/misc/update/multiprocessing/backfill.php b/misc/update/multiprocessing/backfill.php index d043c138c..0164766fd 100644 --- a/misc/update/multiprocessing/backfill.php +++ b/misc/update/multiprocessing/backfill.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\Log; // Check if argument 1 is numeric, which is to limit article count. try { - (new Forking())->processWorkType('backfill', (isset($argv[1]) && is_numeric($argv[1]) && $argv[1] > 0 ? [0 => $argv[1]] : [0 => false])); + (new Forking)->processWorkType('backfill', (isset($argv[1]) && is_numeric($argv[1]) && $argv[1] > 0 ? [0 => $argv[1]] : [0 => false])); } catch (Exception $e) { Log::error($e->getTraceAsString()); echo $e->getMessage(); diff --git a/misc/update/multiprocessing/binaries.php b/misc/update/multiprocessing/binaries.php index 7291b894d..f79cfefe8 100644 --- a/misc/update/multiprocessing/binaries.php +++ b/misc/update/multiprocessing/binaries.php @@ -9,7 +9,7 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\libraries\Forking; try { - (new Forking())->processWorkType('binaries', [0 => $argv[1]]); + (new Forking)->processWorkType('binaries', [0 => $argv[1]]); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/misc/update/multiprocessing/fixrelnames.php b/misc/update/multiprocessing/fixrelnames.php index 9bf53dddd..6c1b1f29a 100644 --- a/misc/update/multiprocessing/fixrelnames.php +++ b/misc/update/multiprocessing/fixrelnames.php @@ -13,7 +13,7 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\libraries\Forking; try { - (new Forking())->processWorkType('fixRelNames_'.$argv[1], [0 => $argv[1]]); + (new Forking)->processWorkType('fixRelNames_'.$argv[1], [0 => $argv[1]]); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/misc/update/multiprocessing/import.php b/misc/update/multiprocessing/import.php index 1c2ac3ae5..f858d42ef 100644 --- a/misc/update/multiprocessing/import.php +++ b/misc/update/multiprocessing/import.php @@ -24,7 +24,7 @@ if (! isset($argv[1]) || ! is_dir($argv[1])) { ); } -(new ForkingImportNZB())->start( +(new ForkingImportNZB)->start( $argv[1], (isset($argv[2]) && is_numeric($argv[2]) && $argv[2] > 0 ? $argv[2] : 1), (isset($argv[3]) && $argv[3] === 'true' ? 'true' : 'false'), diff --git a/misc/update/multiprocessing/postprocess.php b/misc/update/multiprocessing/postprocess.php index afb9f2b0b..4cc63ddac 100644 --- a/misc/update/multiprocessing/postprocess.php +++ b/misc/update/multiprocessing/postprocess.php @@ -19,7 +19,7 @@ if (! isset($argv[1]) || ! in_array($argv[1], ['ama', 'add', 'mov', 'nfo', 'sha' use Blacklight\libraries\Forking; try { - (new Forking())->processWorkType('postProcess_'.$argv[1], (isset($argv[2]) && $argv[2] === 'true' ? [0 => true] : [])); + (new Forking)->processWorkType('postProcess_'.$argv[1], (isset($argv[2]) && $argv[2] === 'true' ? [0 => true] : [])); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/misc/update/multiprocessing/releases.php b/misc/update/multiprocessing/releases.php index 81b999253..3f5eda189 100644 --- a/misc/update/multiprocessing/releases.php +++ b/misc/update/multiprocessing/releases.php @@ -5,7 +5,7 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\libraries\Forking; try { - (new Forking())->processWorkType('releases'); + (new Forking)->processWorkType('releases'); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/misc/update/multiprocessing/requestid.php b/misc/update/multiprocessing/requestid.php index 496cdcc58..b0ac9f284 100644 --- a/misc/update/multiprocessing/requestid.php +++ b/misc/update/multiprocessing/requestid.php @@ -5,7 +5,7 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\libraries\Forking; try { - (new Forking())->processWorkType('request_id'); + (new Forking)->processWorkType('request_id'); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/misc/update/multiprocessing/safe.php b/misc/update/multiprocessing/safe.php index 81a0caefc..4e2452e11 100644 --- a/misc/update/multiprocessing/safe.php +++ b/misc/update/multiprocessing/safe.php @@ -13,7 +13,7 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\libraries\Forking; try { - (new Forking())->processWorkType('safe_'.$argv[1]); + (new Forking)->processWorkType('safe_'.$argv[1]); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/misc/update/multiprocessing/update_per_group.php b/misc/update/multiprocessing/update_per_group.php index 42230482f..19e13c2e8 100644 --- a/misc/update/multiprocessing/update_per_group.php +++ b/misc/update/multiprocessing/update_per_group.php @@ -5,7 +5,7 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\libraries\Forking; try { - (new Forking())->processWorkType('update_per_group'); + (new Forking)->processWorkType('update_per_group'); } catch (Exception $e) { echo $e->getMessage(); } diff --git a/misc/update/postprocess.php b/misc/update/postprocess.php index 81768aa86..2aae707e2 100644 --- a/misc/update/postprocess.php +++ b/misc/update/postprocess.php @@ -36,7 +36,7 @@ $bool = [ if (! isset($argv[1], $argv[2]) || ! in_array($argv[1], $args, false) || ! in_array($argv[2], $bool, false)) { exit( - (new Blacklight\ColorCLI())->error( + (new Blacklight\ColorCLI)->error( "\nIncorrect arguments.\n" ."The second argument (true/false) determines wether to echo or not.\n\n" ."php postprocess.php all true ...: Does all the types of post processing.\n" @@ -60,7 +60,7 @@ if (! isset($argv[1], $argv[2]) || ! in_array($argv[1], $args, false) || ! in_ar $nntp = null; if ($args[$argv[1]] === true) { - $nntp = new NNTP(); + $nntp = new NNTP; if ((Settings::settingValue('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) { echo 'Unable to connect to usenet.'.PHP_EOL; exit; diff --git a/misc/update/tmux/bin/groupfixrelnames.php b/misc/update/tmux/bin/groupfixrelnames.php index 3fac3ffe5..b5c5056ce 100644 --- a/misc/update/tmux/bin/groupfixrelnames.php +++ b/misc/update/tmux/bin/groupfixrelnames.php @@ -15,12 +15,12 @@ use Blacklight\NZBContents; use Blacklight\processing\PostProcess; use Illuminate\Support\Facades\DB; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; if (! isset($argv[1])) { $colorCli->error('This script is not intended to be run manually, it is called from Multiprocessing.'); exit(); } -$nameFixer = new NameFixer(); +$nameFixer = new NameFixer; [$type, $guidChar, $maxPerRun, $thread] = explode(' ', $argv[1]); switch (true) { @@ -191,11 +191,11 @@ switch (true) { if ((int) $release->proc_par2 === NameFixer::PROC_PAR2_NONE) { $colorCli->primaryOver('p'); if (! isset($nzbcontents)) { - $nntp = new NNTP(); + $nntp = new NNTP; if (((int) Settings::settingValue('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) { $colorCli->error('Unable to connect to usenet.'); } - $Nfo = new Nfo(); + $Nfo = new Nfo; $nzbcontents = new NZBContents([ 'Echo' => true, 'NNTP' => $nntp, diff --git a/misc/update/tmux/bin/showsleep.php b/misc/update/tmux/bin/showsleep.php index ced9c3ce4..f32e5a34e 100644 --- a/misc/update/tmux/bin/showsleep.php +++ b/misc/update/tmux/bin/showsleep.php @@ -5,7 +5,7 @@ require_once dirname(__DIR__, 4).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\ConsoleTools; // This script is simply so I can show sleep progress in bash script -$consoletools = new ConsoleTools(); +$consoletools = new ConsoleTools; if (isset($argv[1]) && is_numeric($argv[1])) { $consoletools->showsleep($argv[1]); } diff --git a/misc/update/tmux/bin/update_groups.php b/misc/update/tmux/bin/update_groups.php index 2774ebe8e..8cf7ba9ec 100644 --- a/misc/update/tmux/bin/update_groups.php +++ b/misc/update/tmux/bin/update_groups.php @@ -11,11 +11,11 @@ use Illuminate\Support\Arr; use Illuminate\Support\Facades\DB; $start = now(); -$consoleTools = new ConsoleTools(); -$colorCli = new ColorCLI(); +$consoleTools = new ConsoleTools; +$colorCli = new ColorCLI; // Create the connection here and pass -$nntp = new NNTP(); +$nntp = new NNTP; if ($nntp->doConnect() !== true) { $colorCli->error('Unable to connect to usenet.'); exit(); diff --git a/misc/update/tmux/monitor.php b/misc/update/tmux/monitor.php index c4124d255..a7ca71ce2 100644 --- a/misc/update/tmux/monitor.php +++ b/misc/update/tmux/monitor.php @@ -13,15 +13,15 @@ use Illuminate\Support\Arr; use Illuminate\Support\Facades\DB; $pdo = DB::connection()->getPdo(); -$tMain = new Tmux(); -$colorCli = new ColorCLI(); +$tMain = new Tmux; +$colorCli = new ColorCLI; try { - $tRun = new TmuxRun(); + $tRun = new TmuxRun; } catch (Exception $e) { echo $e; } try { - $tOut = new TmuxOutput(); + $tOut = new TmuxOutput; } catch (Exception $e) { echo $e; } @@ -400,7 +400,7 @@ while ($runVar['counts']['iterations'] > 0) { function errorOnSQL() { - (new ColorCLI())->error(PHP_EOL.'Monitor encountered severe errors retrieving process data from MySQL. Please diagnose and try running again.'.PHP_EOL); + (new ColorCLI)->error(PHP_EOL.'Monitor encountered severe errors retrieving process data from MySQL. Please diagnose and try running again.'.PHP_EOL); } /** diff --git a/misc/update/tmux/run.php b/misc/update/tmux/run.php index 26da7c7f6..2ed8403b7 100644 --- a/misc/update/tmux/run.php +++ b/misc/update/tmux/run.php @@ -14,7 +14,7 @@ $tmux_session = Settings::settingValue('site.tmux.tmux_session') ?? 0; $seq = Settings::settingValue('site.tmux.sequential') ?? 0; $delaytime = Settings::settingValue('..delaytime'); $delaytime = $delaytime ? (int) $delaytime : 2; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; Process::run('clear'); diff --git a/misc/update/update_binaries.php b/misc/update/update_binaries.php index b167f3895..a8475c91e 100644 --- a/misc/update/update_binaries.php +++ b/misc/update/update_binaries.php @@ -9,10 +9,10 @@ use Blacklight\ColorCLI; use Blacklight\NNTP; $maxHeaders = (int) Settings::settingValue('..max_headers_iteration') ?: 1000000; -$colorCli = new ColorCLI(); +$colorCli = new ColorCLI; // Create the connection here and pass -$nntp = new NNTP(); +$nntp = new NNTP; if ($nntp->doConnect() !== true) { $colorCli->error('Unable to connect to usenet.'); exit(); diff --git a/routes/console.php b/routes/console.php index ccc7b2058..1febec52c 100644 --- a/routes/console.php +++ b/routes/console.php @@ -29,5 +29,5 @@ Schedule::command('horizon:snapshot')->everyFiveMinutes()->withoutOverlapping(); Schedule::command('cloudflare:reload')->daily(); Schedule::command('cache:prune-stale-tags')->hourly(); if (config('nntmux.purge_inactive_users') === true) { - Schedule::job(new RemoveInactiveAccounts())->daily(); + Schedule::job(new RemoveInactiveAccounts)->daily(); }