From f55403ba2d95b4c46f6f809eaadfd9075bca2a86 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 8 Jan 2024 19:00:14 +0100 Subject: [PATCH] Update packages --- Blacklight/NZB.php | 3 --- Blacklight/NameFixer.php | 10 ---------- app/Extensions/helper/helpers.php | 2 +- config/backup.php | 20 +++++++++---------- config/geoip.php | 12 +++++------ config/google2fa.php | 2 +- config/laravel-directory-cleanup.php | 2 +- ...45_update_users_table_with_name_column.php | 2 +- misc/testing/DB/move_tmux_to_settings.php | 4 ++-- misc/testing/Dev/clean_nzbs.php | 4 ++-- misc/testing/NZB/nzb-reorg.php | 2 +- misc/testing/PostProc/getConsole.php | 2 +- misc/testing/PostProc/getImdb.php | 2 +- misc/testing/Releases/recategorize.php | 2 +- misc/testing/Tests/test_tvdb_API.php | 6 +++--- misc/testing/nzb-import.php | 8 ++++---- misc/update/backfill.php | 2 +- misc/update/postprocess.php | 2 +- misc/update/update_binaries.php | 4 ++-- routes/web.php | 1 - 20 files changed, 39 insertions(+), 53 deletions(-) diff --git a/Blacklight/NZB.php b/Blacklight/NZB.php index 81a608d4c..b1de51644 100755 --- a/Blacklight/NZB.php +++ b/Blacklight/NZB.php @@ -259,9 +259,6 @@ class NZB * file extensions, file sizes, file completion, group names, # of parts). * * @param string $nzb The NZB contents in a string. - * @param array $options - * 'no-file-key' => True - use numeric array key; False - Use filename as array key. - * 'strip-count' => True - Strip file/part count from file name to make the array key; False - Leave file name as is. * @return array $result Empty if not an NZB or the contents of the NZB. */ public function nzbFileList(string $nzb, array $options = []): array diff --git a/Blacklight/NameFixer.php b/Blacklight/NameFixer.php index 06cf037ea..ef939ade1 100755 --- a/Blacklight/NameFixer.php +++ b/Blacklight/NameFixer.php @@ -977,16 +977,6 @@ class NameFixer /** * Echo an updated release name to CLI. * - * @param array $data - * [ - * 'new_name' => (string) The new release search name. - * 'old_name' => (string) The old release search name. - * 'new_category' => (string) The new category name or ID for the release. - * 'old_category' => (string) The old category name or ID for the release. - * 'group' => (string) The group name or ID of the release. - * 'release_id' => (int) The ID of the release. - * 'method' => (string) The method used to rename the release. - * ] * * @static * diff --git a/app/Extensions/helper/helpers.php b/app/Extensions/helper/helpers.php index e4849500a..6495623a2 100644 --- a/app/Extensions/helper/helpers.php +++ b/app/Extensions/helper/helpers.php @@ -40,7 +40,7 @@ if (! function_exists('getRawHtml')) { Log::error($e->getMessage()); } $response = false; - } catch (\RuntimeException $e) { + } catch (RuntimeException $e) { if (config('app.debug') === true) { Log::error($e->getMessage()); } diff --git a/config/backup.php b/config/backup.php index 84423da05..156c62532 100644 --- a/config/backup.php +++ b/config/backup.php @@ -121,19 +121,19 @@ return [ 'notifications' => [ 'notifications' => [ - \Spatie\Backup\Notifications\Notifications\BackupHasFailed::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFound::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\CleanupHasFailed::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\BackupWasSuccessful::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\HealthyBackupWasFound::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\CleanupWasSuccessful::class => ['mail'], + Spatie\Backup\Notifications\Notifications\BackupHasFailed::class => ['mail'], + Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFound::class => ['mail'], + Spatie\Backup\Notifications\Notifications\CleanupHasFailed::class => ['mail'], + Spatie\Backup\Notifications\Notifications\BackupWasSuccessful::class => ['mail'], + Spatie\Backup\Notifications\Notifications\HealthyBackupWasFound::class => ['mail'], + Spatie\Backup\Notifications\Notifications\CleanupWasSuccessful::class => ['mail'], ], /* * Here you can specify the notifiable to which the notifications should be sent. The default * notifiable will use the variables specified in this config file. */ - 'notifiable' => \Spatie\Backup\Notifications\Notifiable::class, + 'notifiable' => Spatie\Backup\Notifications\Notifiable::class, 'mail' => [ 'to' => env('ADMIN_EMAIL', 'hello@example.com'), @@ -169,8 +169,8 @@ return [ 'name' => env('APP_NAME', 'laravel-backup'), 'disks' => ['local'], 'health_checks' => [ - \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1, - \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class => 5000, + Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1, + Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class => 5000, ], ], @@ -196,7 +196,7 @@ return [ * No matter how you configure it the default strategy will never * delete the newest backup. */ - 'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class, + 'strategy' => Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class, 'default_strategy' => [ diff --git a/config/geoip.php b/config/geoip.php index be9296a57..ad6764bb5 100644 --- a/config/geoip.php +++ b/config/geoip.php @@ -52,21 +52,21 @@ return [ 'services' => [ 'maxmind_database' => [ - 'class' => \Torann\GeoIP\Services\MaxMindDatabase::class, + 'class' => Torann\GeoIP\Services\MaxMindDatabase::class, 'database_path' => storage_path('app/geoip.mmdb'), 'update_url' => 'https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', 'locales' => ['en'], ], 'maxmind_api' => [ - 'class' => \Torann\GeoIP\Services\MaxMindWebService::class, + 'class' => Torann\GeoIP\Services\MaxMindWebService::class, 'user_id' => env('MAXMIND_USER_ID'), 'license_key' => env('MAXMIND_LICENSE_KEY'), 'locales' => ['en'], ], 'ipapi' => [ - 'class' => \Torann\GeoIP\Services\IPApi::class, + 'class' => Torann\GeoIP\Services\IPApi::class, 'secure' => true, 'key' => env('IPAPI_KEY'), 'continent_path' => storage_path('app/continents.json'), @@ -74,7 +74,7 @@ return [ ], 'ipgeolocation' => [ - 'class' => \Torann\GeoIP\Services\IPGeoLocation::class, + 'class' => Torann\GeoIP\Services\IPGeoLocation::class, 'secure' => true, 'key' => env('IPGEOLOCATION_KEY'), 'continent_path' => storage_path('app/continents.json'), @@ -82,13 +82,13 @@ return [ ], 'ipdata' => [ - 'class' => \Torann\GeoIP\Services\IPData::class, + 'class' => Torann\GeoIP\Services\IPData::class, 'key' => env('IPDATA_API_KEY'), 'secure' => true, ], 'ipfinder' => [ - 'class' => \Torann\GeoIP\Services\IPFinder::class, + 'class' => Torann\GeoIP\Services\IPFinder::class, 'key' => env('IPFINDER_API_KEY'), 'secure' => true, 'locales' => ['en'], diff --git a/config/google2fa.php b/config/google2fa.php index ee256cbae..6571108b8 100644 --- a/config/google2fa.php +++ b/config/google2fa.php @@ -79,6 +79,6 @@ return [ * * Supports imagemagick, svg and eps */ - 'qrcode_image_backend' => \PragmaRX\Google2FALaravel\Support\Constants::QRCODE_IMAGE_BACKEND_IMAGEMAGICK, + 'qrcode_image_backend' => PragmaRX\Google2FALaravel\Support\Constants::QRCODE_IMAGE_BACKEND_IMAGEMAGICK, ]; diff --git a/config/laravel-directory-cleanup.php b/config/laravel-directory-cleanup.php index 3f426b796..2377c2e52 100644 --- a/config/laravel-directory-cleanup.php +++ b/config/laravel-directory-cleanup.php @@ -30,5 +30,5 @@ return [ * You can customize this behaviour by writing your own clean up policy. A valid policy * is any class that implements `Spatie\DirectoryCleanup\Policies\CleanupPolicy`. */ - 'cleanup_policy' => \Spatie\DirectoryCleanup\Policies\DeleteEverything::class, + 'cleanup_policy' => Spatie\DirectoryCleanup\Policies\DeleteEverything::class, ]; diff --git a/database/migrations/2023_12_08_191845_update_users_table_with_name_column.php b/database/migrations/2023_12_08_191845_update_users_table_with_name_column.php index 2e8769e8d..563a625e3 100644 --- a/database/migrations/2023_12_08_191845_update_users_table_with_name_column.php +++ b/database/migrations/2023_12_08_191845_update_users_table_with_name_column.php @@ -14,7 +14,7 @@ return new class extends Migration Schema::table('users', function (Blueprint $table) { $table->string('name')->nullable()->after('username'); }); - \App\Models\User::query()->update(['name' => \DB::raw('username')]); + App\Models\User::query()->update(['name' => DB::raw('username')]); } /** diff --git a/misc/testing/DB/move_tmux_to_settings.php b/misc/testing/DB/move_tmux_to_settings.php index c5af85976..e3c98b349 100644 --- a/misc/testing/DB/move_tmux_to_settings.php +++ b/misc/testing/DB/move_tmux_to_settings.php @@ -2,11 +2,11 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; -$tmux = \Illuminate\Support\Facades\DB::table('tmux')->get(); +$tmux = Illuminate\Support\Facades\DB::table('tmux')->get(); foreach ($tmux as $item) { echo 'Inserting '.$item->setting.' into settings table'.PHP_EOL; - \App\Models\Settings::insertOrIgnore( + App\Models\Settings::insertOrIgnore( [ 'section' => 'site', 'subsection' => 'tmux', diff --git a/misc/testing/Dev/clean_nzbs.php b/misc/testing/Dev/clean_nzbs.php index fd284229a..0e48ff8fb 100644 --- a/misc/testing/Dev/clean_nzbs.php +++ b/misc/testing/Dev/clean_nzbs.php @@ -35,8 +35,8 @@ $couldbe = ($argv[1] === 'true') ? 'could be ' : ''; $colorCli->header('Getting List of nzbs to check against db.'); $colorCli->header("Checked / {$couldbe}moved\n"); -$dirItr = new \RecursiveDirectoryIterator(Settings::settingValue('..nzbpath')); -$itr = new \RecursiveIteratorIterator($dirItr, \RecursiveIteratorIterator::LEAVES_ONLY); +$dirItr = new RecursiveDirectoryIterator(Settings::settingValue('..nzbpath')); +$itr = new RecursiveIteratorIterator($dirItr, RecursiveIteratorIterator::LEAVES_ONLY); foreach ($itr as $filePath) { $guid = stristr($filePath->getFilename(), '.nzb.gz', true); diff --git a/misc/testing/NZB/nzb-reorg.php b/misc/testing/NZB/nzb-reorg.php index 4c1f71a1d..50a075cdf 100755 --- a/misc/testing/NZB/nzb-reorg.php +++ b/misc/testing/NZB/nzb-reorg.php @@ -14,7 +14,7 @@ $consoleTools = new ConsoleTools(); $newLevel = $argv[1]; $sourcePath = $argv[2]; -$objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($sourcePath)); +$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sourcePath)); $filestoprocess = []; $iFilesProcessed = $iFilesCounted = 0; diff --git a/misc/testing/PostProc/getConsole.php b/misc/testing/PostProc/getConsole.php index 2d113fd0e..d64f93c58 100644 --- a/misc/testing/PostProc/getConsole.php +++ b/misc/testing/PostProc/getConsole.php @@ -21,7 +21,7 @@ $res = $pdo->query( Category::GAME_OTHER ) ); -if ($res instanceof \Traversable) { +if ($res instanceof Traversable) { $colorCli->header('Updating console info for '.number_format($res->rowCount()).' releases.'); foreach ($res as $arr) { diff --git a/misc/testing/PostProc/getImdb.php b/misc/testing/PostProc/getImdb.php index 1cffa5109..fe7963c39 100644 --- a/misc/testing/PostProc/getImdb.php +++ b/misc/testing/PostProc/getImdb.php @@ -12,7 +12,7 @@ $movie = new Movie(['Echo' => true]); $colorCli = new ColorCLI(); $movies = $pdo->query('SELECT imdbid FROM movieinfo WHERE tmdbid = 0 ORDER BY id ASC'); -if ($movies instanceof \Traversable) { +if ($movies instanceof Traversable) { $count = $movies->rowCount(); if ($count > 0) { $colorCli->header('Updating movie info for '.number_format($count).' movies.'); diff --git a/misc/testing/Releases/recategorize.php b/misc/testing/Releases/recategorize.php index 737b3c88e..0e4b0fe2e 100644 --- a/misc/testing/Releases/recategorize.php +++ b/misc/testing/Releases/recategorize.php @@ -87,7 +87,7 @@ function categorizeRelease($argv, $echoOutput = false): int 'xxxinfo_id' => 0, 'categories_id' => $catId['categories_id'], ]); - \Blacklight\NameFixer::echoChangedReleaseName([ + Blacklight\NameFixer::echoChangedReleaseName([ 'new_name' => $result->searchname, 'old_name' => $result->searchname, 'new_category' => $catId['categories_id'], diff --git a/misc/testing/Tests/test_tvdb_API.php b/misc/testing/Tests/test_tvdb_API.php index e9d74782d..0a5688d59 100755 --- a/misc/testing/Tests/test_tvdb_API.php +++ b/misc/testing/Tests/test_tvdb_API.php @@ -29,13 +29,13 @@ if (! empty($argv[1]) && isset($argv[2], $argv[3]) && is_numeric($argv[2]) && is echo 'Invalid argument(s) used'.PHP_EOL; return false; - } catch (\CanIHaveSomeCoffee\TheTVDbAPI\Exception\ParseException $error) { + } catch (CanIHaveSomeCoffee\TheTVDbAPI\Exception\ParseException $error) { if (str_starts_with($error->getMessage(), 'Could not decode JSON data') || str_starts_with($error->getMessage(), 'Incorrect data structure')) { return false; } - } catch (\CanIHaveSomeCoffee\TheTVDbAPI\Exception\ResourceNotFoundException $error) { + } catch (CanIHaveSomeCoffee\TheTVDbAPI\Exception\ResourceNotFoundException $error) { return false; - } catch (\CanIHaveSomeCoffee\TheTVDbAPI\Exception\UnauthorizedException $error) { + } catch (CanIHaveSomeCoffee\TheTVDbAPI\Exception\UnauthorizedException $error) { if (str_starts_with($error->getMessage(), 'Unauthorized')) { return false; } diff --git a/misc/testing/nzb-import.php b/misc/testing/nzb-import.php index 0b399c2fd..7754b7b64 100644 --- a/misc/testing/nzb-import.php +++ b/misc/testing/nzb-import.php @@ -48,12 +48,12 @@ if (! Str::endsWith($path, '/')) { $path .= '/'; } -$files = new \RegexIterator( - new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($argv[1]) +$files = new RegexIterator( + new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($argv[1]) ), '/^.+\.nzb(\.gz)?$/i', - \RecursiveRegexIterator::GET_MATCH + RecursiveRegexIterator::GET_MATCH ); $i = 1; diff --git a/misc/update/backfill.php b/misc/update/backfill.php index a73777a69..24ef51fcf 100644 --- a/misc/update/backfill.php +++ b/misc/update/backfill.php @@ -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/postprocess.php b/misc/update/postprocess.php index ea4a079eb..81768aa86 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" diff --git a/misc/update/update_binaries.php b/misc/update/update_binaries.php index 7d47d4c7d..b167f3895 100644 --- a/misc/update/update_binaries.php +++ b/misc/update/update_binaries.php @@ -31,7 +31,7 @@ if (isset($argv[1]) && ! is_numeric($argv[1])) { (isset($argv[2]) && is_numeric($argv[2]) && $argv[2] > 0 ? $argv[2] : $maxHeaders) ); } catch (Throwable $e) { - \Illuminate\Support\Facades\Log::error($e->getMessage()); + Illuminate\Support\Facades\Log::error($e->getMessage()); } } } else { @@ -39,6 +39,6 @@ if (isset($argv[1]) && ! is_numeric($argv[1])) { $binaries->updateAllGroups((isset($argv[1]) && is_numeric($argv[1]) && $argv[1] > 0 ? $argv[1] : $maxHeaders)); } catch (Throwable $e) { - \Illuminate\Support\Facades\Log::error($e->getMessage()); + Illuminate\Support\Facades\Log::error($e->getMessage()); } } diff --git a/routes/web.php b/routes/web.php index 2c53e5f44..3176b2590 100644 --- a/routes/web.php +++ b/routes/web.php @@ -69,7 +69,6 @@ use App\Http\Controllers\RssController; use App\Http\Controllers\SearchController; use App\Http\Controllers\SeriesController; use App\Http\Controllers\TermsController; -use App\Models\User; Auth::routes();