From afb0f416117957440d092802e6b2dced2d6d734d Mon Sep 17 00:00:00 2001 From: Shift Date: Thu, 30 Mar 2023 14:15:39 +0000 Subject: [PATCH] Add PHP type hints --- Blacklight/Books.php | 3 +- Blacklight/Console.php | 6 ++-- Blacklight/Genres.php | 4 +-- Blacklight/IRCClient.php | 28 ++++++++-------- Blacklight/IRCScraper.php | 4 +-- Blacklight/Movie.php | 18 +++++------ Blacklight/Music.php | 6 ++-- Blacklight/NNTP.php | 8 ++--- Blacklight/NZBContents.php | 4 +-- Blacklight/NZBImport.php | 6 ++-- Blacklight/NameFixer.php | 2 +- Blacklight/Nfo.php | 8 ++--- Blacklight/Regexes.php | 14 ++++---- Blacklight/ReleaseCleaning.php | 4 +-- Blacklight/ReleaseExtra.php | 4 +-- Blacklight/ReleaseRemover.php | 14 ++++---- Blacklight/Tmux.php | 6 ++-- Blacklight/XXX.php | 2 +- Blacklight/libraries/Geary.php | 18 +++++------ Blacklight/processing/adult/ADE.php | 10 +++--- Blacklight/processing/adult/ADM.php | 4 +-- Blacklight/processing/adult/AEBN.php | 4 +-- Blacklight/processing/adult/Hotmovies.php | 4 +-- Blacklight/processing/adult/Popporn.php | 6 ++-- Blacklight/processing/post/AniDB.php | 6 ++-- Blacklight/processing/tv/TMDB.php | 8 ++--- Blacklight/processing/tv/TVDB.php | 4 +-- Blacklight/processing/tv/TVMaze.php | 8 ++--- Blacklight/processing/tv/TraktTv.php | 6 ++-- Blacklight/utility/Country.php | 2 +- app/Console/Commands/InstallNntmux.php | 2 +- .../Commands/NntmuxDeleteUnVerifiedUsers.php | 2 +- .../Commands/NntmuxPopulateSearchIndexes.php | 6 ++-- .../Commands/NntmuxRemoveBadReleases.php | 2 +- app/Console/Commands/NntmuxResetDb.php | 2 +- .../Commands/NntmuxResetPostProcessing.php | 2 +- app/Console/Commands/NntmuxResetTruncate.php | 2 +- .../Commands/NntmuxUpdateExpiredRoles.php | 2 +- app/Console/Commands/TmuxUIRestart.php | 2 +- app/Console/Commands/TmuxUIStart.php | 2 +- app/Console/Commands/TmuxUIStop.php | 2 +- app/Console/Commands/UpdateNNTmuxDB.php | 2 +- app/Console/Kernel.php | 4 +-- app/Exceptions/Handler.php | 2 +- app/Extensions/util/PhpYenc.php | 2 +- .../Admin/AdminCategoryRegexesController.php | 3 +- .../Admin/AdminContentController.php | 3 +- .../Admin/AdminGroupController.php | 3 +- .../Admin/AdminMovieController.php | 3 +- .../Admin/AdminReleasesController.php | 3 +- .../Controllers/Admin/AdminUserController.php | 3 +- app/Http/Controllers/Api/ApiV2Controller.php | 3 +- app/Http/Controllers/Auth/LoginController.php | 3 +- app/Http/Controllers/BasePageController.php | 15 +++++---- app/Http/Controllers/ContentController.php | 3 +- app/Http/Controllers/DetailsController.php | 3 +- app/Http/Controllers/ForumController.php | 5 +-- app/Http/Controllers/ProfileController.php | 3 +- app/Http/Middleware/Authenticate.php | 3 +- app/Http/Middleware/ClearanceMiddleware.php | 4 ++- app/Http/Middleware/Google2FAMiddleware.php | 4 ++- .../Middleware/RedirectIfAuthenticated.php | 4 ++- app/Http/Requests/Auth/LoginLoginRequest.php | 2 +- .../Requests/Auth/RegisterRegisterRequest.php | 2 +- ...owLinkRequestFormForgotPasswordRequest.php | 2 +- app/Http/Requests/ContactContactURequest.php | 2 +- .../Disable2faPasswordSecurityRequest.php | 2 +- app/Jobs/RemoveInactiveAccounts.php | 2 +- app/Jobs/SendAccountChangedEmail.php | 5 +-- app/Jobs/SendAccountDeletedEmail.php | 5 +-- app/Jobs/SendAccountExpiredEmail.php | 5 +-- app/Jobs/SendAccountWillExpireEmail.php | 2 +- app/Jobs/SendContactUsEmail.php | 2 +- app/Jobs/SendInviteEmail.php | 2 +- app/Jobs/SendNewRegisteredAccountMail.php | 5 +-- app/Jobs/SendPasswordForgottenEmail.php | 5 +-- app/Jobs/SendPasswordResetEmail.php | 5 +-- app/Jobs/SendWelcomeEmail.php | 5 +-- app/Listeners/UpdateUserAccessedApi.php | 2 +- app/Listeners/UpdateUserLoggedIn.php | 2 +- app/Mail/AccountChange.php | 5 +-- app/Mail/AccountDeleted.php | 2 +- app/Mail/AccountExpired.php | 2 +- app/Mail/AccountWillExpire.php | 2 +- app/Mail/ContactUs.php | 2 +- app/Mail/ForgottenPassword.php | 2 +- app/Mail/NewAccountCreatedEmail.php | 2 +- app/Mail/PasswordReset.php | 5 +-- app/Mail/SendInvite.php | 5 +-- app/Mail/WelcomeEmail.php | 5 +-- app/Models/AnidbInfo.php | 5 +-- app/Models/BookInfo.php | 4 +-- app/Models/Category.php | 6 ++-- app/Models/Forumpost.php | 5 +-- app/Models/GamesInfo.php | 4 +-- app/Models/MusicInfo.php | 4 +-- app/Models/Predb.php | 8 ++--- app/Models/PredbHash.php | 3 +- app/Models/Release.php | 32 +++++++++++-------- app/Models/ReleaseComment.php | 12 ++++--- app/Models/ReleaseFile.php | 2 +- app/Models/ReleaseNfo.php | 2 +- app/Models/Settings.php | 6 ++-- app/Models/SteamApp.php | 4 +-- app/Models/TvEpisode.php | 3 +- app/Models/UsenetGroup.php | 20 ++++++------ app/Models/User.php | 23 +++++++------ app/Models/UserDownload.php | 7 ++-- app/Models/UserRequest.php | 7 ++-- app/Models/UserSerie.php | 3 +- app/Models/Video.php | 14 ++++---- app/Models/VideoAlias.php | 3 +- app/Observers/UserServiceObserver.php | 2 +- app/Providers/AppServiceProvider.php | 4 +-- app/Providers/AuthServiceProvider.php | 2 +- app/Providers/BroadcastServiceProvider.php | 2 +- app/Providers/EventServiceProvider.php | 2 +- app/Providers/HorizonServiceProvider.php | 6 ++-- app/Providers/RouteServiceProvider.php | 10 +++--- app/Providers/TelescopeServiceProvider.php | 6 ++-- app/Providers/UserServiceProvider.php | 4 +-- database/factories/ReleaseFactory.php | 2 +- .../2014_01_16_195548_create_users_table.php | 4 +-- ...014_02_01_311070_create_firewall_table.php | 4 +-- ..._01_17_150719_create_permission_tables.php | 4 +-- ...8_01_17_154034_create_categories_table.php | 4 +-- ...8_101314_create_category_regexes_table.php | 4 +-- ...102213_create_collection_regexes_table.php | 4 +-- ...18_102716_create_binaryblacklist_table.php | 4 +-- ...2018_01_18_103104_create_content_table.php | 4 +-- ...18_01_18_103520_create_forumpost_table.php | 4 +-- .../2018_01_18_103816_create_genres_table.php | 4 +-- ...1_18_104345_create_usenet_groups_table.php | 4 +-- ...55_create_release_naming_regexes_table.php | 4 +-- ...018_01_18_105834_create_settings_table.php | 4 +-- ..._01_20_195500_create_collections_table.php | 4 +-- ...018_01_20_195528_create_releases_table.php | 4 +-- ..._20_195604_create_anidb_episodes_table.php | 4 +-- ...8_01_20_195615_create_anidb_info_table.php | 4 +-- ...01_20_195624_create_anidb_titles_table.php | 4 +-- ...8_01_20_195636_create_audio_data_table.php | 4 +-- ...018_01_20_195648_create_binaries_table.php | 4 +-- ...018_01_20_195703_create_bookinfo_table.php | 4 +-- ..._01_20_195716_create_consoleinfo_table.php | 4 +-- ...1_20_195728_create_dnzb_failures_table.php | 4 +-- ...18_01_20_195739_create_gamesinfo_table.php | 4 +-- ..._01_20_195752_create_invitations_table.php | 4 +-- ...2018_01_20_195801_create_logging_table.php | 4 +-- ...01_20_195812_create_missed_parts_table.php | 4 +-- ...18_01_20_195822_create_movieinfo_table.php | 4 +-- ...18_01_20_195832_create_musicinfo_table.php | 4 +-- ...8_01_20_195915_create_par_hashes_table.php | 4 +-- .../2018_01_20_195925_create_parts_table.php | 4 +-- .../2018_01_20_195934_create_predb_table.php | 4 +-- ...01_20_195946_create_predb_hashes_table.php | 4 +-- ...1_20_195954_create_predb_imports_table.php | 4 +-- ...0_200005_create_release_comments_table.php | 4 +-- ...20_200018_create_releases_groups_table.php | 4 +-- ...20_200030_create_release_regexes_table.php | 4 +-- ..._20_200038_create_release_unique_table.php | 4 +-- ...0_200046_create_releaseextrafull_table.php | 4 +-- ...1_20_200056_create_release_files_table.php | 4 +-- ...01_20_200104_create_release_nfos_table.php | 4 +-- ..._200124_create_release_subtitles_table.php | 4 +-- ...01_20_200151_create_short_groups_table.php | 4 +-- ...8_01_20_200200_create_steam_apps_table.php | 4 +-- ..._01_20_200211_create_tv_episodes_table.php | 4 +-- ...2018_01_20_200218_create_tv_info_table.php | 4 +-- ..._20_200237_create_users_releases_table.php | 4 +-- ..._20_200248_create_user_downloads_table.php | 4 +-- ..._01_20_200318_create_user_movies_table.php | 4 +-- ...1_20_200328_create_user_requests_table.php | 4 +-- ..._01_20_200336_create_user_series_table.php | 4 +-- ...8_01_20_200346_create_video_data_table.php | 4 +-- .../2018_01_20_200353_create_videos_table.php | 4 +-- ..._20_200403_create_videos_aliases_table.php | 4 +-- ...2018_01_20_200417_create_xxxinfo_table.php | 4 +-- ...018_01_22_220858_add_stored_procedures.php | 4 +-- .../2018_04_24_132758_create_cache_table.php | 4 +-- ..._100000_create_telescope_entries_table.php | 4 +-- ..._070520_add_verification_to_user_table.php | 6 ++-- ..._02_20_102034_create_failed_jobs_table.php | 4 +-- ...11_234818_create_root_categories_table.php | 4 +-- ...9_03_12_090532_change_categories_table.php | 4 +-- ...12_093837_add_foreign_categories_table.php | 4 +-- ...019_04_04_130055_update_releases_table.php | 4 +-- ...19_04_04_150842_update_movieinfo_table.php | 4 +-- ..._04_04_152238_update_user_movies_table.php | 4 +-- ...12_create_role_expiration_emails_table.php | 4 +-- ...06_140408_create_invitation_user_table.php | 4 +-- ...change_passwordststatus_releases_table.php | 4 +-- ...10_231045_create_paypal_payments_table.php | 4 +-- ...3_update_tv_episodes_firstaired_column.php | 4 +-- ...05920_add_timestamps_to_videos_aliases.php | 4 +-- ...190950_update_imdb_column_videos_table.php | 4 +-- ...7_001831_add_unique_index_to_api_token.php | 4 +-- ...449_add_timezone_column_to_users_table.php | 4 +-- .../2020_03_07_213224_remove_text_hash.php | 4 +-- ...09_223527_create_release_informs_table.php | 4 +-- .../2020_08_08_212118_create_jobs_table.php | 4 +-- ...7_163455_add_uuid_to_failed_jobs_table.php | 4 +-- ...14949_create_password_securities_table.php | 4 +-- ...add_timestamps_columns_to_missed_parts.php | 4 +-- .../seeders/BinaryblacklistTableSeeder.php | 2 +- database/seeders/CategoriesTableSeeder.php | 2 +- .../seeders/CategoryRegexesTableSeeder.php | 2 +- .../seeders/CollectionRegexesTableSeeder.php | 2 +- database/seeders/ContentTableSeeder.php | 2 +- database/seeders/DatabaseSeeder.php | 2 +- database/seeders/GenresTableSeeder.php | 2 +- database/seeders/GroupsTableSeeder.php | 2 +- .../ReleaseNamingRegexesTableSeeder.php | 2 +- .../seeders/RolesAndPermissionsSeeder.php | 2 +- .../seeders/RootCategoriesTableSeeder.php | 2 +- database/seeders/SettingsTableSeeder.php | 2 +- tests/CreatesApplication.php | 3 +- tests/Feature/BooksTest.php | 2 +- tests/Feature/GetBooksBrowseByOptionsTest.php | 2 +- tests/Feature/SettingsTest.php | 2 +- tests/Install/InstallTest.php | 2 +- 220 files changed, 523 insertions(+), 469 deletions(-) diff --git a/Blacklight/Books.php b/Blacklight/Books.php index 4bf24457a..f97d6a97e 100755 --- a/Blacklight/Books.php +++ b/Blacklight/Books.php @@ -2,6 +2,7 @@ namespace Blacklight; +use Illuminate\Database\Eloquent\Model; use App\Models\BookInfo; use App\Models\Category; use App\Models\Release; @@ -95,7 +96,7 @@ class Books /** * @return \Illuminate\Database\Eloquent\Model */ - public function getBookInfoByName($title) + public function getBookInfoByName($title): Model { //only used to get a count of words $searchWords = ''; diff --git a/Blacklight/Console.php b/Blacklight/Console.php index 9aa7ed30c..1b5c48474 100755 --- a/Blacklight/Console.php +++ b/Blacklight/Console.php @@ -125,7 +125,7 @@ class Console * @param string $platform * @return false|\Illuminate\Database\Eloquent\Model */ - public function getConsoleInfoByName($title, $platform) + public function getConsoleInfoByName(string $title, string $platform) { //only used to get a count of words $searchWords = ''; @@ -300,7 +300,7 @@ class Console /** * @param string $review */ - public function update($id, $title, $asin, $url, $salesrank, $platform, $publisher, $releasedate, $esrb, $cover, $genres_id, $review = 'review'): void + public function update($id, $title, $asin, $url, $salesrank, $platform, $publisher, $releasedate, $esrb, $cover, $genres_id, string $review = 'review'): void { $releasedate = $releasedate !== '' ? $releasedate : 'null'; $review = $review === 'review' ? $review : substr($review, 0, 3000); @@ -515,7 +515,7 @@ class Console * * @param string $platform */ - protected function _replacePlatform($platform): string + protected function _replacePlatform(string $platform): string { switch (strtoupper($platform)) { case 'X360': diff --git a/Blacklight/Genres.php b/Blacklight/Genres.php index d4f0b8bcf..872a7c581 100755 --- a/Blacklight/Genres.php +++ b/Blacklight/Genres.php @@ -41,7 +41,7 @@ class Genres * @param bool $activeOnly * @return array|mixed */ - public function getGenres($type = '', $activeOnly = false) + public function getGenres(string $type = '', bool $activeOnly = false) { $sql = $this->getListQuery($type, $activeOnly); $genres = Cache::get(md5($sql)); @@ -70,7 +70,7 @@ class Genres * @param string $type * @param bool $activeOnly */ - private function getListQuery($type = '', $activeOnly = false): string + private function getListQuery(string $type = '', bool $activeOnly = false): string { if (! empty($type)) { $typesql = sprintf(' AND g.type = %d', $type); diff --git a/Blacklight/IRCClient.php b/Blacklight/IRCClient.php index 1bc319f33..27455132e 100755 --- a/Blacklight/IRCClient.php +++ b/Blacklight/IRCClient.php @@ -188,7 +188,7 @@ class IRCClient * * @param int $timeout Seconds. */ - public function setSocketTimeout($timeout) + public function setSocketTimeout(int $timeout) { if (! is_numeric($timeout)) { echo 'ERROR: IRC socket timeout must be a number!'.PHP_EOL; @@ -202,7 +202,7 @@ class IRCClient * * @param int $timeout Seconds. */ - public function setConnectionTimeout($timeout) + public function setConnectionTimeout(int $timeout) { if (! is_numeric($timeout)) { echo 'ERROR: IRC connection timeout must be a number!'.PHP_EOL; @@ -216,7 +216,7 @@ class IRCClient * * @param int $retries */ - public function setConnectionRetries($retries) + public function setConnectionRetries(int $retries) { if (! is_numeric($retries)) { echo 'ERROR: IRC connection retries must be a number!'.PHP_EOL; @@ -230,7 +230,7 @@ class IRCClient * * @param int $delay Seconds. */ - public function setReConnectDelay($delay) + public function setReConnectDelay(int $delay) { if (! is_numeric($delay)) { echo 'ERROR: IRC reconnect delay must be a number!'.PHP_EOL; @@ -247,7 +247,7 @@ class IRCClient * @param bool $tls Use encryption for the socket transport? (make sure the port is right). * @return bool */ - public function connect($hostname, $port = 6667, $tls = false) + public function connect(string $hostname, int $port = 6667, bool $tls = false): bool { $this->_alreadyLoggedIn = false; $transport = ($tls === true ? 'tls' : 'tcp'); @@ -303,7 +303,7 @@ class IRCClient * @param null $password The password - some servers require a password. * @return bool */ - public function login($nickName, $userName, $realName, $password = null) + public function login(string $nickName, string $userName, string $realName, $password = null): bool { if (! $this->_connected()) { echo 'ERROR: You must connect to IRC first!'.PHP_EOL; @@ -386,7 +386,7 @@ class IRCClient * @param string $message Optional disconnect message. * @return bool */ - public function quit($message = null) + public function quit(string $message = null): bool { if ($this->_connected()) { $this->_writeSocket('QUIT'.($message === null ? '' : ' :'.$message)); @@ -441,7 +441,7 @@ class IRCClient * array( '#exampleChannel' => 'thePassword', '#exampleChan2' => null ); * @return bool */ - public function joinChannels($channels = []) + public function joinChannels(array $channels = []): bool { $this->_channels = $channels; @@ -474,7 +474,7 @@ class IRCClient * @param string $channel * @param string $password */ - protected function _joinChannel($channel, $password) + protected function _joinChannel(string $channel, string $password) { $this->_writeSocket('JOIN '.$channel.(empty($password) ? '' : ' '.$password)); } @@ -484,7 +484,7 @@ class IRCClient * * @param string $host */ - protected function _pong($host) + protected function _pong(string $host) { if ($this->_writeSocket('PONG '.$host) === false) { $this->_reconnect(); @@ -501,7 +501,7 @@ class IRCClient * * @param string $host */ - protected function _ping($host) + protected function _ping(string $host) { $pong = $this->_writeSocket('PING '.$host); @@ -557,7 +557,7 @@ class IRCClient * @param string $command * @return bool */ - protected function _writeSocket($command) + protected function _writeSocket(string $command): bool { $command .= "\r\n"; for ($written = 0, $writtenMax = \strlen($command); $written < $writtenMax; $written += $fWrite) { @@ -632,7 +632,7 @@ class IRCClient * * @return bool */ - protected function _connected() + protected function _connected(): bool { return \is_resource($this->_socket) && ! feof($this->_socket); } @@ -643,7 +643,7 @@ class IRCClient * @param string $text * @return string */ - protected function _stripControlCharacters($text) + protected function _stripControlCharacters(string $text): string { return preg_replace( [ diff --git a/Blacklight/IRCScraper.php b/Blacklight/IRCScraper.php index 87533ebf7..3964ba3a4 100755 --- a/Blacklight/IRCScraper.php +++ b/Blacklight/IRCScraper.php @@ -406,7 +406,7 @@ class IRCScraper extends IRCClient * * @param bool $new */ - protected function _doEcho($new = true) + protected function _doEcho(bool $new = true) { if (! $this->_silent) { $nukeString = ''; @@ -463,7 +463,7 @@ class IRCScraper extends IRCClient * @param string $groupName * @return mixed */ - protected function _getGroupID($groupName) + protected function _getGroupID(string $groupName) { if (! isset($this->_groupList[$groupName])) { $group = UsenetGroup::query()->where('name', $groupName)->first(['id']); diff --git a/Blacklight/Movie.php b/Blacklight/Movie.php index 69d9106e0..1c57bf72c 100755 --- a/Blacklight/Movie.php +++ b/Blacklight/Movie.php @@ -216,7 +216,7 @@ class Movie * @param int $maxAge * @return array|mixed */ - public function getMovieRange($page, $cat, $start, $num, $orderBy, $maxAge = -1, array $excludedCats = []) + public function getMovieRange($page, $cat, $start, $num, $orderBy, int $maxAge = -1, array $excludedCats = []) { $catsrch = ''; if (\count($cat) > 0 && $cat[0] !== -1) { @@ -381,7 +381,7 @@ class Movie * * @throws \Exception */ - public function getTrailer($imdbId) + public function getTrailer(int $imdbId) { $trailer = MovieInfo::query()->where('imdbid', $imdbId)->where('trailer', '<>', '')->first(['trailer']); if ($trailer !== null) { @@ -411,7 +411,7 @@ class Movie * @param array $data * @return mixed */ - public function parseTraktTv(&$data) + public function parseTraktTv(array &$data) { if (empty($data['ids']['imdb'])) { return false; @@ -521,7 +521,7 @@ class Movie * @param string $variable5 * @return array|string */ - protected function setVariables($variable1, $variable2, $variable3, $variable4, $variable5) + protected function setVariables(string $variable1, string $variable2, string $variable3, string $variable4, string $variable5) { if (! empty($variable1)) { return $variable1; @@ -744,7 +744,7 @@ class Movie * @param bool $text * @return array|false */ - public function fetchTMDBProperties($imdbId, $text = false) + public function fetchTMDBProperties($imdbId, bool $text = false) { $lookupId = $text === false && (\strlen($imdbId) === 7 || strlen($imdbId) === 8) ? 'tt'.$imdbId : $imdbId; @@ -1005,7 +1005,7 @@ class Movie * @throws \DariusIII\ItunesApi\Exceptions\InvalidProviderException * @throws \Exception */ - public function fetchItunesMovieProperties($title) + public function fetchItunesMovieProperties(string $title) { $movie = true; try { @@ -1046,7 +1046,7 @@ class Movie * * @throws \Exception */ - public function doMovieUpdate($buffer, $service, $id, $processImdb = 1): string + public function doMovieUpdate(string $buffer, string $service, int $id, int $processImdb = 1): string { $imdbId = false; if (\is_string($buffer) && preg_match('/(?:imdb.*?)?(?:tt|Title\?)(?P\d{5,8})/i', $buffer, $hits)) { @@ -1092,7 +1092,7 @@ class Movie * * @throws \Exception */ - public function processMovieReleases($groupID = '', $guidChar = '', $lookupIMDB = 1): void + public function processMovieReleases(string $groupID = '', string $guidChar = '', int $lookupIMDB = 1): void { if ($lookupIMDB === 0) { return; @@ -1280,7 +1280,7 @@ class Movie * * @param string $releaseName */ - protected function parseMovieSearchName($releaseName): bool + protected function parseMovieSearchName(string $releaseName): bool { $name = $year = ''; $followingList = '[^\w]((1080|480|720)p|AC3D|Directors([^\w]CUT)?|DD5\.1|(DVD|BD|BR)(Rip)?|BluRay|divx|HDTV|iNTERNAL|LiMiTED|(Real\.)?Proper|RE(pack|Rip)|Sub\.?(fix|pack)|Unrated|WEB-DL|(x|H)[ ._-]?264|xvid)[^\w]'; diff --git a/Blacklight/Music.php b/Blacklight/Music.php index 25c127a3d..091afa321 100755 --- a/Blacklight/Music.php +++ b/Blacklight/Music.php @@ -405,7 +405,7 @@ class Music * * @throws \Exception */ - public function processMusicReleases($local = false) + public function processMusicReleases(bool $local = false) { $res = DB::select( sprintf( @@ -484,7 +484,7 @@ class Music * @param string $releaseName * @return array|false */ - public function parseArtist($releaseName) + public function parseArtist(string $releaseName) { if (preg_match('/(.+?)(\d{1,2} \d{1,2} )?\(?(19\d{2}|20[0-1][\d])\b/', $releaseName, $name)) { $result = []; @@ -624,7 +624,7 @@ class Music * @throws \DariusIII\ItunesApi\Exceptions\InvalidProviderException * @throws \Exception */ - protected function fetchItunesMusicProperties($title) + protected function fetchItunesMusicProperties(string $title) { $mus = true; // Load genres. diff --git a/Blacklight/NNTP.php b/Blacklight/NNTP.php index 7aa6a6c36..77448d685 100755 --- a/Blacklight/NNTP.php +++ b/Blacklight/NNTP.php @@ -356,7 +356,7 @@ class NNTP extends \Net_NNTP_Client * @throws \Exception * On failure : (object) PEAR_Error. */ - public function selectGroup($group, $articles = false, bool $force = false): mixed + public function selectGroup(string $group, bool $articles = false, bool $force = false): mixed { $connected = $this->_checkConnection(false); if ($connected !== true) { @@ -384,7 +384,7 @@ class NNTP extends \Net_NNTP_Client * @throws \Exception * On failure : (object) PEAR_Error. */ - public function getOverview($range = null, $names = true, $forceNames = true): mixed + public function getOverview(string $range = null, bool $names = true, bool $forceNames = true): mixed { $connected = $this->_checkConnection(); if ($connected !== true) { @@ -507,7 +507,7 @@ class NNTP extends \Net_NNTP_Client * * @throws \Exception */ - public function getGroups($wildMat = null) + public function getGroups(string $wildMat = null) { // Enabled header compression if not enabled. $this->_enableCompression(); @@ -1300,7 +1300,7 @@ class NNTP extends \Net_NNTP_Client * @return mixed (bool) On success: True when posting allowed, otherwise false. * (object) On failure: pear_error */ - public function connect($host = null, $encryption = null, $port = null, $timeout = 15, int $socketTimeout = 120): mixed + public function connect(string $host = null, $encryption = null, int $port = null, int $timeout = 15, int $socketTimeout = 120): mixed { if ($this->_isConnected()) { return $this->throwError('Already connected, disconnect first!', null); diff --git a/Blacklight/NZBContents.php b/Blacklight/NZBContents.php index 243cf23ad..ffd038705 100755 --- a/Blacklight/NZBContents.php +++ b/Blacklight/NZBContents.php @@ -144,7 +144,7 @@ class NZBContents * * @throws \Exception */ - public function parseNZB($guid, $relID, $groupID, $nfoCheck = false) + public function parseNZB($guid, $relID, $groupID, bool $nfoCheck = false) { $nzbFile = $this->LoadNZB($guid); if ($nzbFile !== false) { @@ -251,7 +251,7 @@ class NZBContents * * @throws \Exception */ - public function checkPAR2($guid, $relID, $groupID, $nameStatus, $show): bool + public function checkPAR2(string $guid, int $relID, int $groupID, int $nameStatus, int $show): bool { $nzbFile = $this->LoadNZB($guid); if ($nzbFile !== false) { diff --git a/Blacklight/NZBImport.php b/Blacklight/NZBImport.php index 856253b8d..d04a34d82 100755 --- a/Blacklight/NZBImport.php +++ b/Blacklight/NZBImport.php @@ -129,7 +129,7 @@ class NZBImport * * @throws \Exception */ - public function beginImport($filesToProcess, $useNzbName = false, $delete = true, $deleteFailed = true) + public function beginImport(array $filesToProcess, $useNzbName = false, bool $delete = true, bool $deleteFailed = true) { // Get all the groups in the DB. if (! $this->getAllGroups()) { @@ -245,7 +245,7 @@ class NZBImport * * @throws \Exception */ - protected function scanNZBFile(&$nzbXML, $useNzbName = false): bool + protected function scanNZBFile(&$nzbXML, bool $useNzbName = false): bool { $binary_names = []; $totalFiles = $totalSize = $groupID = 0; @@ -459,7 +459,7 @@ class NZBImport * * @param string $message */ - protected function echoOut($message): void + protected function echoOut(string $message): void { if ($this->browser) { $this->retVal .= $message.'
'; diff --git a/Blacklight/NameFixer.php b/Blacklight/NameFixer.php index b360adb65..629f53c16 100755 --- a/Blacklight/NameFixer.php +++ b/Blacklight/NameFixer.php @@ -1454,7 +1454,7 @@ class NameFixer * * @throws \Exception */ - public function tvCheck($release, $echo, $type, $nameStatus, $show): void + public function tvCheck($release, bool $echo, string $type, $nameStatus, $show): void { $result = []; diff --git a/Blacklight/Nfo.php b/Blacklight/Nfo.php index 5fb2df4e2..b69b01425 100755 --- a/Blacklight/Nfo.php +++ b/Blacklight/Nfo.php @@ -88,7 +88,7 @@ class Nfo * @param string $str The string with a Show ID. * @return array|false Return array with show ID and site source or false on failure. */ - public function parseShowId($str) + public function parseShowId(string $str) { $return = false; @@ -128,7 +128,7 @@ class Nfo * * @throws \Exception */ - public function isNFO(&$possibleNFO, $guid): bool + public function isNFO(&$possibleNFO, string $guid): bool { if ($possibleNFO === false) { return false; @@ -195,7 +195,7 @@ class Nfo * * @throws \Exception */ - public function addAlternateNfo(&$nfo, $release, $nntp): bool + public function addAlternateNfo(string &$nfo, $release, NNTP $nntp): bool { if ($release->id > 0 && $this->isNFO($nfo, $release->guid)) { $check = ReleaseNfo::whereReleasesId($release->id)->first(['releases_id']); @@ -240,7 +240,7 @@ class Nfo * * @throws \Exception */ - public function processNfoFiles($nntp, $groupID = '', $guidChar = '', $processImdb = 1, $processTv = 1): int + public function processNfoFiles($nntp, string $groupID = '', string $guidChar = '', int $processImdb = 1, int $processTv = 1): int { $ret = 0; diff --git a/Blacklight/Regexes.php b/Blacklight/Regexes.php index 0703e11b3..2791b7bfc 100755 --- a/Blacklight/Regexes.php +++ b/Blacklight/Regexes.php @@ -98,7 +98,7 @@ class Regexes * * @param int $id */ - public function getRegexByID($id): array + public function getRegexByID(int $id): array { return (array) Arr::first(DB::select(sprintf('SELECT * FROM %s WHERE id = %d LIMIT 1', $this->tableName, $id))); } @@ -107,7 +107,7 @@ class Regexes * @param string $group_regex * @return mixed */ - public function getRegex($group_regex = '') + public function getRegex(string $group_regex = '') { if ($this->tableName === 'collection_regexes') { $table = CollectionRegex::class; @@ -131,7 +131,7 @@ class Regexes * * @param string $group_regex Optional, keyword to find a group. */ - public function getCount($group_regex = ''): int + public function getCount(string $group_regex = ''): int { $query = DB::select( sprintf( @@ -151,7 +151,7 @@ class Regexes * * @throws \Throwable */ - public function deleteRegex($id): void + public function deleteRegex(int $id): void { DB::transaction(function () use ($id) { DB::delete(sprintf('DELETE FROM %s WHERE id = %d', $this->tableName, $id)); @@ -169,7 +169,7 @@ class Regexes * * @throws \Exception */ - public function testCollectionRegex($groupName, $regex, $limit): array + public function testCollectionRegex(string $groupName, string $regex, int $limit): array { $groupID = UsenetGroup::getIDByName($groupName); @@ -331,7 +331,7 @@ class Regexes * * @throws \Exception */ - protected function _matchRegex($regex, $subject): string + protected function _matchRegex(string $regex, string $subject): string { $returnString = ''; if (preg_match($regex, $subject, $hits) && \count($hits) > 0) { @@ -362,7 +362,7 @@ class Regexes * * @param string $group_regex */ - protected function _groupQueryString($group_regex): string + protected function _groupQueryString(string $group_regex): string { return $group_regex ? ('WHERE group_regex LIKE '.escapeString('%'.$group_regex.'%')) : ''; } diff --git a/Blacklight/ReleaseCleaning.php b/Blacklight/ReleaseCleaning.php index 3da62e6c0..d250f95e4 100755 --- a/Blacklight/ReleaseCleaning.php +++ b/Blacklight/ReleaseCleaning.php @@ -102,7 +102,7 @@ class ReleaseCleaning * * @throws \Exception */ - public function releaseCleaner($subject, $fromName, $groupName, $usePre = false) + public function releaseCleaner($subject, $fromName, $groupName, bool $usePre = false) { $hit = $hits = []; // Get pre style name from releases.name @@ -405,7 +405,7 @@ class ReleaseCleaning /** * @return array */ - public function generic() + public function generic(): array { // This regex gets almost all of the predb release names also keep in mind that not every subject ends with yEnc, some are truncated, because of the 255 character limit and some have extra charaters tacked onto the end, like (5/10). if (preg_match( diff --git a/Blacklight/ReleaseExtra.php b/Blacklight/ReleaseExtra.php index 01f031409..236d36dd0 100755 --- a/Blacklight/ReleaseExtra.php +++ b/Blacklight/ReleaseExtra.php @@ -70,7 +70,7 @@ class ReleaseExtra /** * @param string $guid */ - public function getBriefByGuid($guid): array + public function getBriefByGuid(string $guid): array { return DB::select(sprintf("SELECT containerformat, videocodec, videoduration, videoaspect, CONCAT(video_data.videowidth,'x',video_data.videoheight,' @',format(videoframerate,0),'fps') AS size, @@ -322,7 +322,7 @@ class ReleaseExtra * @param int $releaseID * @param string $uniqueId */ - public function addUID($releaseID, $uniqueId): void + public function addUID(int $releaseID, string $uniqueId): void { $dupecheck = ReleaseUnique::query()->where('releases_id', $releaseID)->orWhere([ 'releases_id' => $releaseID, diff --git a/Blacklight/ReleaseRemover.php b/Blacklight/ReleaseRemover.php index c2db6827f..02e8fccc7 100755 --- a/Blacklight/ReleaseRemover.php +++ b/Blacklight/ReleaseRemover.php @@ -147,7 +147,7 @@ class ReleaseRemover * * @throws \Exception */ - public function removeByCriteria($arguments) + public function removeByCriteria(array $arguments) { $this->delete = true; $this->ignoreUserCheck = false; @@ -212,7 +212,7 @@ class ReleaseRemover * * @throws \Exception */ - public function removeCrap($delete, $time, $type = '', $blacklistID = '') + public function removeCrap(bool $delete, $time, string $type = '', $blacklistID = '') { $timeStart = now(); $this->delete = $delete; @@ -1089,7 +1089,7 @@ class ReleaseRemover * @param string $argument User argument. * @return string|false */ - protected function formatCriteriaQuery($argument) + protected function formatCriteriaQuery(string $argument) { // Check if the user wants to ignore the check. if ($argument === 'ignore') { @@ -1260,7 +1260,7 @@ class ReleaseRemover * * @return bool */ - protected function checkUserResponse() + protected function checkUserResponse(): bool { if ($this->ignoreUserCheck || $this->browser) { return true; @@ -1290,7 +1290,7 @@ class ReleaseRemover * * @param string $string */ - protected function cleanSpaces($string): string + protected function cleanSpaces(string $string): string { return trim(preg_replace('/\s{2,}/', ' ', $string)); } @@ -1301,7 +1301,7 @@ class ReleaseRemover * @param string $string The string to format. * @param string $type The column name. */ - protected function formatLike($string, $type): string + protected function formatLike(string $string, string $type): string { $newString = explode(' ', $string); if (\count($newString) > 1) { @@ -1334,7 +1334,7 @@ class ReleaseRemover * @param string $dbRegex * @return bool|mixed|string */ - protected function extractSrchFromRegx($dbRegex = '') + protected function extractSrchFromRegx(string $dbRegex = '') { $regexMatch = ''; diff --git a/Blacklight/Tmux.php b/Blacklight/Tmux.php index 38adc5c72..319633a76 100755 --- a/Blacklight/Tmux.php +++ b/Blacklight/Tmux.php @@ -198,7 +198,7 @@ class Tmux /** * @return int */ - public function updateItem($setting, $value) + public function updateItem($setting, $value): int { return Settings::query()->where('setting', '=', $setting)->update(['value' => $value]); } @@ -265,7 +265,7 @@ class Tmux * * @throws \Exception */ - public function rand_bool($loop, $chance = 60): bool + public function rand_bool($loop, int $chance = 60): bool { $usecache = Settings::settingValue('site.tmux.usecache') ?? 0; if ($loop === 1 || $usecache === 0) { @@ -294,7 +294,7 @@ class Tmux * * @throws \Exception */ - public function proc_query($qry, $bookreqids, $db_name, $ppmax = '', $ppmin = ''): bool|string + public function proc_query($qry, $bookreqids, string $db_name, string $ppmax = '', string $ppmin = ''): bool|string { switch ((int) $qry) { case 1: diff --git a/Blacklight/XXX.php b/Blacklight/XXX.php index 948d41b39..0bf59dcce 100755 --- a/Blacklight/XXX.php +++ b/Blacklight/XXX.php @@ -88,7 +88,7 @@ class XXX * * @param int $maxAge */ - public function getXXXRange($page, $cat, $start, $num, $orderBy, $maxAge = -1, array $excludedCats = []): array + public function getXXXRange($page, $cat, $start, $num, $orderBy, int $maxAge = -1, array $excludedCats = []): array { $catSrch = ''; if (\count($cat) > 0 && $cat[0] !== -1) { diff --git a/Blacklight/libraries/Geary.php b/Blacklight/libraries/Geary.php index d0822c917..f5d1cc719 100644 --- a/Blacklight/libraries/Geary.php +++ b/Blacklight/libraries/Geary.php @@ -48,7 +48,7 @@ class Geary * @param string $gateway_id Your API key obtained from https://admin.gear.mycelium.com/gateways * @param string $gateway_secret Your API secret obtained from https://admin.gear.mycelium.com/gateways */ - public function __construct($gateway_id, $gateway_secret) + public function __construct(string $gateway_id, string $gateway_secret) { $this->gateway_id = $gateway_id; $this->gateway_secret = $gateway_secret; @@ -66,7 +66,7 @@ class Geary * normally in satoshis * @return mixed */ - public function create_order($amount, $keychain_id, $callback_data) + public function create_order(float $amount, $keychain_id, $callback_data) { $request = $this->endpoint('orders'); $params = [ @@ -92,7 +92,7 @@ class Geary * @param int $id Id is an existing order ID or payment ID * @return mixed */ - public function cancel_order($id) + public function cancel_order(int $id) { $request = $this->endpoint('orders'); @@ -113,7 +113,7 @@ class Geary * @param int $payment_id Id is an existing payment ID * @return mixed */ - public function check_order($payment_id) + public function check_order(int $payment_id) { $request_uri = $this->endpoint('orders'); @@ -173,7 +173,7 @@ class Geary * * @param int $id Id is an existing order ID */ - public function order_websocket_link($id): string + public function order_websocket_link(int $id): string { return "wss://gateway.gear.mycelium.com/gateways/{$this->gateway_id}/orders/$id/websocket"; } @@ -222,7 +222,7 @@ class Geary * * @param string $method */ - private function endpoint($method): string + private function endpoint(string $method): string { return "/gateways/{$this->gateway_id}/$method"; } @@ -258,7 +258,7 @@ class Geary * * @param string $name */ - private function get_header($name): string + private function get_header(string $name): string { $headers = getAllHeaders(); @@ -280,7 +280,7 @@ class Geary * * @param array $data */ - private function prepare_header($data): array + private function prepare_header(array $data): array { $params = $data['params']; $params_query = ! \is_array($params) ? "/$params" : '?'.http_build_query($params); @@ -307,7 +307,7 @@ class Geary * @param array $data * @return mixed */ - private function send_signed_request($data) + private function send_signed_request(array $data) { $ch = curl_init(); $url = self::API_URL.$data['request_uri']; diff --git a/Blacklight/processing/adult/ADE.php b/Blacklight/processing/adult/ADE.php index f824f338f..7b0a1ec6b 100755 --- a/Blacklight/processing/adult/ADE.php +++ b/Blacklight/processing/adult/ADE.php @@ -68,7 +68,7 @@ class ADE extends AdultMovies * * @return array - url, streamid, basestreamingurl */ - protected function trailers() + protected function trailers(): array { $this->_response = getRawHtml(self::ADE.$this->_trailers.$this->_directUrl); $this->_html->loadHtml($this->_response); @@ -100,7 +100,7 @@ class ADE extends AdultMovies * * @return array - Boxcover and backcover */ - protected function covers() + protected function covers(): array { if ($ret = $this->_html->find('div#Boxcover, img[itemprop=image]', 1)) { $this->_res['boxcover'] = preg_replace('/m\.jpg/', 'h.jpg', $ret->src); @@ -115,7 +115,7 @@ class ADE extends AdultMovies * * @return array - plot */ - protected function synopsis() + protected function synopsis(): array { $ret = $this->_html->findOne('meta[name=og:description]')->content; if ($ret !== false) { @@ -168,7 +168,7 @@ class ADE extends AdultMovies * @param bool $extras * @return array - ProductInfo/Extras = features */ - protected function productInfo($extras = false) + protected function productInfo(bool $extras = false): array { $dofeature = null; $this->_tmpResponse = str_ireplace('Section ProductInfo', 'spdinfo', $this->_response); @@ -205,7 +205,7 @@ class ADE extends AdultMovies * @param string $movie * @return bool - True if releases has 90% match, else false */ - public function processSite($movie): bool + public function processSite(string $movie): bool { if (empty($movie)) { return false; diff --git a/Blacklight/processing/adult/ADM.php b/Blacklight/processing/adult/ADM.php index e74eb6ae6..59ade1bd5 100755 --- a/Blacklight/processing/adult/ADM.php +++ b/Blacklight/processing/adult/ADM.php @@ -74,7 +74,7 @@ class ADM extends AdultMovies * * @return array - boxcover,backcover */ - protected function covers() + protected function covers(): array { $baseUrl = 'http://www.adultdvdmarketplace.com/'; if ($ret = $this->_html->find('a[rel=fancybox-button]', 0)) { @@ -112,7 +112,7 @@ class ADM extends AdultMovies * * @param bool $extras */ - protected function productInfo($extras = false): array + protected function productInfo(bool $extras = false): array { foreach ($this->_html->find('ul.list-unstyled li') as $li) { $category = explode(':', $li->plaintext); diff --git a/Blacklight/processing/adult/AEBN.php b/Blacklight/processing/adult/AEBN.php index f7577e1b3..48db36be7 100755 --- a/Blacklight/processing/adult/AEBN.php +++ b/Blacklight/processing/adult/AEBN.php @@ -144,7 +144,7 @@ class AEBN extends AdultMovies * * @param bool $extras */ - protected function productInfo($extras = false): array + protected function productInfo(bool $extras = false): array { if ($ret = $this->_html->find('div#md-detailsLeft', 0)) { foreach ($ret->find('div') as $div) { @@ -190,7 +190,7 @@ class AEBN extends AdultMovies * * @param string $movie */ - public function processSite($movie): bool + public function processSite(string $movie): bool { if (empty($movie)) { return false; diff --git a/Blacklight/processing/adult/Hotmovies.php b/Blacklight/processing/adult/Hotmovies.php index cb748d7df..98c5d0aad 100755 --- a/Blacklight/processing/adult/Hotmovies.php +++ b/Blacklight/processing/adult/Hotmovies.php @@ -103,7 +103,7 @@ class Hotmovies extends AdultMovies * * @param bool $extras */ - protected function productInfo($extras = false): array + protected function productInfo(bool $extras = false): array { $studio = false; $director = false; @@ -203,7 +203,7 @@ class Hotmovies extends AdultMovies * @param string $movie * @return bool , true if search >= 90% */ - public function processSite($movie): bool + public function processSite(string $movie): bool { if (empty($movie)) { return false; diff --git a/Blacklight/processing/adult/Popporn.php b/Blacklight/processing/adult/Popporn.php index 087d0a17f..1ebfbfc33 100755 --- a/Blacklight/processing/adult/Popporn.php +++ b/Blacklight/processing/adult/Popporn.php @@ -142,7 +142,7 @@ class Popporn extends AdultMovies * @param bool $extras * @return array|mixed */ - protected function productInfo($extras = false) + protected function productInfo(bool $extras = false) { $country = false; if ($ret = $this->_html->findOne('div#lside')) { @@ -233,7 +233,7 @@ class Popporn extends AdultMovies * * @return array */ - protected function genres() + protected function genres(): array { $genres = []; if ($ret = $this->_html->find('div[id=thekeywords], p[class=keywords]', 1)) { @@ -252,7 +252,7 @@ class Popporn extends AdultMovies * @param string $movie * @return bool , true if search >= 90% */ - public function processSite($movie): bool + public function processSite(string $movie): bool { if (! empty($movie)) { $this->_trailUrl = self::TRAILINGSEARCH.$movie; diff --git a/Blacklight/processing/post/AniDB.php b/Blacklight/processing/post/AniDB.php index b45ccb188..83b1fcf6c 100755 --- a/Blacklight/processing/post/AniDB.php +++ b/Blacklight/processing/post/AniDB.php @@ -122,7 +122,7 @@ class AniDB * @param int $episode * @return \Illuminate\Database\Eloquent\Model|null|static */ - private function checkAniDBInfo($anidbId, $episode = -1) + private function checkAniDBInfo($anidbId, int $episode = -1) { return AnidbEpisode::query()->where( [ @@ -156,7 +156,7 @@ class AniDB * @param string $cleanName * @return array $hits */ - private function extractTitleEpisode($cleanName = ''): array + private function extractTitleEpisode(string $cleanName = ''): array { $cleanName = str_replace('_', ' ', $cleanName); @@ -197,7 +197,7 @@ class AniDB * @param string $searchName * @return mixed */ - private function getAnidbByName($searchName = '') + private function getAnidbByName(string $searchName = '') { return DB::selectOne( sprintf( diff --git a/Blacklight/processing/tv/TMDB.php b/Blacklight/processing/tv/TMDB.php index 6633543b7..f0a26a24e 100644 --- a/Blacklight/processing/tv/TMDB.php +++ b/Blacklight/processing/tv/TMDB.php @@ -44,7 +44,7 @@ class TMDB extends TV * * @param bool $local */ - public function processSite($groupID, $guidChar, $process, $local = false): void + public function processSite($groupID, $guidChar, $process, bool $local = false): void { $res = $this->getTvReleases($groupID, $guidChar, $process, parent::PROCESS_TMDB); @@ -186,7 +186,7 @@ class TMDB extends TV * @param string $cleanName * @return array|false */ - protected function getShowInfo($cleanName): bool|array + protected function getShowInfo(string $cleanName): bool|array { $return = $response = false; @@ -261,7 +261,7 @@ class TMDB extends TV * * @param int $videoId -- the local Video ID */ - public function getPoster($videoId): int + public function getPoster(int $videoId): int { $ri = new ReleaseImage(); @@ -291,7 +291,7 @@ class TMDB extends TV * @param int $videoId * @return array|false */ - protected function getEpisodeInfo($tmdbid, $season, $episode, $airdate = '', $videoId = 0): bool|array + protected function getEpisodeInfo(int $tmdbid, int $season, int $episode, string $airdate = '', int $videoId = 0): bool|array { $return = false; diff --git a/Blacklight/processing/tv/TVDB.php b/Blacklight/processing/tv/TVDB.php index 7c34d54bb..02b4fcefa 100755 --- a/Blacklight/processing/tv/TVDB.php +++ b/Blacklight/processing/tv/TVDB.php @@ -63,7 +63,7 @@ class TVDB extends TV * * @param bool $local */ - public function processSite($groupID, $guidChar, $process, $local = false): void + public function processSite($groupID, $guidChar, $process, bool $local = false): void { $res = $this->getTvReleases($groupID, $guidChar, $process, parent::PROCESS_TVDB); @@ -273,7 +273,7 @@ class TVDB extends TV * * @param int $videoId -- the local Video ID */ - public function getPoster($videoId): int + public function getPoster(int $videoId): int { $ri = new ReleaseImage(); diff --git a/Blacklight/processing/tv/TVMaze.php b/Blacklight/processing/tv/TVMaze.php index 3bd02e0b0..c7e08ca36 100644 --- a/Blacklight/processing/tv/TVMaze.php +++ b/Blacklight/processing/tv/TVMaze.php @@ -52,7 +52,7 @@ class TVMaze extends TV * * @param bool $local */ - public function processSite($groupID, $guidChar, $process, $local = false): void + public function processSite($groupID, $guidChar, $process, bool $local = false): void { $res = $this->getTvReleases($groupID, $guidChar, $process, parent::PROCESS_TVMAZE); @@ -216,7 +216,7 @@ class TVMaze extends TV * @param string $cleanName * @return array|false */ - protected function getShowInfo($cleanName) + protected function getShowInfo(string $cleanName) { $return = $response = false; @@ -296,7 +296,7 @@ class TVMaze extends TV * * @param int $videoId -- the local Video ID */ - public function getPoster($videoId): int + public function getPoster(int $videoId): int { $ri = new ReleaseImage(); @@ -326,7 +326,7 @@ class TVMaze extends TV * @param int $videoId * @return array|false */ - protected function getEpisodeInfo($tvMazeId, $season, $episode, $airDate = '', $videoId = 0) + protected function getEpisodeInfo(int $tvMazeId, int $season, int $episode, string $airDate = '', int $videoId = 0) { $return = $response = false; diff --git a/Blacklight/processing/tv/TraktTv.php b/Blacklight/processing/tv/TraktTv.php index 9bd5e870f..2822711c3 100755 --- a/Blacklight/processing/tv/TraktTv.php +++ b/Blacklight/processing/tv/TraktTv.php @@ -67,7 +67,7 @@ class TraktTv extends TV * * @param bool $local */ - public function processSite($groupID, $guidChar, $process, $local = false): void + public function processSite($groupID, $guidChar, $process, bool $local = false): void { $res = $this->getTvReleases($groupID, $guidChar, $process, parent::PROCESS_TRAKT); @@ -202,7 +202,7 @@ class TraktTv extends TV * @param int $episode * @return array|false False on failure, an array of information fields otherwise. */ - public function getEpisodeInfo($siteId, $series, $episode) + public function getEpisodeInfo(int $siteId, int $series, int $episode) { $return = false; @@ -228,7 +228,7 @@ class TraktTv extends TV * * @param int $videoId ID from videos table. */ - public function getPoster($videoId): int + public function getPoster(int $videoId): int { $hascover = 0; $ri = new ReleaseImage(); diff --git a/Blacklight/utility/Country.php b/Blacklight/utility/Country.php index b750c7a31..629efdbe1 100755 --- a/Blacklight/utility/Country.php +++ b/Blacklight/utility/Country.php @@ -35,7 +35,7 @@ class Country * @param string $country * @return mixed */ - public static function countryCode($country) + public static function countryCode(string $country) { if (\strlen($country) > 2) { $code = CountryModel::whereFullName($country)->orWhere('name', $country)->first(['iso_3166_2']); diff --git a/app/Console/Commands/InstallNntmux.php b/app/Console/Commands/InstallNntmux.php index 76e452ffe..1e7322e0e 100644 --- a/app/Console/Commands/InstallNntmux.php +++ b/app/Console/Commands/InstallNntmux.php @@ -35,7 +35,7 @@ class InstallNntmux extends Command parent::__construct(); } - public function handle() + public function handle(): void { $error = false; diff --git a/app/Console/Commands/NntmuxDeleteUnVerifiedUsers.php b/app/Console/Commands/NntmuxDeleteUnVerifiedUsers.php index daed3f240..92672099f 100644 --- a/app/Console/Commands/NntmuxDeleteUnVerifiedUsers.php +++ b/app/Console/Commands/NntmuxDeleteUnVerifiedUsers.php @@ -36,7 +36,7 @@ class NntmuxDeleteUnVerifiedUsers extends Command * * @return mixed */ - public function handle() + public function handle(): void { $this->info('Deleting unverified users.'); User::deleteUnVerified(); diff --git a/app/Console/Commands/NntmuxPopulateSearchIndexes.php b/app/Console/Commands/NntmuxPopulateSearchIndexes.php index 8f41d961a..41ec7b303 100644 --- a/app/Console/Commands/NntmuxPopulateSearchIndexes.php +++ b/app/Console/Commands/NntmuxPopulateSearchIndexes.php @@ -36,7 +36,7 @@ class NntmuxPopulateSearchIndexes extends Command /** * Execute the console command. */ - public function handle() + public function handle(): int { if ($this->option('releases') && $this->option('manticore')) { $this->manticoreReleases(); @@ -146,7 +146,7 @@ class NntmuxPopulateSearchIndexes extends Command /** * @return void */ - private function elasticReleases() + private function elasticReleases(): void { $elastic = new ElasticSearchSiteSearch(); $total = Release::count(); @@ -192,7 +192,7 @@ class NntmuxPopulateSearchIndexes extends Command /** * @return void */ - private function elasticPreDB() + private function elasticPreDB(): void { $elastic = new ElasticSearchSiteSearch(); $total = Predb::count(); diff --git a/app/Console/Commands/NntmuxRemoveBadReleases.php b/app/Console/Commands/NntmuxRemoveBadReleases.php index b9de2d14c..4b5c15bc0 100644 --- a/app/Console/Commands/NntmuxRemoveBadReleases.php +++ b/app/Console/Commands/NntmuxRemoveBadReleases.php @@ -39,7 +39,7 @@ class NntmuxRemoveBadReleases extends Command * * @throws \Exception */ - public function handle() + public function handle(): void { Release::query()->where('passwordstatus', '=', -2)->delete(); diff --git a/app/Console/Commands/NntmuxResetDb.php b/app/Console/Commands/NntmuxResetDb.php index 393e48cf4..f10b4f706 100644 --- a/app/Console/Commands/NntmuxResetDb.php +++ b/app/Console/Commands/NntmuxResetDb.php @@ -38,7 +38,7 @@ class NntmuxResetDb extends Command /** * @throws \Exception */ - public function handle() + public function handle(): void { if ($this->confirm('This script removes all releases, nzb files, samples, previews , nfos, truncates all article tables and resets all groups. Are you sure you want reset the DB?')) { $timestart = now(); diff --git a/app/Console/Commands/NntmuxResetPostProcessing.php b/app/Console/Commands/NntmuxResetPostProcessing.php index 30a121d3a..dd71b8a47 100644 --- a/app/Console/Commands/NntmuxResetPostProcessing.php +++ b/app/Console/Commands/NntmuxResetPostProcessing.php @@ -51,7 +51,7 @@ class NntmuxResetPostProcessing extends Command * * @return mixed */ - public function handle() + public function handle(): void { if (empty($this->option('category'))) { $qry = Release::query()->select(['id'])->get(); diff --git a/app/Console/Commands/NntmuxResetTruncate.php b/app/Console/Commands/NntmuxResetTruncate.php index 969351ec0..c552c376a 100644 --- a/app/Console/Commands/NntmuxResetTruncate.php +++ b/app/Console/Commands/NntmuxResetTruncate.php @@ -36,7 +36,7 @@ class NntmuxResetTruncate extends Command /** * Execute the console command. */ - public function handle() + public function handle(): void { UsenetGroup::query()->update(['first_record' => 0, 'first_record_postdate' => null, 'last_record' => 0, 'last_record_postdate' => null, 'last_updated' => null]); $this->info('Reseting all groups completed.'); diff --git a/app/Console/Commands/NntmuxUpdateExpiredRoles.php b/app/Console/Commands/NntmuxUpdateExpiredRoles.php index b0c73e69a..1491cfa3a 100644 --- a/app/Console/Commands/NntmuxUpdateExpiredRoles.php +++ b/app/Console/Commands/NntmuxUpdateExpiredRoles.php @@ -36,7 +36,7 @@ class NntmuxUpdateExpiredRoles extends Command * * @return mixed */ - public function handle() + public function handle(): void { $this->info('Updating expired roles.'); $this->info('Updating users that will have their roles expire or are already expired'); diff --git a/app/Console/Commands/TmuxUIRestart.php b/app/Console/Commands/TmuxUIRestart.php index 7f0c4f95b..1ca847a2d 100644 --- a/app/Console/Commands/TmuxUIRestart.php +++ b/app/Console/Commands/TmuxUIRestart.php @@ -33,7 +33,7 @@ class TmuxUIRestart extends Command /** * Execute the console command. */ - public function handle() + public function handle(): void { $this->call('tmux-ui:stop', ['--kill' => true]); $this->call('tmux-ui:start'); diff --git a/app/Console/Commands/TmuxUIStart.php b/app/Console/Commands/TmuxUIStart.php index 7ae98456d..8c88066ac 100644 --- a/app/Console/Commands/TmuxUIStart.php +++ b/app/Console/Commands/TmuxUIStart.php @@ -26,7 +26,7 @@ class TmuxUIStart extends Command /** * Execute the console command. */ - public function handle() + public function handle(): void { $tmux = new Tmux(); $tmux_session = Settings::settingValue('site.tmux.tmux_session') ?? 0; diff --git a/app/Console/Commands/TmuxUIStop.php b/app/Console/Commands/TmuxUIStop.php index cfd800ef3..dcf38c865 100644 --- a/app/Console/Commands/TmuxUIStop.php +++ b/app/Console/Commands/TmuxUIStop.php @@ -26,7 +26,7 @@ class TmuxUIStop extends Command /** * @throws \Exception */ - public function handle() + public function handle(): void { $tmux = new Tmux(); $tmux->stopIfRunning(); diff --git a/app/Console/Commands/UpdateNNTmuxDB.php b/app/Console/Commands/UpdateNNTmuxDB.php index 947f428ce..a9f20f917 100644 --- a/app/Console/Commands/UpdateNNTmuxDB.php +++ b/app/Console/Commands/UpdateNNTmuxDB.php @@ -28,7 +28,7 @@ class UpdateNNTmuxDB extends Command parent::__construct(); } - public function handle() + public function handle(): void { // also prevent web access. $this->output->writeln('Updating database'); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 770fec518..95e3759cd 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -22,7 +22,7 @@ class Kernel extends ConsoleKernel * * @return void */ - protected function schedule(Schedule $schedule) + protected function schedule(Schedule $schedule): void { $schedule->command('disposable:update')->weekly(); $schedule->command('clean:directories')->hourly()->withoutOverlapping(); @@ -43,7 +43,7 @@ class Kernel extends ConsoleKernel * * @return void */ - protected function commands() + protected function commands(): void { $this->load(__DIR__.'/Commands'); diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 2fdc1d932..5a80ca0fd 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -31,7 +31,7 @@ class Handler extends ExceptionHandler * * @return void */ - public function register() + public function register(): void { $this->reportable(function (Throwable $e) { if (app()->bound('sentry')) { diff --git a/app/Extensions/util/PhpYenc.php b/app/Extensions/util/PhpYenc.php index 2cb7415ca..52e2db751 100644 --- a/app/Extensions/util/PhpYenc.php +++ b/app/Extensions/util/PhpYenc.php @@ -28,7 +28,7 @@ class PhpYenc /** * @param bool $ignore */ - public static function decode(&$text, $ignore = false): bool|string + public static function decode(&$text, bool $ignore = false): bool|string { $crc = ''; // Extract the yEnc string itself. diff --git a/app/Http/Controllers/Admin/AdminCategoryRegexesController.php b/app/Http/Controllers/Admin/AdminCategoryRegexesController.php index 6f373c326..fc02a6a0c 100644 --- a/app/Http/Controllers/Admin/AdminCategoryRegexesController.php +++ b/app/Http/Controllers/Admin/AdminCategoryRegexesController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Admin; +use Illuminate\Http\RedirectResponse; use App\Http\Controllers\BasePageController; use App\Models\Category; use Blacklight\Regexes; @@ -41,7 +42,7 @@ class AdminCategoryRegexesController extends BasePageController * * @throws \Exception */ - public function edit(Request $request) + public function edit(Request $request): RedirectResponse { $this->setAdminPrefs(); $regexes = new Regexes(['Settings' => null, 'Table_Name' => 'category_regexes']); diff --git a/app/Http/Controllers/Admin/AdminContentController.php b/app/Http/Controllers/Admin/AdminContentController.php index da23cf42c..bea646534 100644 --- a/app/Http/Controllers/Admin/AdminContentController.php +++ b/app/Http/Controllers/Admin/AdminContentController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Admin; +use Illuminate\Http\RedirectResponse; use App\Http\Controllers\BasePageController; use App\Models\User; use Blacklight\Contents; @@ -32,7 +33,7 @@ class AdminContentController extends BasePageController * * @throws \Exception */ - public function create(Request $request) + public function create(Request $request): RedirectResponse { $this->setAdminPrefs(); $contents = new Contents(); diff --git a/app/Http/Controllers/Admin/AdminGroupController.php b/app/Http/Controllers/Admin/AdminGroupController.php index 0a7094811..97b27303b 100644 --- a/app/Http/Controllers/Admin/AdminGroupController.php +++ b/app/Http/Controllers/Admin/AdminGroupController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Admin; +use Illuminate\Http\RedirectResponse; use App\Http\Controllers\BasePageController; use App\Models\UsenetGroup; use Illuminate\Http\Request; @@ -67,7 +68,7 @@ class AdminGroupController extends BasePageController * * @throws \Exception */ - public function edit(Request $request) + public function edit(Request $request): RedirectResponse { $this->setAdminPrefs(); diff --git a/app/Http/Controllers/Admin/AdminMovieController.php b/app/Http/Controllers/Admin/AdminMovieController.php index 10c50550b..789abc7de 100644 --- a/app/Http/Controllers/Admin/AdminMovieController.php +++ b/app/Http/Controllers/Admin/AdminMovieController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Admin; +use Illuminate\Http\RedirectResponse; use App\Http\Controllers\BasePageController; use App\Models\MovieInfo; use App\Models\Release; @@ -35,7 +36,7 @@ class AdminMovieController extends BasePageController * * @throws \Exception */ - public function create(Request $request) + public function create(Request $request): RedirectResponse { if (! \defined('STDOUT')) { \define('STDOUT', fopen('php://stdout', 'wb')); diff --git a/app/Http/Controllers/Admin/AdminReleasesController.php b/app/Http/Controllers/Admin/AdminReleasesController.php index d2c20ff53..cf70e7f24 100644 --- a/app/Http/Controllers/Admin/AdminReleasesController.php +++ b/app/Http/Controllers/Admin/AdminReleasesController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Admin; +use Illuminate\Http\RedirectResponse; use App\Http\Controllers\BasePageController; use App\Models\Category; use App\Models\Release; @@ -34,7 +35,7 @@ class AdminReleasesController extends BasePageController * * @throws \Exception */ - public function edit(Request $request) + public function edit(Request $request): RedirectResponse { $this->setAdminPrefs(); $meta_title = $title = 'Release Edit'; diff --git a/app/Http/Controllers/Admin/AdminUserController.php b/app/Http/Controllers/Admin/AdminUserController.php index 6bbd17c70..3fbdb8489 100644 --- a/app/Http/Controllers/Admin/AdminUserController.php +++ b/app/Http/Controllers/Admin/AdminUserController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Admin; +use Illuminate\Http\RedirectResponse; use App\Http\Controllers\BasePageController; use App\Jobs\SendAccountChangedEmail; use App\Models\Invitation; @@ -79,7 +80,7 @@ class AdminUserController extends BasePageController * * @throws \Exception */ - public function edit(Request $request) + public function edit(Request $request): RedirectResponse { $this->setAdminPrefs(); diff --git a/app/Http/Controllers/Api/ApiV2Controller.php b/app/Http/Controllers/Api/ApiV2Controller.php index a9583bfad..66a8cd0d0 100644 --- a/app/Http/Controllers/Api/ApiV2Controller.php +++ b/app/Http/Controllers/Api/ApiV2Controller.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Api; +use Illuminate\Http\RedirectResponse; use App\Events\UserAccessedApi; use App\Http\Controllers\BasePageController; use App\Models\Category; @@ -245,7 +246,7 @@ class ApiV2Controller extends BasePageController /** * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|void */ - public function getNzb(Request $request) + public function getNzb(Request $request): RedirectResponse { $user = User::query()->where('api_token', $request->input('api_token'))->first(); event(new UserAccessedApi($user)); diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index d27e0139a..482adc1de 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Auth; +use Illuminate\Http\RedirectResponse; use App\Http\Requests\Auth\LoginLoginRequest; use App\Events\UserLoggedIn; use App\Http\Controllers\Controller; @@ -54,7 +55,7 @@ class LoginController extends Controller * @throws \Illuminate\Auth\AuthenticationException * @throws \Illuminate\Validation\ValidationException */ - public function login(LoginLoginRequest $request) + public function login(LoginLoginRequest $request): RedirectResponse { $validator = Validator::make($request->all(), [ 'username' => ['required'], diff --git a/app/Http/Controllers/BasePageController.php b/app/Http/Controllers/BasePageController.php index aa1e0836d..93881954f 100644 --- a/app/Http/Controllers/BasePageController.php +++ b/app/Http/Controllers/BasePageController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\View\View; use Illuminate\Http\Request; use App\Events\UserLoggedIn; use App\Models\Category; @@ -118,7 +119,7 @@ class BasePageController extends Controller * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ - public function show404($message = null) + public function show404($message = null): View { if ($message !== null) { return view('errors.404')->with('Message', $message); @@ -130,7 +131,7 @@ class BasePageController extends Controller /** * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ - public function show403() + public function show403(): View { return view('errors.403'); } @@ -138,7 +139,7 @@ class BasePageController extends Controller /** * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ - public function show503() + public function show503(): View { return view('errors.503')->with('Error', 'Service temporarily unavailable'); } @@ -146,7 +147,7 @@ class BasePageController extends Controller /** * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ - public function showBadBoy() + public function showBadBoy(): View { return view('errors.badboy')->with('Message', 'This is not you account.'); } @@ -154,7 +155,7 @@ class BasePageController extends Controller /** * Show maintenance page. */ - public function showMaintenance() + public function showMaintenance(): View { return view('errors.maintenance')->with('Message', 'We are performing an site maintenance.'); } @@ -162,7 +163,7 @@ class BasePageController extends Controller /** * Show Security token mismatch page. */ - public function showTokenError() + public function showTokenError(): View { return view('errors.tokenError')->with('Error', 'Token mismatch'); } @@ -170,7 +171,7 @@ class BasePageController extends Controller /** * @param string $retry */ - public function show429($retry = '') + public function show429(string $retry = '') { abort(429, $retry); } diff --git a/app/Http/Controllers/ContentController.php b/app/Http/Controllers/ContentController.php index 3d6f04c2f..274a157a4 100644 --- a/app/Http/Controllers/ContentController.php +++ b/app/Http/Controllers/ContentController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\JsonResponse; use Blacklight\Contents; use Illuminate\Http\Request; @@ -12,7 +13,7 @@ class ContentController extends BasePageController * * @throws \Exception */ - public function show(Request $request) + public function show(Request $request): JsonResponse { $this->setPreferences(); $contents = new Contents(); diff --git a/app/Http/Controllers/DetailsController.php b/app/Http/Controllers/DetailsController.php index 71ffc7454..bb7e37e20 100644 --- a/app/Http/Controllers/DetailsController.php +++ b/app/Http/Controllers/DetailsController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use App\Models\DnzbFailure; use App\Models\Predb; @@ -30,7 +31,7 @@ class DetailsController extends BasePageController * * @throws \Exception */ - public function show(Request $request, string $guid) + public function show(Request $request, string $guid): RedirectResponse { $this->setPreferences(); diff --git a/app/Http/Controllers/ForumController.php b/app/Http/Controllers/ForumController.php index 4886b1848..29896d65d 100644 --- a/app/Http/Controllers/ForumController.php +++ b/app/Http/Controllers/ForumController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\RedirectResponse; use App\Models\Forumpost; use App\Models\Settings; use Illuminate\Http\Request; @@ -14,7 +15,7 @@ class ForumController extends BasePageController * * @throws \Exception */ - public function forum(Request $request) + public function forum(Request $request): RedirectResponse { $this->setPreferences(); if ($this->isPostBack() && $request->has('addMessage') && $request->has('addSubject')) { @@ -68,7 +69,7 @@ class ForumController extends BasePageController * * @throws \Exception */ - public function getPosts($id, Request $request) + public function getPosts($id, Request $request): RedirectResponse { $this->setPreferences(); diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index baeb6840a..84532da49 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use Illuminate\Http\RedirectResponse; use App\Jobs\SendAccountDeletedEmail; use App\Models\ReleaseComment; use App\Models\Settings; @@ -103,7 +104,7 @@ class ProfileController extends BasePageController * * @throws \Exception */ - public function edit(Request $request) + public function edit(Request $request): RedirectResponse { $this->setPreferences(); diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index a4be5c587..c988da987 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware; +use Illuminate\Http\Request; use Illuminate\Auth\Middleware\Authenticate as Middleware; class Authenticate extends Middleware @@ -12,7 +13,7 @@ class Authenticate extends Middleware * @param \Illuminate\Http\Request $request * @return string */ - protected function redirectTo($request) + protected function redirectTo(Request $request): string { if (! $request->expectsJson()) { return route('login'); diff --git a/app/Http/Middleware/ClearanceMiddleware.php b/app/Http/Middleware/ClearanceMiddleware.php index 0f3e9ae91..732b3c2fa 100644 --- a/app/Http/Middleware/ClearanceMiddleware.php +++ b/app/Http/Middleware/ClearanceMiddleware.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use Closure; use Illuminate\Support\Facades\Auth; @@ -15,7 +17,7 @@ class ClearanceMiddleware * * @throws \Exception */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { $user = $request->user(); diff --git a/app/Http/Middleware/Google2FAMiddleware.php b/app/Http/Middleware/Google2FAMiddleware.php index 64da0ad2b..02855853d 100644 --- a/app/Http/Middleware/Google2FAMiddleware.php +++ b/app/Http/Middleware/Google2FAMiddleware.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use App\Support\Google2FAAuthenticator; use Closure; @@ -13,7 +15,7 @@ class Google2FAMiddleware * @param \Illuminate\Http\Request $request * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next): Response { $authenticator = app(Google2FAAuthenticator::class)->boot($request); diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 81947b2bc..c16f28a64 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -2,6 +2,8 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; +use Illuminate\Http\Request; use Closure; use Illuminate\Support\Facades\Auth; @@ -14,7 +16,7 @@ class RedirectIfAuthenticated * @param string|null $guard * @return mixed */ - public function handle($request, Closure $next, $guard = null) + public function handle(Request $request, Closure $next, ?string $guard = null): Response { if (Auth::guard($guard)->check()) { return redirect()->to('/'); diff --git a/app/Http/Requests/Auth/LoginLoginRequest.php b/app/Http/Requests/Auth/LoginLoginRequest.php index 0f6dfd9ee..b68fe8b84 100644 --- a/app/Http/Requests/Auth/LoginLoginRequest.php +++ b/app/Http/Requests/Auth/LoginLoginRequest.php @@ -11,7 +11,7 @@ class LoginLoginRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return [ 'g-recaptcha-response' => [ diff --git a/app/Http/Requests/Auth/RegisterRegisterRequest.php b/app/Http/Requests/Auth/RegisterRegisterRequest.php index f6c29b3c6..b0e3a8698 100644 --- a/app/Http/Requests/Auth/RegisterRegisterRequest.php +++ b/app/Http/Requests/Auth/RegisterRegisterRequest.php @@ -11,7 +11,7 @@ class RegisterRegisterRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return [ 'g-recaptcha-response' => [ diff --git a/app/Http/Requests/Auth/ShowLinkRequestFormForgotPasswordRequest.php b/app/Http/Requests/Auth/ShowLinkRequestFormForgotPasswordRequest.php index 31d6b537b..24f5c4224 100644 --- a/app/Http/Requests/Auth/ShowLinkRequestFormForgotPasswordRequest.php +++ b/app/Http/Requests/Auth/ShowLinkRequestFormForgotPasswordRequest.php @@ -11,7 +11,7 @@ class ShowLinkRequestFormForgotPasswordRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return ['g-recaptcha-response' => [ 'required', diff --git a/app/Http/Requests/ContactContactURequest.php b/app/Http/Requests/ContactContactURequest.php index 5dd48e8d5..4d9ffdc0a 100644 --- a/app/Http/Requests/ContactContactURequest.php +++ b/app/Http/Requests/ContactContactURequest.php @@ -11,7 +11,7 @@ class ContactContactURequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return ['g-recaptcha-response' => [ 'required', diff --git a/app/Http/Requests/Disable2faPasswordSecurityRequest.php b/app/Http/Requests/Disable2faPasswordSecurityRequest.php index a0bb1a7e0..f8843584d 100644 --- a/app/Http/Requests/Disable2faPasswordSecurityRequest.php +++ b/app/Http/Requests/Disable2faPasswordSecurityRequest.php @@ -11,7 +11,7 @@ class Disable2faPasswordSecurityRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return ['current-password' => [ 'required', diff --git a/app/Jobs/RemoveInactiveAccounts.php b/app/Jobs/RemoveInactiveAccounts.php index c293586a3..3ba07b487 100644 --- a/app/Jobs/RemoveInactiveAccounts.php +++ b/app/Jobs/RemoveInactiveAccounts.php @@ -28,7 +28,7 @@ class RemoveInactiveAccounts implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { User::query()->where('lastlogin', '<', now()->subMonths(6))->where('apiaccess', '<', now()->subMonths(6))->where('roles_id', '=', 1)->delete(); User::query()->where('lastlogin', '<', now()->subMonths(6))->whereNull('apiaccess')->where('roles_id', '=', 1)->delete(); diff --git a/app/Jobs/SendAccountChangedEmail.php b/app/Jobs/SendAccountChangedEmail.php index 8e29d55db..9b3f5b543 100644 --- a/app/Jobs/SendAccountChangedEmail.php +++ b/app/Jobs/SendAccountChangedEmail.php @@ -2,6 +2,7 @@ namespace App\Jobs; +use App\Models\User; use App\Mail\AccountChange; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -24,7 +25,7 @@ class SendAccountChangedEmail implements ShouldQueue * * @param \App\Models\User $user */ - public function __construct($user) + public function __construct(User $user) { $this->user = $user; } @@ -34,7 +35,7 @@ class SendAccountChangedEmail implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { Mail::to($this->user->email)->send(new AccountChange($this->user)); } diff --git a/app/Jobs/SendAccountDeletedEmail.php b/app/Jobs/SendAccountDeletedEmail.php index cec9824d2..47ff2fb20 100644 --- a/app/Jobs/SendAccountDeletedEmail.php +++ b/app/Jobs/SendAccountDeletedEmail.php @@ -2,6 +2,7 @@ namespace App\Jobs; +use App\Models\User; use App\Mail\AccountDeleted; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -24,7 +25,7 @@ class SendAccountDeletedEmail implements ShouldQueue * * @param \App\Models\User $user */ - public function __construct($user) + public function __construct(User $user) { $this->user = $user; } @@ -34,7 +35,7 @@ class SendAccountDeletedEmail implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { Mail::to(config('mail.from.address'))->send(new AccountDeleted($this->user)); } diff --git a/app/Jobs/SendAccountExpiredEmail.php b/app/Jobs/SendAccountExpiredEmail.php index c92d41035..f84710ca1 100644 --- a/app/Jobs/SendAccountExpiredEmail.php +++ b/app/Jobs/SendAccountExpiredEmail.php @@ -2,6 +2,7 @@ namespace App\Jobs; +use App\Models\User; use App\Mail\AccountExpired; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -24,7 +25,7 @@ class SendAccountExpiredEmail implements ShouldQueue * * @param \App\Models\User $user */ - public function __construct($user) + public function __construct(User $user) { $this->user = $user; } @@ -34,7 +35,7 @@ class SendAccountExpiredEmail implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { Mail::to($this->user->email)->send(new AccountExpired($this->user)); } diff --git a/app/Jobs/SendAccountWillExpireEmail.php b/app/Jobs/SendAccountWillExpireEmail.php index 7f6651aa1..27a66fffe 100644 --- a/app/Jobs/SendAccountWillExpireEmail.php +++ b/app/Jobs/SendAccountWillExpireEmail.php @@ -34,7 +34,7 @@ class SendAccountWillExpireEmail implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { Mail::to($this->user->email)->send(new AccountWillExpire($this->user, $this->days)); } diff --git a/app/Jobs/SendContactUsEmail.php b/app/Jobs/SendContactUsEmail.php index 07aa35749..140e9ad86 100644 --- a/app/Jobs/SendContactUsEmail.php +++ b/app/Jobs/SendContactUsEmail.php @@ -30,7 +30,7 @@ class SendContactUsEmail implements ShouldQueue $this->mailBody = $mailBody; } - public function handle() + public function handle(): void { Mail::to($this->mailTo)->send(new ContactUs($this->email, $this->mailBody)); } diff --git a/app/Jobs/SendInviteEmail.php b/app/Jobs/SendInviteEmail.php index 9a1bc40ce..1c8f8effe 100644 --- a/app/Jobs/SendInviteEmail.php +++ b/app/Jobs/SendInviteEmail.php @@ -40,7 +40,7 @@ class SendInviteEmail implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { Mail::to($this->email)->send(new SendInvite($this->user, $this->url)); } diff --git a/app/Jobs/SendNewRegisteredAccountMail.php b/app/Jobs/SendNewRegisteredAccountMail.php index 8c9730d2c..88de686c7 100644 --- a/app/Jobs/SendNewRegisteredAccountMail.php +++ b/app/Jobs/SendNewRegisteredAccountMail.php @@ -2,6 +2,7 @@ namespace App\Jobs; +use App\Models\User; use App\Mail\NewAccountCreatedEmail; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -24,7 +25,7 @@ class SendNewRegisteredAccountMail implements ShouldQueue * * @param \App\Models\User $user */ - public function __construct($user) + public function __construct(User $user) { $this->user = $user; } @@ -34,7 +35,7 @@ class SendNewRegisteredAccountMail implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { Mail::to(config('mail.from.address'))->send(new NewAccountCreatedEmail($this->user)); } diff --git a/app/Jobs/SendPasswordForgottenEmail.php b/app/Jobs/SendPasswordForgottenEmail.php index 459e3c75e..a3e5dc8c6 100644 --- a/app/Jobs/SendPasswordForgottenEmail.php +++ b/app/Jobs/SendPasswordForgottenEmail.php @@ -2,6 +2,7 @@ namespace App\Jobs; +use App\Models\User; use App\Mail\ForgottenPassword; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -26,7 +27,7 @@ class SendPasswordForgottenEmail implements ShouldQueue * * @param \App\Models\User $user */ - public function __construct($user, $resetLink) + public function __construct(User $user, $resetLink) { $this->user = $user; $this->resetLink = $resetLink; @@ -37,7 +38,7 @@ class SendPasswordForgottenEmail implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { Mail::to($this->user->email)->send(new ForgottenPassword($this->resetLink)); } diff --git a/app/Jobs/SendPasswordResetEmail.php b/app/Jobs/SendPasswordResetEmail.php index d24b73c2c..1d42530c9 100644 --- a/app/Jobs/SendPasswordResetEmail.php +++ b/app/Jobs/SendPasswordResetEmail.php @@ -2,6 +2,7 @@ namespace App\Jobs; +use App\Models\User; use App\Mail\PasswordReset; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -30,7 +31,7 @@ class SendPasswordResetEmail implements ShouldQueue * @param \App\Models\User $user * @param string $newPass */ - public function __construct($user, $newPass) + public function __construct(User $user, string $newPass) { $this->user = $user; $this->newPass = $newPass; @@ -41,7 +42,7 @@ class SendPasswordResetEmail implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { Mail::to($this->user->email)->send(new PasswordReset($this->user, $this->newPass)); } diff --git a/app/Jobs/SendWelcomeEmail.php b/app/Jobs/SendWelcomeEmail.php index 965359419..04042ad62 100644 --- a/app/Jobs/SendWelcomeEmail.php +++ b/app/Jobs/SendWelcomeEmail.php @@ -2,6 +2,7 @@ namespace App\Jobs; +use App\Models\User; use App\Mail\WelcomeEmail; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -24,7 +25,7 @@ class SendWelcomeEmail implements ShouldQueue * * @param \App\Models\User $user */ - public function __construct($user) + public function __construct(User $user) { $this->user = $user; } @@ -34,7 +35,7 @@ class SendWelcomeEmail implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { Mail::to($this->user->email)->send(new WelcomeEmail($this->user)); } diff --git a/app/Listeners/UpdateUserAccessedApi.php b/app/Listeners/UpdateUserAccessedApi.php index 2175db2d4..7ee05520d 100644 --- a/app/Listeners/UpdateUserAccessedApi.php +++ b/app/Listeners/UpdateUserAccessedApi.php @@ -22,7 +22,7 @@ class UpdateUserAccessedApi * * @return void */ - public function handle(UserAccessedApi $event) + public function handle(UserAccessedApi $event): void { User::find($event->user->id)->update(['apiaccess' => now()]); } diff --git a/app/Listeners/UpdateUserLoggedIn.php b/app/Listeners/UpdateUserLoggedIn.php index 1235a54ee..3d45c696a 100644 --- a/app/Listeners/UpdateUserLoggedIn.php +++ b/app/Listeners/UpdateUserLoggedIn.php @@ -22,7 +22,7 @@ class UpdateUserLoggedIn * * @return void */ - public function handle(UserLoggedIn $event) + public function handle(UserLoggedIn $event): void { User::find($event->user->id)->update( [ diff --git a/app/Mail/AccountChange.php b/app/Mail/AccountChange.php index 6600f5d52..0353246ae 100644 --- a/app/Mail/AccountChange.php +++ b/app/Mail/AccountChange.php @@ -2,6 +2,7 @@ namespace App\Mail; +use App\Models\User; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; @@ -30,7 +31,7 @@ class AccountChange extends Mailable * * @param \App\Models\User $user */ - public function __construct($user) + public function __construct(User $user) { $this->user = $user; $this->siteEmail = config('mail.from.address'); @@ -44,7 +45,7 @@ class AccountChange extends Mailable * * @throws \Exception */ - public function build() + public function build(): static { return $this->from($this->siteEmail)->subject('Account Changed')->view('emails.accountChange')->with(['account' => $this->user->role->name, 'username' => $this->user->username, 'site' => $this->siteTitle]); } diff --git a/app/Mail/AccountDeleted.php b/app/Mail/AccountDeleted.php index 7f79ced8e..7d09e17ff 100644 --- a/app/Mail/AccountDeleted.php +++ b/app/Mail/AccountDeleted.php @@ -40,7 +40,7 @@ class AccountDeleted extends Mailable * * @throws \Exception */ - public function build() + public function build(): static { return $this->from($this->siteEmail)->subject('User Account Deleted')->view('emails.accountDelete')->with(['username' => $this->user->username, 'site' => $this->siteTitle]); } diff --git a/app/Mail/AccountExpired.php b/app/Mail/AccountExpired.php index fea7aed6f..7b7f10318 100644 --- a/app/Mail/AccountExpired.php +++ b/app/Mail/AccountExpired.php @@ -33,7 +33,7 @@ class AccountExpired extends Mailable * * @throws \Exception */ - public function build() + public function build(): static { return $this->from($this->siteEmail)->subject('Account expired')->view('emails.accountExpired')->with(['account' => $this->user->role->name, 'username' => $this->user->username, 'site' => $this->siteTitle]); } diff --git a/app/Mail/AccountWillExpire.php b/app/Mail/AccountWillExpire.php index 6e3ecb3ea..45a2b7b8d 100644 --- a/app/Mail/AccountWillExpire.php +++ b/app/Mail/AccountWillExpire.php @@ -42,7 +42,7 @@ class AccountWillExpire extends Mailable * * @return $this */ - public function build() + public function build(): static { return $this->from($this->siteEmail)->subject('Account about to expire')->view('emails.accountAboutToExpire')->with(['account' => $this->user->role->name, 'username' => $this->user->username, 'site' => $this->siteTitle, 'days' => $this->days]); } diff --git a/app/Mail/ContactUs.php b/app/Mail/ContactUs.php index cb30b11d2..9d0edbd57 100644 --- a/app/Mail/ContactUs.php +++ b/app/Mail/ContactUs.php @@ -30,7 +30,7 @@ class ContactUs extends Mailable * * @throws \Exception */ - public function build() + public function build(): static { return $this->from($this->mailFrom)->subject('Contact form submitted')->replyTo($this->mailFrom)->view('emails.contactUs')->with(['mailBody' => $this->mailBody]); } diff --git a/app/Mail/ForgottenPassword.php b/app/Mail/ForgottenPassword.php index 3e29cc325..3e43fe1eb 100644 --- a/app/Mail/ForgottenPassword.php +++ b/app/Mail/ForgottenPassword.php @@ -41,7 +41,7 @@ class ForgottenPassword extends Mailable * * @throws \Exception */ - public function build() + public function build(): static { return $this->from($this->siteEmail)->subject('Forgotten password reset')->view('emails.forgottenPassword')->with(['resetLink' => $this->resetLink, 'site' => $this->siteTitle]); } diff --git a/app/Mail/NewAccountCreatedEmail.php b/app/Mail/NewAccountCreatedEmail.php index 32c300b87..f7c1a16b4 100644 --- a/app/Mail/NewAccountCreatedEmail.php +++ b/app/Mail/NewAccountCreatedEmail.php @@ -42,7 +42,7 @@ class NewAccountCreatedEmail extends Mailable * * @return $this */ - public function build() + public function build(): static { return $this->from($this->siteEmail)->subject('New account registered')->view('emails.newAccountCreated')->with(['username' => $this->user->username, 'site' => $this->siteTitle]); } diff --git a/app/Mail/PasswordReset.php b/app/Mail/PasswordReset.php index b2a474821..16eebb83c 100644 --- a/app/Mail/PasswordReset.php +++ b/app/Mail/PasswordReset.php @@ -2,6 +2,7 @@ namespace App\Mail; +use App\Models\User; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; @@ -35,7 +36,7 @@ class PasswordReset extends Mailable * * @param \App\Models\User $user */ - public function __construct($user, $newPass) + public function __construct(User $user, $newPass) { $this->user = $user; $this->newPass = $newPass; @@ -50,7 +51,7 @@ class PasswordReset extends Mailable * * @throws \Exception */ - public function build() + public function build(): static { return $this->from($this->siteEmail)->subject('Password reset')->view('emails.passwordReset')->with(['newPass' => $this->newPass, 'userName' => $this->user->username, 'site' => $this->siteTitle]); } diff --git a/app/Mail/SendInvite.php b/app/Mail/SendInvite.php index c5790bf28..15c122968 100644 --- a/app/Mail/SendInvite.php +++ b/app/Mail/SendInvite.php @@ -2,6 +2,7 @@ namespace App\Mail; +use App\Models\User; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; @@ -35,7 +36,7 @@ class SendInvite extends Mailable * * @param \App\Models\User $user */ - public function __construct($user, $invite) + public function __construct(User $user, $invite) { $this->user = $user; $this->invite = $invite; @@ -50,7 +51,7 @@ class SendInvite extends Mailable * * @throws \Exception */ - public function build() + public function build(): static { return $this->from($this->siteEmail)->subject('Invite received')->view('emails.sendinvite')->with(['invite' => $this->invite, 'username' => $this->user['username'], 'site' => $this->siteTitle, 'email' => $this->user['email']]); } diff --git a/app/Mail/WelcomeEmail.php b/app/Mail/WelcomeEmail.php index c835b154d..3828d06c2 100644 --- a/app/Mail/WelcomeEmail.php +++ b/app/Mail/WelcomeEmail.php @@ -2,6 +2,7 @@ namespace App\Mail; +use App\Models\User; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; @@ -30,7 +31,7 @@ class WelcomeEmail extends Mailable * * @param \App\Models\User $user */ - public function __construct($user) + public function __construct(User $user) { $this->user = $user; $this->siteEmail = config('mail.from.address'); @@ -42,7 +43,7 @@ class WelcomeEmail extends Mailable * * @return $this */ - public function build() + public function build(): static { return $this->from($this->siteEmail)->subject('Welcome to '.$this->siteTitle)->view('emails.welcome')->with(['username' => $this->user->username, 'site' => $this->siteTitle]); } diff --git a/app/Models/AnidbInfo.php b/app/Models/AnidbInfo.php index 47e89ef38..e1cda2f82 100644 --- a/app/Models/AnidbInfo.php +++ b/app/Models/AnidbInfo.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Model; /** @@ -78,7 +79,7 @@ class AnidbInfo extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function title() + public function title(): BelongsTo { return $this->belongsTo(AnidbTitle::class, 'anidbid'); } @@ -86,7 +87,7 @@ class AnidbInfo extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function episode() + public function episode(): BelongsTo { return $this->belongsTo(AnidbEpisode::class, 'anidbid'); } diff --git a/app/Models/BookInfo.php b/app/Models/BookInfo.php index b6ad7e1f6..5750d4ee9 100644 --- a/app/Models/BookInfo.php +++ b/app/Models/BookInfo.php @@ -70,7 +70,7 @@ class BookInfo extends Model /** * @return string */ - public function searchableAs() + public function searchableAs(): string { return 'ix_bookinfo_author_title_ft'; } @@ -78,7 +78,7 @@ class BookInfo extends Model /** * @return array */ - public function toSearchableArray() + public function toSearchableArray(): array { return [ 'author' => $this->author, diff --git a/app/Models/Category.php b/app/Models/Category.php index 516512523..ea5bae8a4 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -270,7 +270,7 @@ class Category extends Model /** * @return HasMany */ - public function releases() + public function releases(): HasMany { return $this->hasMany(Release::class, 'categories_id'); } @@ -278,7 +278,7 @@ class Category extends Model /** * @return BelongsTo */ - public function parent() + public function parent(): BelongsTo { return $this->belongsTo(RootCategory::class, 'root_categories_id'); } @@ -311,7 +311,7 @@ class Category extends Model /** * @return string */ - public static function getCategorySearch(array $cat = []) + public static function getCategorySearch(array $cat = []): string { $categories = []; // If multiple categories were sent in a single array position, slice and add them diff --git a/app/Models/Forumpost.php b/app/Models/Forumpost.php index f95f498d8..62507fd87 100644 --- a/app/Models/Forumpost.php +++ b/app/Models/Forumpost.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Database\Eloquent\Model; /** @@ -59,7 +60,7 @@ class Forumpost extends Model * @param int $sticky * @param int $replies */ - public static function add($parentId, $userid, $subject, $message, $locked = 0, $sticky = 0, $replies = 0): int + public static function add($parentId, $userid, $subject, $message, int $locked = 0, int $sticky = 0, int $replies = 0): int { if ($message === '') { return -1; @@ -140,7 +141,7 @@ class Forumpost extends Model * @param $start * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ - public static function getBrowseRange() + public static function getBrowseRange(): LengthAwarePaginator { return self::query() ->where('forumpost.parentid', '=', 0) diff --git a/app/Models/GamesInfo.php b/app/Models/GamesInfo.php index 58148a76e..db99cb0a1 100644 --- a/app/Models/GamesInfo.php +++ b/app/Models/GamesInfo.php @@ -68,7 +68,7 @@ class GamesInfo extends Model /** * @return string */ - public function searchableAs() + public function searchableAs(): string { return 'ix_title_ft'; } @@ -76,7 +76,7 @@ class GamesInfo extends Model /** * @return array */ - public function toSearchableArray() + public function toSearchableArray(): array { return [ 'title' => $this->title, diff --git a/app/Models/MusicInfo.php b/app/Models/MusicInfo.php index 744fe4019..1a9b6fdd2 100644 --- a/app/Models/MusicInfo.php +++ b/app/Models/MusicInfo.php @@ -79,7 +79,7 @@ class MusicInfo extends Model /** * @return string */ - public function searchableAs() + public function searchableAs(): string { return 'ix_musicinfo_artist_title_ft'; } @@ -87,7 +87,7 @@ class MusicInfo extends Model /** * @return array */ - public function toSearchableArray() + public function toSearchableArray(): array { return [ 'artist' => $this->artist, diff --git a/app/Models/Predb.php b/app/Models/Predb.php index 7393c584e..dad3f083a 100644 --- a/app/Models/Predb.php +++ b/app/Models/Predb.php @@ -155,7 +155,7 @@ class Predb extends Model * @param string $cleanerName * @return array|false Array with title/id from PreDB if found, false if not found. */ - public static function matchPre($cleanerName) + public static function matchPre(string $cleanerName) { if (empty($cleanerName)) { return false; @@ -189,7 +189,7 @@ class Predb extends Model * * @throws \Exception */ - public static function getAll($search = '') + public static function getAll(string $search = '') { $expiresAt = now()->addMinutes(config('nntmux.cache_expiry_medium')); $predb = Cache::get(md5($search)); @@ -238,7 +238,7 @@ class Predb extends Model /** * @return string */ - public function searchableAs() + public function searchableAs(): string { return 'ft_predb_filename'; } @@ -246,7 +246,7 @@ class Predb extends Model /** * @return array */ - public function toSearchableArray() + public function toSearchableArray(): array { return [ 'filename' => $this->filename, diff --git a/app/Models/PredbHash.php b/app/Models/PredbHash.php index f837bcccc..1eff85fe1 100644 --- a/app/Models/PredbHash.php +++ b/app/Models/PredbHash.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Model; /** @@ -50,7 +51,7 @@ class PredbHash extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function predb() + public function predb(): BelongsTo { return $this->belongsTo(Predb::class, 'predb_id'); } diff --git a/app/Models/Release.php b/app/Models/Release.php index 3262bc032..7910a2b75 100644 --- a/app/Models/Release.php +++ b/app/Models/Release.php @@ -2,6 +2,10 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Blacklight\ElasticSearchSiteSearch; use Blacklight\ManticoreSearch; use Blacklight\NZB; @@ -163,7 +167,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function group() + public function group(): BelongsTo { return $this->belongsTo(UsenetGroup::class, 'groups_id'); } @@ -171,7 +175,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function download() + public function download(): HasMany { return $this->hasMany(UserDownload::class, 'releases_id'); } @@ -179,7 +183,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function userRelease() + public function userRelease(): HasMany { return $this->hasMany(UsersRelease::class, 'releases_id'); } @@ -192,7 +196,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function category() + public function category(): BelongsTo { return $this->belongsTo(Category::class, 'categories_id'); } @@ -200,7 +204,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function predb() + public function predb(): BelongsTo { return $this->belongsTo(Predb::class, 'predb_id'); } @@ -208,7 +212,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function failed() + public function failed(): HasMany { return $this->hasMany(DnzbFailure::class, 'release_id'); } @@ -216,7 +220,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function releaseExtra() + public function releaseExtra(): HasMany { return $this->hasMany(ReleaseExtraFull::class, 'releases_id'); } @@ -224,7 +228,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasOne */ - public function nfo() + public function nfo(): HasOne { return $this->hasOne(ReleaseNfo::class, 'releases_id'); } @@ -232,7 +236,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function comment() + public function comment(): HasMany { return $this->hasMany(ReleaseComment::class, 'releases_id'); } @@ -240,7 +244,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function releaseGroup() + public function releaseGroup(): HasMany { return $this->hasMany(ReleasesGroups::class, 'releases_id'); } @@ -248,7 +252,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function video() + public function video(): BelongsTo { return $this->belongsTo(Video::class, 'videos_id'); } @@ -256,7 +260,7 @@ class Release extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function episode() + public function episode(): BelongsTo { return $this->belongsTo(TvEpisode::class, 'tv_episodes_id'); } @@ -345,7 +349,7 @@ class Release extends Model * * @throws \Exception */ - public static function updateGrab($guid): void + public static function updateGrab(string $guid): void { $updateGrabs = ((int) Settings::settingValue('..grabstatus') !== 0); if ($updateGrabs) { @@ -541,7 +545,7 @@ class Release extends Model * * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ - public static function getFailedRange() + public static function getFailedRange(): LengthAwarePaginator { $failedList = self::query() ->select(['name', 'searchname', 'size', 'guid', 'totalpart', 'postdate', 'adddate', 'grabs', 'cp.title as parent_category', 'c.title as sub_category', DB::raw("CONCAT(cp.title, ' > ', c.title) AS category_name")]) diff --git a/app/Models/ReleaseComment.php b/app/Models/ReleaseComment.php index 055168152..24b064f03 100644 --- a/app/Models/ReleaseComment.php +++ b/app/Models/ReleaseComment.php @@ -2,6 +2,8 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Database\Eloquent\Model; /** @@ -68,7 +70,7 @@ class ReleaseComment extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function release() + public function release(): BelongsTo { return $this->belongsTo(Release::class, 'releases_id'); } @@ -76,7 +78,7 @@ class ReleaseComment extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo(User::class, 'users_id'); } @@ -95,7 +97,7 @@ class ReleaseComment extends Model /** * @return array */ - public static function getComments($id) + public static function getComments($id): array { return self::query()->where('releases_id', $id)->orderByDesc('created_at')->get()->toArray(); } @@ -157,7 +159,7 @@ class ReleaseComment extends Model * * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ - public static function getCommentsRange() + public static function getCommentsRange(): LengthAwarePaginator { $range = self::query() ->select(['release_comments.*', 'releases.guid']) @@ -189,7 +191,7 @@ class ReleaseComment extends Model /** * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ - public static function getCommentsForUserRange($uid) + public static function getCommentsForUserRange($uid): LengthAwarePaginator { return self::query() ->select(['release_comments.*', 'r.guid', 'r.searchname', 'u.username']) diff --git a/app/Models/ReleaseFile.php b/app/Models/ReleaseFile.php index cc2da8e89..a183daa4a 100644 --- a/app/Models/ReleaseFile.php +++ b/app/Models/ReleaseFile.php @@ -90,7 +90,7 @@ class ReleaseFile extends Model * * @throws \Exception */ - public static function addReleaseFiles($id, $name, $size, $createdTime, $hasPassword, $hash = '', $crc = ''): int + public static function addReleaseFiles($id, $name, $size, $createdTime, $hasPassword, string $hash = '', string $crc = ''): int { // Check if we already have this data in table $duplicateCheck = self::query()->where('releases_id', $id)->where('name', $name)->first(); diff --git a/app/Models/ReleaseNfo.php b/app/Models/ReleaseNfo.php index d17c3f721..5e70741be 100644 --- a/app/Models/ReleaseNfo.php +++ b/app/Models/ReleaseNfo.php @@ -48,7 +48,7 @@ class ReleaseNfo extends Model * @param bool $getNfoString * @return \Illuminate\Database\Eloquent\Model|null|static */ - public static function getReleaseNfo($id, $getNfoString = true) + public static function getReleaseNfo($id, bool $getNfoString = true) { $nfo = self::query()->where('releases_id', $id)->whereNotNull('nfo')->select(['releases_id']); if ($getNfoString === true) { diff --git a/app/Models/Settings.php b/app/Models/Settings.php index 50f1e9189..ee7234e1f 100644 --- a/app/Models/Settings.php +++ b/app/Models/Settings.php @@ -122,7 +122,7 @@ class Settings extends Model * @param string $key * @return mixed */ - public function __get($key) + public function __get(string $key) { $override = self::query()->where('name', $key)->first(); @@ -144,7 +144,7 @@ class Settings extends Model * * @throws \RuntimeException */ - public static function toTree($excludeUnsectioned = true): array + public static function toTree(bool $excludeUnsectioned = true): array { $results = self::cursor()->remember(); @@ -195,7 +195,7 @@ class Settings extends Model * @return bool|null TRUE if Db version is greater than or eaqual to $requiredVersion, * false if not, and null if the version isn't available to check against. */ - public function isDbVersionAtLeast($requiredVersion): ?bool + public function isDbVersionAtLeast(string $requiredVersion): ?bool { $this->fetchDbVersion(); if (empty($this->dbVersion)) { diff --git a/app/Models/SteamApp.php b/app/Models/SteamApp.php index 811ff970a..cad46b762 100644 --- a/app/Models/SteamApp.php +++ b/app/Models/SteamApp.php @@ -47,7 +47,7 @@ class SteamApp extends Model /** * @return string */ - public function searchableAs() + public function searchableAs(): string { return 'ix_name_ft'; } @@ -55,7 +55,7 @@ class SteamApp extends Model /** * @return array */ - public function toSearchableArray() + public function toSearchableArray(): array { return [ 'name' => $this->name, diff --git a/app/Models/TvEpisode.php b/app/Models/TvEpisode.php index 0b9076be9..13c0310dd 100644 --- a/app/Models/TvEpisode.php +++ b/app/Models/TvEpisode.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Model; /** @@ -58,7 +59,7 @@ class TvEpisode extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function release() + public function release(): HasMany { return $this->hasMany(Release::class, 'tv_episodes_id'); } diff --git a/app/Models/UsenetGroup.php b/app/Models/UsenetGroup.php index 04e3c67df..74fb691db 100644 --- a/app/Models/UsenetGroup.php +++ b/app/Models/UsenetGroup.php @@ -2,6 +2,8 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Blacklight\ColorCLI; use Blacklight\NNTP; use Blacklight\NZB; @@ -94,7 +96,7 @@ class UsenetGroup extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function release() + public function release(): HasMany { return $this->hasMany(Release::class, 'groups_id'); } @@ -197,7 +199,7 @@ class UsenetGroup extends Model * @param string $name The group name. * @return false|int false on failure, groups_id on success. */ - public static function getIDByName($name) + public static function getIDByName(string $name) { $res = self::query()->where('name', $name)->first(['id']); @@ -211,7 +213,7 @@ class UsenetGroup extends Model * @param int $active Constrain query to active status * @return mixed */ - public static function getGroupsCount($groupname = '', $active = -1) + public static function getGroupsCount(string $groupname = '', int $active = -1) { $res = self::query(); @@ -231,7 +233,7 @@ class UsenetGroup extends Model * @param null $active * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ - public static function getGroupsRange($groupname = '', $active = null) + public static function getGroupsRange(string $groupname = '', $active = null): LengthAwarePaginator { $groups = self::query()->groupBy('id')->orderBy('name'); @@ -254,7 +256,7 @@ class UsenetGroup extends Model * * @return int */ - public static function updateGroup($group) + public static function updateGroup($group): int { return self::query()->where('id', $group['id'])->update( [ @@ -278,7 +280,7 @@ class UsenetGroup extends Model * @param string $groupName The full name of the usenet group being evaluated * @return string|bool The name of the group replacing shorthand prefix or false if groupname was malformed */ - public static function isValidGroup($groupName) + public static function isValidGroup(string $groupName) { if (preg_match('/^([\w\-]+\.)+[\w\-]+$/i', $groupName)) { return preg_replace('/^a\.b\./i', 'alt.binaries.', $groupName, 1); @@ -425,7 +427,7 @@ class UsenetGroup extends Model * * @throws \Exception */ - public static function addBulk($groupList, $active = 1, $backfill = 1) + public static function addBulk(string $groupList, int $active = 1, int $backfill = 1) { if (preg_match('/^\s*$/m', $groupList)) { $ret = 'No group list provided.'; @@ -477,7 +479,7 @@ class UsenetGroup extends Model * @param string $column Which column active/backfill * @param int $status Which status we are setting */ - public static function updateGroupStatus($id, $column, $status = 0): string + public static function updateGroupStatus(int $id, string $column, int $status = 0): string { self::query()->where('id', $id)->update( [ @@ -493,7 +495,7 @@ class UsenetGroup extends Model * * @param int $id The Group ID to disable */ - public static function disableIfNotExist($id): void + public static function disableIfNotExist(int $id): void { self::updateGroupStatus($id, 'active'); (new ColorCLI())->error('Group does not exist on server, disabling'); diff --git a/app/Models/User.php b/app/Models/User.php index 7e162cac0..175b01edd 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,6 +2,9 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Collection; use App\Jobs\SendAccountExpiredEmail; use App\Jobs\SendAccountWillExpireEmail; use App\Jobs\SendInviteEmail; @@ -198,7 +201,7 @@ class User extends Authenticatable /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function role() + public function role(): BelongsTo { return $this->belongsTo(Role::class, 'roles_id'); } @@ -206,7 +209,7 @@ class User extends Authenticatable /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function request() + public function request(): HasMany { return $this->hasMany(UserRequest::class, 'users_id'); } @@ -214,7 +217,7 @@ class User extends Authenticatable /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function download() + public function download(): HasMany { return $this->hasMany(UserDownload::class, 'users_id'); } @@ -222,7 +225,7 @@ class User extends Authenticatable /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function release() + public function release(): HasMany { return $this->hasMany(UsersRelease::class, 'users_id'); } @@ -230,7 +233,7 @@ class User extends Authenticatable /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function series() + public function series(): HasMany { return $this->hasMany(UserSerie::class, 'users_id'); } @@ -238,7 +241,7 @@ class User extends Authenticatable /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function invitation() + public function invitation(): HasMany { return $this->hasMany(Invitation::class, 'users_id'); } @@ -246,7 +249,7 @@ class User extends Authenticatable /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function failedRelease() + public function failedRelease(): HasMany { return $this->hasMany(DnzbFailure::class, 'users_id'); } @@ -254,7 +257,7 @@ class User extends Authenticatable /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function comment() + public function comment(): HasMany { return $this->hasMany(ReleaseComment::class, 'users_id'); } @@ -273,7 +276,7 @@ class User extends Authenticatable * @param string $host * @param string $email */ - public static function getCount($role = '', $username = '', $host = '', $email = ''): int + public static function getCount(string $role = '', string $username = '', string $host = '', string $email = ''): int { $res = self::query()->where('email', '<>', 'sharing@nZEDb.com'); @@ -399,7 +402,7 @@ class User extends Authenticatable * * @throws \Throwable */ - public static function getRange($start, $offset, $orderBy, string $userName = '', ?string $email = '', ?string $host = '', ?string $role = '', bool $apiRequests = false) + public static function getRange($start, $offset, $orderBy, string $userName = '', ?string $email = '', ?string $host = '', ?string $role = '', bool $apiRequests = false): Collection { if ($apiRequests) { UserRequest::clearApiRequests(false); diff --git a/app/Models/UserDownload.php b/app/Models/UserDownload.php index 3a6330597..637cc74a3 100644 --- a/app/Models/UserDownload.php +++ b/app/Models/UserDownload.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Model; /** @@ -47,7 +48,7 @@ class UserDownload extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo(User::class, 'users_id'); } @@ -55,7 +56,7 @@ class UserDownload extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function release() + public function release(): BelongsTo { return $this->belongsTo(Release::class, 'releases_id'); } @@ -67,7 +68,7 @@ class UserDownload extends Model * * @throws \Exception */ - public static function getDownloadRequests($userID): int + public static function getDownloadRequests(int $userID): int { // Clear old requests. self::whereUsersId($userID)->where('timestamp', '<', now()->subDay())->delete(); diff --git a/app/Models/UserRequest.php b/app/Models/UserRequest.php index d16d2485e..3198d62c6 100644 --- a/app/Models/UserRequest.php +++ b/app/Models/UserRequest.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; @@ -51,7 +52,7 @@ class UserRequest extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo(User::class, 'users_id'); } @@ -74,7 +75,7 @@ class UserRequest extends Model * @throws \Exception * @throws \Throwable */ - public static function getApiRequests($userID): int + public static function getApiRequests(int $userID): int { // Clear old requests. self::clearApiRequests($userID); @@ -89,7 +90,7 @@ class UserRequest extends Model * @param string $token API token of the user * @param string $request The API request. */ - public static function addApiRequest($token, $request): void + public static function addApiRequest(string $token, string $request): void { $userID = User::query()->select(['id'])->where('api_token', $token)->value('id'); self::query()->insert(['users_id' => $userID, 'request' => $request, 'timestamp' => now()]); diff --git a/app/Models/UserSerie.php b/app/Models/UserSerie.php index b5c3723b1..b0e0f88c8 100644 --- a/app/Models/UserSerie.php +++ b/app/Models/UserSerie.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Model; /** @@ -43,7 +44,7 @@ class UserSerie extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo(User::class, 'users_id'); } diff --git a/app/Models/Video.php b/app/Models/Video.php index 588552f08..d0a4e907e 100644 --- a/app/Models/Video.php +++ b/app/Models/Video.php @@ -2,6 +2,8 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Database\Eloquent\Model; /** @@ -64,7 +66,7 @@ class Video extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function alias() + public function alias(): HasMany { return $this->hasMany(VideoAlias::class, 'videos_id'); } @@ -72,7 +74,7 @@ class Video extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function release() + public function release(): HasMany { return $this->hasMany(Release::class, 'videos_id'); } @@ -80,7 +82,7 @@ class Video extends Model /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ - public function episode() + public function episode(): HasMany { return $this->hasMany(TvEpisode::class, 'videos_id'); } @@ -107,7 +109,7 @@ class Video extends Model * @param string $showname * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ - public static function getRange($showname = '') + public static function getRange(string $showname = ''): LengthAwarePaginator { $sql = self::query() ->select(['videos.*', 'tv_info.summary', 'tv_info.publisher', 'tv_info.image']) @@ -126,7 +128,7 @@ class Video extends Model * * @param string $showname */ - public static function getCount($showname = ''): int + public static function getCount(string $showname = ''): int { $res = self::query()->join('tv_info', 'videos.id', '=', 'tv_info.videos_id'); @@ -143,7 +145,7 @@ class Video extends Model * @param string $letter * @param string $showname */ - public static function getSeriesList($uid, $letter = '', $showname = ''): array + public static function getSeriesList($uid, string $letter = '', string $showname = ''): array { if (($letter !== '') && $letter === '0-9') { $letter = '[0-9]'; diff --git a/app/Models/VideoAlias.php b/app/Models/VideoAlias.php index be4263339..1749654f8 100644 --- a/app/Models/VideoAlias.php +++ b/app/Models/VideoAlias.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Model; /** @@ -37,7 +38,7 @@ class VideoAlias extends Model /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function video() + public function video(): BelongsTo { return $this->belongsTo(Video::class, 'videos_id'); } diff --git a/app/Observers/UserServiceObserver.php b/app/Observers/UserServiceObserver.php index 80b5409ce..3f072e77a 100644 --- a/app/Observers/UserServiceObserver.php +++ b/app/Observers/UserServiceObserver.php @@ -20,7 +20,7 @@ class UserServiceObserver * * @throws \Jrean\UserVerification\Exceptions\ModelNotCompliantException */ - public function created(User $user) + public function created(User $user): void { $roleData = Role::query()->where('id', $user->roles_id); $rateLimit = $roleData->value('rate_limit'); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index a1944a89f..d6ecb9bdb 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -12,7 +12,7 @@ class AppServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { Paginator::useBootstrap(); $smarty = app('smarty.view'); @@ -24,7 +24,7 @@ class AppServiceProvider extends ServiceProvider * * @return void */ - public function register() + public function register(): void { // } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 53f92b16f..30814008e 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -20,7 +20,7 @@ class AuthServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { } } diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 395c518bc..229284cb3 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -12,7 +12,7 @@ class BroadcastServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { Broadcast::routes(); diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 407a10e0b..53c1d9193 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -37,7 +37,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { parent::boot(); diff --git a/app/Providers/HorizonServiceProvider.php b/app/Providers/HorizonServiceProvider.php index b13871f58..263cb1bd4 100644 --- a/app/Providers/HorizonServiceProvider.php +++ b/app/Providers/HorizonServiceProvider.php @@ -13,7 +13,7 @@ class HorizonServiceProvider extends HorizonApplicationServiceProvider * * @return void */ - public function boot() + public function boot(): void { parent::boot(); @@ -29,7 +29,7 @@ class HorizonServiceProvider extends HorizonApplicationServiceProvider * * @return void */ - protected function gate() + protected function gate(): void { Gate::define('viewHorizon', function ($user) { return in_array($user->email, [ @@ -43,7 +43,7 @@ class HorizonServiceProvider extends HorizonApplicationServiceProvider * * @return void */ - public function register() + public function register(): void { // } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 316c32790..64601a8a3 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -14,7 +14,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { // @@ -26,7 +26,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - public function map() + public function map(): void { $this->mapApiRoutes(); @@ -42,7 +42,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - protected function mapWebRoutes() + protected function mapWebRoutes(): void { Route::middleware('web') ->group(base_path('routes/web.php')); @@ -55,7 +55,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - protected function mapApiRoutes() + protected function mapApiRoutes(): void { Route::prefix('api') ->middleware('api') @@ -69,7 +69,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - protected function mapRssRoutes() + protected function mapRssRoutes(): void { Route::prefix('rss') ->middleware('api') diff --git a/app/Providers/TelescopeServiceProvider.php b/app/Providers/TelescopeServiceProvider.php index f9aec8ab9..77a91a13c 100644 --- a/app/Providers/TelescopeServiceProvider.php +++ b/app/Providers/TelescopeServiceProvider.php @@ -14,7 +14,7 @@ class TelescopeServiceProvider extends TelescopeApplicationServiceProvider * * @return void */ - public function register() + public function register(): void { // Telescope::night(); @@ -37,7 +37,7 @@ class TelescopeServiceProvider extends TelescopeApplicationServiceProvider * * @return void */ - protected function hideSensitiveRequestDetails() + protected function hideSensitiveRequestDetails(): void { if ($this->app->isLocal()) { return; @@ -59,7 +59,7 @@ class TelescopeServiceProvider extends TelescopeApplicationServiceProvider * * @return void */ - protected function gate() + protected function gate(): void { Gate::define('viewTelescope', function ($user) { return in_array($user->email, [ diff --git a/app/Providers/UserServiceProvider.php b/app/Providers/UserServiceProvider.php index 786b9f4df..4f8a7e4e0 100644 --- a/app/Providers/UserServiceProvider.php +++ b/app/Providers/UserServiceProvider.php @@ -13,7 +13,7 @@ class UserServiceProvider extends ServiceProvider * * @return void */ - public function register() + public function register(): void { // } @@ -23,7 +23,7 @@ class UserServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { User::observe(UserServiceObserver::class); } diff --git a/database/factories/ReleaseFactory.php b/database/factories/ReleaseFactory.php index a8a1b305d..bdbfacdda 100644 --- a/database/factories/ReleaseFactory.php +++ b/database/factories/ReleaseFactory.php @@ -19,7 +19,7 @@ class ReleaseFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { return [ 'name' => $this->faker->name, diff --git a/database/migrations/2014_01_16_195548_create_users_table.php b/database/migrations/2014_01_16_195548_create_users_table.php index 0d1e578b0..eb1dac2d8 100644 --- a/database/migrations/2014_01_16_195548_create_users_table.php +++ b/database/migrations/2014_01_16_195548_create_users_table.php @@ -10,7 +10,7 @@ class CreateUsersTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('users', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -53,7 +53,7 @@ class CreateUsersTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('users'); } diff --git a/database/migrations/2014_02_01_311070_create_firewall_table.php b/database/migrations/2014_02_01_311070_create_firewall_table.php index 7492c9d9c..3aae14ae4 100644 --- a/database/migrations/2014_02_01_311070_create_firewall_table.php +++ b/database/migrations/2014_02_01_311070_create_firewall_table.php @@ -11,7 +11,7 @@ class CreateFirewallTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('firewall', function (Blueprint $table) { $table->increments('id'); @@ -29,7 +29,7 @@ class CreateFirewallTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('firewall'); } diff --git a/database/migrations/2018_01_17_150719_create_permission_tables.php b/database/migrations/2018_01_17_150719_create_permission_tables.php index 914c270a4..ce5107c20 100644 --- a/database/migrations/2018_01_17_150719_create_permission_tables.php +++ b/database/migrations/2018_01_17_150719_create_permission_tables.php @@ -11,7 +11,7 @@ class CreatePermissionTables extends Migration * * @return void */ - public function up() + public function up(): void { $tableNames = config('permission.table_names'); @@ -100,7 +100,7 @@ class CreatePermissionTables extends Migration * * @return void */ - public function down() + public function down(): void { $tableNames = config('permission.table_names'); diff --git a/database/migrations/2018_01_17_154034_create_categories_table.php b/database/migrations/2018_01_17_154034_create_categories_table.php index c715da7e6..7daba9ad9 100644 --- a/database/migrations/2018_01_17_154034_create_categories_table.php +++ b/database/migrations/2018_01_17_154034_create_categories_table.php @@ -10,7 +10,7 @@ class CreateCategoriesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('categories', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -32,7 +32,7 @@ class CreateCategoriesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('categories'); } diff --git a/database/migrations/2018_01_18_101314_create_category_regexes_table.php b/database/migrations/2018_01_18_101314_create_category_regexes_table.php index 4039da8f1..79215f0fe 100644 --- a/database/migrations/2018_01_18_101314_create_category_regexes_table.php +++ b/database/migrations/2018_01_18_101314_create_category_regexes_table.php @@ -10,7 +10,7 @@ class CreateCategoryRegexesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('category_regexes', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -33,7 +33,7 @@ class CreateCategoryRegexesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('category_regexes'); } diff --git a/database/migrations/2018_01_18_102213_create_collection_regexes_table.php b/database/migrations/2018_01_18_102213_create_collection_regexes_table.php index 7b22893ff..fd30ea804 100644 --- a/database/migrations/2018_01_18_102213_create_collection_regexes_table.php +++ b/database/migrations/2018_01_18_102213_create_collection_regexes_table.php @@ -10,7 +10,7 @@ class CreateCollectionRegexesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('collection_regexes', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -32,7 +32,7 @@ class CreateCollectionRegexesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('collection_regexes'); } diff --git a/database/migrations/2018_01_18_102716_create_binaryblacklist_table.php b/database/migrations/2018_01_18_102716_create_binaryblacklist_table.php index 193a0f34e..237601961 100644 --- a/database/migrations/2018_01_18_102716_create_binaryblacklist_table.php +++ b/database/migrations/2018_01_18_102716_create_binaryblacklist_table.php @@ -10,7 +10,7 @@ class CreateBinaryblacklistTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('binaryblacklist', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -34,7 +34,7 @@ class CreateBinaryblacklistTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('binaryblacklist'); } diff --git a/database/migrations/2018_01_18_103104_create_content_table.php b/database/migrations/2018_01_18_103104_create_content_table.php index 18a406d4e..40cc53be9 100644 --- a/database/migrations/2018_01_18_103104_create_content_table.php +++ b/database/migrations/2018_01_18_103104_create_content_table.php @@ -10,7 +10,7 @@ class CreateContentTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('content', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -38,7 +38,7 @@ class CreateContentTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('content'); } diff --git a/database/migrations/2018_01_18_103520_create_forumpost_table.php b/database/migrations/2018_01_18_103520_create_forumpost_table.php index 8fbcc14b1..b7a2d294e 100644 --- a/database/migrations/2018_01_18_103520_create_forumpost_table.php +++ b/database/migrations/2018_01_18_103520_create_forumpost_table.php @@ -10,7 +10,7 @@ class CreateForumpostTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('forumpost', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -35,7 +35,7 @@ class CreateForumpostTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('forumpost'); } diff --git a/database/migrations/2018_01_18_103816_create_genres_table.php b/database/migrations/2018_01_18_103816_create_genres_table.php index 2d5e39ca5..7e23b9c06 100644 --- a/database/migrations/2018_01_18_103816_create_genres_table.php +++ b/database/migrations/2018_01_18_103816_create_genres_table.php @@ -10,7 +10,7 @@ class CreateGenresTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('genres', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -30,7 +30,7 @@ class CreateGenresTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('genres'); } diff --git a/database/migrations/2018_01_18_104345_create_usenet_groups_table.php b/database/migrations/2018_01_18_104345_create_usenet_groups_table.php index 3066c708b..1104f64d6 100644 --- a/database/migrations/2018_01_18_104345_create_usenet_groups_table.php +++ b/database/migrations/2018_01_18_104345_create_usenet_groups_table.php @@ -10,7 +10,7 @@ class CreateUsenetGroupsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('usenet_groups', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -39,7 +39,7 @@ class CreateUsenetGroupsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('groups'); } diff --git a/database/migrations/2018_01_18_105455_create_release_naming_regexes_table.php b/database/migrations/2018_01_18_105455_create_release_naming_regexes_table.php index 99e5cbeae..e334656f0 100644 --- a/database/migrations/2018_01_18_105455_create_release_naming_regexes_table.php +++ b/database/migrations/2018_01_18_105455_create_release_naming_regexes_table.php @@ -10,7 +10,7 @@ class CreateReleaseNamingRegexesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('release_naming_regexes', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -32,7 +32,7 @@ class CreateReleaseNamingRegexesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('release_naming_regexes'); } diff --git a/database/migrations/2018_01_18_105834_create_settings_table.php b/database/migrations/2018_01_18_105834_create_settings_table.php index 1834c7ea9..82f9e3ff2 100644 --- a/database/migrations/2018_01_18_105834_create_settings_table.php +++ b/database/migrations/2018_01_18_105834_create_settings_table.php @@ -10,7 +10,7 @@ class CreateSettingsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('settings', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -31,7 +31,7 @@ class CreateSettingsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('settings'); } diff --git a/database/migrations/2018_01_20_195500_create_collections_table.php b/database/migrations/2018_01_20_195500_create_collections_table.php index 899edf393..41d76c0e5 100644 --- a/database/migrations/2018_01_20_195500_create_collections_table.php +++ b/database/migrations/2018_01_20_195500_create_collections_table.php @@ -10,7 +10,7 @@ class CreateCollectionsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('collections', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -39,7 +39,7 @@ class CreateCollectionsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('collections'); } diff --git a/database/migrations/2018_01_20_195528_create_releases_table.php b/database/migrations/2018_01_20_195528_create_releases_table.php index 3663d35a7..4319081cb 100644 --- a/database/migrations/2018_01_20_195528_create_releases_table.php +++ b/database/migrations/2018_01_20_195528_create_releases_table.php @@ -11,7 +11,7 @@ class CreateReleasesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('releases', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -95,7 +95,7 @@ processed'); * * @return void */ - public function down() + public function down(): void { Schema::drop('releases'); } diff --git a/database/migrations/2018_01_20_195604_create_anidb_episodes_table.php b/database/migrations/2018_01_20_195604_create_anidb_episodes_table.php index ced744440..d9f2a9a97 100644 --- a/database/migrations/2018_01_20_195604_create_anidb_episodes_table.php +++ b/database/migrations/2018_01_20_195604_create_anidb_episodes_table.php @@ -10,7 +10,7 @@ class CreateAnidbEpisodesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('anidb_episodes', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -30,7 +30,7 @@ class CreateAnidbEpisodesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('anidb_episodes'); } diff --git a/database/migrations/2018_01_20_195615_create_anidb_info_table.php b/database/migrations/2018_01_20_195615_create_anidb_info_table.php index a27247f13..4c97015c5 100644 --- a/database/migrations/2018_01_20_195615_create_anidb_info_table.php +++ b/database/migrations/2018_01_20_195615_create_anidb_info_table.php @@ -10,7 +10,7 @@ class CreateAnidbInfoTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('anidb_info', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -38,7 +38,7 @@ class CreateAnidbInfoTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('anidb_info'); } diff --git a/database/migrations/2018_01_20_195624_create_anidb_titles_table.php b/database/migrations/2018_01_20_195624_create_anidb_titles_table.php index 1a9522277..f5e4f01fc 100644 --- a/database/migrations/2018_01_20_195624_create_anidb_titles_table.php +++ b/database/migrations/2018_01_20_195624_create_anidb_titles_table.php @@ -10,7 +10,7 @@ class CreateAnidbTitlesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('anidb_titles', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -29,7 +29,7 @@ class CreateAnidbTitlesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('anidb_titles'); } diff --git a/database/migrations/2018_01_20_195636_create_audio_data_table.php b/database/migrations/2018_01_20_195636_create_audio_data_table.php index 6dfce9700..6d4c874b1 100644 --- a/database/migrations/2018_01_20_195636_create_audio_data_table.php +++ b/database/migrations/2018_01_20_195636_create_audio_data_table.php @@ -10,7 +10,7 @@ class CreateAudioDataTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('audio_data', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -38,7 +38,7 @@ class CreateAudioDataTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('audio_data'); } diff --git a/database/migrations/2018_01_20_195648_create_binaries_table.php b/database/migrations/2018_01_20_195648_create_binaries_table.php index a61d7bf71..abc8212d0 100644 --- a/database/migrations/2018_01_20_195648_create_binaries_table.php +++ b/database/migrations/2018_01_20_195648_create_binaries_table.php @@ -10,7 +10,7 @@ class CreateBinariesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('binaries', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -35,7 +35,7 @@ class CreateBinariesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('binaries'); } diff --git a/database/migrations/2018_01_20_195703_create_bookinfo_table.php b/database/migrations/2018_01_20_195703_create_bookinfo_table.php index 81b4ca0b3..8c8b1c45f 100644 --- a/database/migrations/2018_01_20_195703_create_bookinfo_table.php +++ b/database/migrations/2018_01_20_195703_create_bookinfo_table.php @@ -10,7 +10,7 @@ class CreateBookinfoTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('bookinfo', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -40,7 +40,7 @@ class CreateBookinfoTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('bookinfo'); } diff --git a/database/migrations/2018_01_20_195716_create_consoleinfo_table.php b/database/migrations/2018_01_20_195716_create_consoleinfo_table.php index 5070f0ba7..37d4993e6 100644 --- a/database/migrations/2018_01_20_195716_create_consoleinfo_table.php +++ b/database/migrations/2018_01_20_195716_create_consoleinfo_table.php @@ -10,7 +10,7 @@ class CreateConsoleinfoTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('consoleinfo', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -38,7 +38,7 @@ class CreateConsoleinfoTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('consoleinfo'); } diff --git a/database/migrations/2018_01_20_195728_create_dnzb_failures_table.php b/database/migrations/2018_01_20_195728_create_dnzb_failures_table.php index d2c1e2773..772c84896 100644 --- a/database/migrations/2018_01_20_195728_create_dnzb_failures_table.php +++ b/database/migrations/2018_01_20_195728_create_dnzb_failures_table.php @@ -10,7 +10,7 @@ class CreateDnzbFailuresTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('dnzb_failures', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -30,7 +30,7 @@ class CreateDnzbFailuresTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('dnzb_failures'); } diff --git a/database/migrations/2018_01_20_195739_create_gamesinfo_table.php b/database/migrations/2018_01_20_195739_create_gamesinfo_table.php index 5293cf497..332e3fb33 100644 --- a/database/migrations/2018_01_20_195739_create_gamesinfo_table.php +++ b/database/migrations/2018_01_20_195739_create_gamesinfo_table.php @@ -10,7 +10,7 @@ class CreateGamesinfoTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('gamesinfo', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -39,7 +39,7 @@ class CreateGamesinfoTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('gamesinfo'); } diff --git a/database/migrations/2018_01_20_195752_create_invitations_table.php b/database/migrations/2018_01_20_195752_create_invitations_table.php index 3c29e73e9..a77adf9de 100644 --- a/database/migrations/2018_01_20_195752_create_invitations_table.php +++ b/database/migrations/2018_01_20_195752_create_invitations_table.php @@ -10,7 +10,7 @@ class CreateInvitationsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('invitations', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -29,7 +29,7 @@ class CreateInvitationsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('invitations'); } diff --git a/database/migrations/2018_01_20_195801_create_logging_table.php b/database/migrations/2018_01_20_195801_create_logging_table.php index 3e1f0c7bf..a41d62cba 100644 --- a/database/migrations/2018_01_20_195801_create_logging_table.php +++ b/database/migrations/2018_01_20_195801_create_logging_table.php @@ -10,7 +10,7 @@ class CreateLoggingTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('logging', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -28,7 +28,7 @@ class CreateLoggingTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('logging'); } diff --git a/database/migrations/2018_01_20_195812_create_missed_parts_table.php b/database/migrations/2018_01_20_195812_create_missed_parts_table.php index ce80acdb2..bb1f0b2de 100644 --- a/database/migrations/2018_01_20_195812_create_missed_parts_table.php +++ b/database/migrations/2018_01_20_195812_create_missed_parts_table.php @@ -10,7 +10,7 @@ class CreateMissedPartsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('missed_parts', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -31,7 +31,7 @@ class CreateMissedPartsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('missed_parts'); } diff --git a/database/migrations/2018_01_20_195822_create_movieinfo_table.php b/database/migrations/2018_01_20_195822_create_movieinfo_table.php index c86b34731..54efba7ed 100644 --- a/database/migrations/2018_01_20_195822_create_movieinfo_table.php +++ b/database/migrations/2018_01_20_195822_create_movieinfo_table.php @@ -10,7 +10,7 @@ class CreateMovieinfoTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('movieinfo', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -43,7 +43,7 @@ class CreateMovieinfoTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('movieinfo'); } diff --git a/database/migrations/2018_01_20_195832_create_musicinfo_table.php b/database/migrations/2018_01_20_195832_create_musicinfo_table.php index d7face55e..23ca61d4c 100644 --- a/database/migrations/2018_01_20_195832_create_musicinfo_table.php +++ b/database/migrations/2018_01_20_195832_create_musicinfo_table.php @@ -10,7 +10,7 @@ class CreateMusicinfoTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('musicinfo', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -39,7 +39,7 @@ class CreateMusicinfoTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('musicinfo'); } diff --git a/database/migrations/2018_01_20_195915_create_par_hashes_table.php b/database/migrations/2018_01_20_195915_create_par_hashes_table.php index 6f86295a6..15caad3e9 100644 --- a/database/migrations/2018_01_20_195915_create_par_hashes_table.php +++ b/database/migrations/2018_01_20_195915_create_par_hashes_table.php @@ -10,7 +10,7 @@ class CreateParHashesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('par_hashes', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -28,7 +28,7 @@ class CreateParHashesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('par_hashes'); } diff --git a/database/migrations/2018_01_20_195925_create_parts_table.php b/database/migrations/2018_01_20_195925_create_parts_table.php index 5e18588d4..28ed0d63a 100644 --- a/database/migrations/2018_01_20_195925_create_parts_table.php +++ b/database/migrations/2018_01_20_195925_create_parts_table.php @@ -10,7 +10,7 @@ class CreatePartsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('parts', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -31,7 +31,7 @@ class CreatePartsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('parts'); } diff --git a/database/migrations/2018_01_20_195934_create_predb_table.php b/database/migrations/2018_01_20_195934_create_predb_table.php index 6c5ac0e49..79fcfb289 100644 --- a/database/migrations/2018_01_20_195934_create_predb_table.php +++ b/database/migrations/2018_01_20_195934_create_predb_table.php @@ -11,7 +11,7 @@ class CreatePredbTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('predb', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -50,7 +50,7 @@ class CreatePredbTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('predb'); } diff --git a/database/migrations/2018_01_20_195946_create_predb_hashes_table.php b/database/migrations/2018_01_20_195946_create_predb_hashes_table.php index 2223d56f9..699d3854f 100644 --- a/database/migrations/2018_01_20_195946_create_predb_hashes_table.php +++ b/database/migrations/2018_01_20_195946_create_predb_hashes_table.php @@ -10,7 +10,7 @@ class CreatePredbHashesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('predb_hashes', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -28,7 +28,7 @@ class CreatePredbHashesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('predb_hashes'); } diff --git a/database/migrations/2018_01_20_195954_create_predb_imports_table.php b/database/migrations/2018_01_20_195954_create_predb_imports_table.php index 8a977945d..a4188f075 100644 --- a/database/migrations/2018_01_20_195954_create_predb_imports_table.php +++ b/database/migrations/2018_01_20_195954_create_predb_imports_table.php @@ -10,7 +10,7 @@ class CreatePredbImportsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('predb_imports', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -38,7 +38,7 @@ class CreatePredbImportsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('predb_imports'); } diff --git a/database/migrations/2018_01_20_200005_create_release_comments_table.php b/database/migrations/2018_01_20_200005_create_release_comments_table.php index 10b2fd772..1b41ec0af 100644 --- a/database/migrations/2018_01_20_200005_create_release_comments_table.php +++ b/database/migrations/2018_01_20_200005_create_release_comments_table.php @@ -10,7 +10,7 @@ class CreateReleaseCommentsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('release_comments', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -44,7 +44,7 @@ class CreateReleaseCommentsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('release_comments'); } diff --git a/database/migrations/2018_01_20_200018_create_releases_groups_table.php b/database/migrations/2018_01_20_200018_create_releases_groups_table.php index 4edf10e54..a4af3edf6 100644 --- a/database/migrations/2018_01_20_200018_create_releases_groups_table.php +++ b/database/migrations/2018_01_20_200018_create_releases_groups_table.php @@ -10,7 +10,7 @@ class CreateReleasesGroupsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('releases_groups', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -28,7 +28,7 @@ class CreateReleasesGroupsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('releases_groups'); } diff --git a/database/migrations/2018_01_20_200030_create_release_regexes_table.php b/database/migrations/2018_01_20_200030_create_release_regexes_table.php index 7a3d2eb49..d6f95680a 100644 --- a/database/migrations/2018_01_20_200030_create_release_regexes_table.php +++ b/database/migrations/2018_01_20_200030_create_release_regexes_table.php @@ -10,7 +10,7 @@ class CreateReleaseRegexesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('release_regexes', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -28,7 +28,7 @@ class CreateReleaseRegexesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('release_regexes'); } diff --git a/database/migrations/2018_01_20_200038_create_release_unique_table.php b/database/migrations/2018_01_20_200038_create_release_unique_table.php index ca8fe3ff5..f0afa4475 100644 --- a/database/migrations/2018_01_20_200038_create_release_unique_table.php +++ b/database/migrations/2018_01_20_200038_create_release_unique_table.php @@ -10,7 +10,7 @@ class CreateReleaseUniqueTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('release_unique', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -28,7 +28,7 @@ class CreateReleaseUniqueTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('release_unique'); } diff --git a/database/migrations/2018_01_20_200046_create_releaseextrafull_table.php b/database/migrations/2018_01_20_200046_create_releaseextrafull_table.php index 2012d4c28..6fc13b813 100644 --- a/database/migrations/2018_01_20_200046_create_releaseextrafull_table.php +++ b/database/migrations/2018_01_20_200046_create_releaseextrafull_table.php @@ -10,7 +10,7 @@ class CreateReleaseextrafullTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('releaseextrafull', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -27,7 +27,7 @@ class CreateReleaseextrafullTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('releaseextrafull'); } diff --git a/database/migrations/2018_01_20_200056_create_release_files_table.php b/database/migrations/2018_01_20_200056_create_release_files_table.php index e69903b5a..87d7a6a20 100644 --- a/database/migrations/2018_01_20_200056_create_release_files_table.php +++ b/database/migrations/2018_01_20_200056_create_release_files_table.php @@ -11,7 +11,7 @@ class CreateReleaseFilesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('release_files', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -42,7 +42,7 @@ class CreateReleaseFilesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('release_files'); } diff --git a/database/migrations/2018_01_20_200104_create_release_nfos_table.php b/database/migrations/2018_01_20_200104_create_release_nfos_table.php index d3919f7ba..80dec39a8 100644 --- a/database/migrations/2018_01_20_200104_create_release_nfos_table.php +++ b/database/migrations/2018_01_20_200104_create_release_nfos_table.php @@ -10,7 +10,7 @@ class CreateReleaseNfosTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('release_nfos', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -27,7 +27,7 @@ class CreateReleaseNfosTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('release_nfos'); } diff --git a/database/migrations/2018_01_20_200124_create_release_subtitles_table.php b/database/migrations/2018_01_20_200124_create_release_subtitles_table.php index 974b7bf79..23869112b 100644 --- a/database/migrations/2018_01_20_200124_create_release_subtitles_table.php +++ b/database/migrations/2018_01_20_200124_create_release_subtitles_table.php @@ -10,7 +10,7 @@ class CreateReleaseSubtitlesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('release_subtitles', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -30,7 +30,7 @@ class CreateReleaseSubtitlesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('release_subtitles'); } diff --git a/database/migrations/2018_01_20_200151_create_short_groups_table.php b/database/migrations/2018_01_20_200151_create_short_groups_table.php index 89ebdc502..c33f89608 100644 --- a/database/migrations/2018_01_20_200151_create_short_groups_table.php +++ b/database/migrations/2018_01_20_200151_create_short_groups_table.php @@ -10,7 +10,7 @@ class CreateShortGroupsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('short_groups', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -29,7 +29,7 @@ class CreateShortGroupsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('short_groups'); } diff --git a/database/migrations/2018_01_20_200200_create_steam_apps_table.php b/database/migrations/2018_01_20_200200_create_steam_apps_table.php index ac5f9dc44..c15e0853b 100644 --- a/database/migrations/2018_01_20_200200_create_steam_apps_table.php +++ b/database/migrations/2018_01_20_200200_create_steam_apps_table.php @@ -10,7 +10,7 @@ class CreateSteamAppsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('steam_apps', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -28,7 +28,7 @@ class CreateSteamAppsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('steam_apps'); } diff --git a/database/migrations/2018_01_20_200211_create_tv_episodes_table.php b/database/migrations/2018_01_20_200211_create_tv_episodes_table.php index e22e0a27c..76f9024ac 100644 --- a/database/migrations/2018_01_20_200211_create_tv_episodes_table.php +++ b/database/migrations/2018_01_20_200211_create_tv_episodes_table.php @@ -10,7 +10,7 @@ class CreateTvEpisodesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('tv_episodes', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -33,7 +33,7 @@ class CreateTvEpisodesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('tv_episodes'); } diff --git a/database/migrations/2018_01_20_200218_create_tv_info_table.php b/database/migrations/2018_01_20_200218_create_tv_info_table.php index 6252bd3c0..4cff704a8 100644 --- a/database/migrations/2018_01_20_200218_create_tv_info_table.php +++ b/database/migrations/2018_01_20_200218_create_tv_info_table.php @@ -10,7 +10,7 @@ class CreateTvInfoTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('tv_info', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -29,7 +29,7 @@ class CreateTvInfoTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('tv_info'); } diff --git a/database/migrations/2018_01_20_200237_create_users_releases_table.php b/database/migrations/2018_01_20_200237_create_users_releases_table.php index 9fb68c263..3e15c29e5 100644 --- a/database/migrations/2018_01_20_200237_create_users_releases_table.php +++ b/database/migrations/2018_01_20_200237_create_users_releases_table.php @@ -10,7 +10,7 @@ class CreateUsersReleasesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('users_releases', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -31,7 +31,7 @@ class CreateUsersReleasesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('users_releases'); } diff --git a/database/migrations/2018_01_20_200248_create_user_downloads_table.php b/database/migrations/2018_01_20_200248_create_user_downloads_table.php index 56a45ff52..c13158eca 100644 --- a/database/migrations/2018_01_20_200248_create_user_downloads_table.php +++ b/database/migrations/2018_01_20_200248_create_user_downloads_table.php @@ -10,7 +10,7 @@ class CreateUserDownloadsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('user_downloads', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -30,7 +30,7 @@ class CreateUserDownloadsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('user_downloads'); } diff --git a/database/migrations/2018_01_20_200318_create_user_movies_table.php b/database/migrations/2018_01_20_200318_create_user_movies_table.php index 6c2bec9c5..b36dc53c4 100644 --- a/database/migrations/2018_01_20_200318_create_user_movies_table.php +++ b/database/migrations/2018_01_20_200318_create_user_movies_table.php @@ -10,7 +10,7 @@ class CreateUserMoviesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('user_movies', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -31,7 +31,7 @@ class CreateUserMoviesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('user_movies'); } diff --git a/database/migrations/2018_01_20_200328_create_user_requests_table.php b/database/migrations/2018_01_20_200328_create_user_requests_table.php index d6b3a43cf..b5bb27678 100644 --- a/database/migrations/2018_01_20_200328_create_user_requests_table.php +++ b/database/migrations/2018_01_20_200328_create_user_requests_table.php @@ -10,7 +10,7 @@ class CreateUserRequestsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('user_requests', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -30,7 +30,7 @@ class CreateUserRequestsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('user_requests'); } diff --git a/database/migrations/2018_01_20_200336_create_user_series_table.php b/database/migrations/2018_01_20_200336_create_user_series_table.php index 8f0b84f26..e351969f4 100644 --- a/database/migrations/2018_01_20_200336_create_user_series_table.php +++ b/database/migrations/2018_01_20_200336_create_user_series_table.php @@ -10,7 +10,7 @@ class CreateUserSeriesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('user_series', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -31,7 +31,7 @@ class CreateUserSeriesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('user_series'); } diff --git a/database/migrations/2018_01_20_200346_create_video_data_table.php b/database/migrations/2018_01_20_200346_create_video_data_table.php index 4c0ac7e5e..d3ece15c8 100644 --- a/database/migrations/2018_01_20_200346_create_video_data_table.php +++ b/database/migrations/2018_01_20_200346_create_video_data_table.php @@ -10,7 +10,7 @@ class CreateVideoDataTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('video_data', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -36,7 +36,7 @@ class CreateVideoDataTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('video_data'); } diff --git a/database/migrations/2018_01_20_200353_create_videos_table.php b/database/migrations/2018_01_20_200353_create_videos_table.php index ecb6102a1..8cac62345 100644 --- a/database/migrations/2018_01_20_200353_create_videos_table.php +++ b/database/migrations/2018_01_20_200353_create_videos_table.php @@ -10,7 +10,7 @@ class CreateVideosTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('videos', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -39,7 +39,7 @@ class CreateVideosTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('videos'); } diff --git a/database/migrations/2018_01_20_200403_create_videos_aliases_table.php b/database/migrations/2018_01_20_200403_create_videos_aliases_table.php index bb84f1cf8..056c4884e 100644 --- a/database/migrations/2018_01_20_200403_create_videos_aliases_table.php +++ b/database/migrations/2018_01_20_200403_create_videos_aliases_table.php @@ -10,7 +10,7 @@ class CreateVideosAliasesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('videos_aliases', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -27,7 +27,7 @@ class CreateVideosAliasesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('videos_aliases'); } diff --git a/database/migrations/2018_01_20_200417_create_xxxinfo_table.php b/database/migrations/2018_01_20_200417_create_xxxinfo_table.php index bcb71bcf0..b41bbf4d2 100644 --- a/database/migrations/2018_01_20_200417_create_xxxinfo_table.php +++ b/database/migrations/2018_01_20_200417_create_xxxinfo_table.php @@ -10,7 +10,7 @@ class CreateXxxinfoTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('xxxinfo', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -39,7 +39,7 @@ class CreateXxxinfoTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('xxxinfo'); } diff --git a/database/migrations/2018_01_22_220858_add_stored_procedures.php b/database/migrations/2018_01_22_220858_add_stored_procedures.php index e56d70961..cdcb5b6c5 100644 --- a/database/migrations/2018_01_22_220858_add_stored_procedures.php +++ b/database/migrations/2018_01_22_220858_add_stored_procedures.php @@ -9,7 +9,7 @@ class AddStoredProcedures extends Migration * * @return void */ - public function up() + public function up(): void { DB::unprepared('DROP PROCEDURE IF EXISTS loop_cbpm; DROP PROCEDURE IF EXISTS delete_release; CREATE PROCEDURE loop_cbpm(IN method CHAR(10)) COMMENT "Performs tasks on All CBPM tables one by one -- REPAIR/ANALYZE/OPTIMIZE or DROP/TRUNCATE" @@ -55,7 +55,7 @@ class AddStoredProcedures extends Migration * * @return void */ - public function down() + public function down(): void { DB::statement('DROP PROCEDURE loop_cbpm;'); } diff --git a/database/migrations/2018_04_24_132758_create_cache_table.php b/database/migrations/2018_04_24_132758_create_cache_table.php index 7b73e5fd1..e86433c74 100644 --- a/database/migrations/2018_04_24_132758_create_cache_table.php +++ b/database/migrations/2018_04_24_132758_create_cache_table.php @@ -11,7 +11,7 @@ class CreateCacheTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('cache', function (Blueprint $table) { $table->string('key')->unique(); @@ -25,7 +25,7 @@ class CreateCacheTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('cache'); } diff --git a/database/migrations/2018_08_08_100000_create_telescope_entries_table.php b/database/migrations/2018_08_08_100000_create_telescope_entries_table.php index 90bb77fde..3d07348c1 100644 --- a/database/migrations/2018_08_08_100000_create_telescope_entries_table.php +++ b/database/migrations/2018_08_08_100000_create_telescope_entries_table.php @@ -30,7 +30,7 @@ class CreateTelescopeEntriesTable extends Migration * * @return void */ - public function up() + public function up(): void { $this->schema->create('telescope_entries', function (Blueprint $table) { $table->bigIncrements('sequence'); @@ -70,7 +70,7 @@ class CreateTelescopeEntriesTable extends Migration * * @return void */ - public function down() + public function down(): void { $this->schema->dropIfExists('telescope_entries_tags'); $this->schema->dropIfExists('telescope_entries'); diff --git a/database/migrations/2018_09_13_070520_add_verification_to_user_table.php b/database/migrations/2018_09_13_070520_add_verification_to_user_table.php index aae68089a..5a09b241a 100644 --- a/database/migrations/2018_09_13_070520_add_verification_to_user_table.php +++ b/database/migrations/2018_09_13_070520_add_verification_to_user_table.php @@ -14,7 +14,7 @@ class AddVerificationToUserTable extends Migration * * @return string */ - public function getUserTableName() + public function getUserTableName(): string { $user_model = config('auth.providers.users.model', App\Models\User::class); @@ -26,7 +26,7 @@ class AddVerificationToUserTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table($this->getUserTableName(), function (Blueprint $table) { $table->boolean('verified')->default(false); @@ -39,7 +39,7 @@ class AddVerificationToUserTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table($this->getUserTableName(), function (Blueprint $table) { $table->dropColumn('verified'); diff --git a/database/migrations/2019_02_20_102034_create_failed_jobs_table.php b/database/migrations/2019_02_20_102034_create_failed_jobs_table.php index 9bddee36c..ade6efd0c 100644 --- a/database/migrations/2019_02_20_102034_create_failed_jobs_table.php +++ b/database/migrations/2019_02_20_102034_create_failed_jobs_table.php @@ -11,7 +11,7 @@ class CreateFailedJobsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('failed_jobs', function (Blueprint $table) { $table->id(); @@ -28,7 +28,7 @@ class CreateFailedJobsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('failed_jobs'); } diff --git a/database/migrations/2019_03_11_234818_create_root_categories_table.php b/database/migrations/2019_03_11_234818_create_root_categories_table.php index 7727e045b..e8f9c77ed 100644 --- a/database/migrations/2019_03_11_234818_create_root_categories_table.php +++ b/database/migrations/2019_03_11_234818_create_root_categories_table.php @@ -11,7 +11,7 @@ class CreateRootCategoriesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('root_categories', function (Blueprint $table) { $table->engine = 'InnoDB'; @@ -30,7 +30,7 @@ class CreateRootCategoriesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('root_categories'); } diff --git a/database/migrations/2019_03_12_090532_change_categories_table.php b/database/migrations/2019_03_12_090532_change_categories_table.php index 4510d466a..1dc395c39 100644 --- a/database/migrations/2019_03_12_090532_change_categories_table.php +++ b/database/migrations/2019_03_12_090532_change_categories_table.php @@ -11,7 +11,7 @@ class ChangeCategoriesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('categories', function (Blueprint $table) { $table->bigInteger('parentid')->unsigned()->change(); @@ -23,7 +23,7 @@ class ChangeCategoriesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('categories', function (Blueprint $table) { $table->integer('parentid'); diff --git a/database/migrations/2019_03_12_093837_add_foreign_categories_table.php b/database/migrations/2019_03_12_093837_add_foreign_categories_table.php index 9a39ef4dc..0d9c4e0c9 100644 --- a/database/migrations/2019_03_12_093837_add_foreign_categories_table.php +++ b/database/migrations/2019_03_12_093837_add_foreign_categories_table.php @@ -11,7 +11,7 @@ class AddForeignCategoriesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::disableForeignKeyConstraints(); Schema::table('categories', function (Blueprint $table) { @@ -26,7 +26,7 @@ class AddForeignCategoriesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::disableForeignKeyConstraints(); Schema::table('categories', function (Blueprint $table) { diff --git a/database/migrations/2019_04_04_130055_update_releases_table.php b/database/migrations/2019_04_04_130055_update_releases_table.php index c2652c7f4..54851e281 100644 --- a/database/migrations/2019_04_04_130055_update_releases_table.php +++ b/database/migrations/2019_04_04_130055_update_releases_table.php @@ -11,7 +11,7 @@ class UpdateReleasesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('releases', function (Blueprint $table) { $table->string('imdbid', 100)->nullable()->change(); @@ -23,7 +23,7 @@ class UpdateReleasesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('releases', function (Blueprint $table) { $table->unsignedMediumInteger('imdbid')->nullable()->change(); diff --git a/database/migrations/2019_04_04_150842_update_movieinfo_table.php b/database/migrations/2019_04_04_150842_update_movieinfo_table.php index a7e528644..8c16f58c1 100644 --- a/database/migrations/2019_04_04_150842_update_movieinfo_table.php +++ b/database/migrations/2019_04_04_150842_update_movieinfo_table.php @@ -11,7 +11,7 @@ class UpdateMovieinfoTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('movieinfo', function (Blueprint $table) { $table->string('imdbid', 100)->change(); @@ -23,7 +23,7 @@ class UpdateMovieinfoTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('movieinfo', function (Blueprint $table) { $table->unsignedMediumInteger('imdbid')->change(); diff --git a/database/migrations/2019_04_04_152238_update_user_movies_table.php b/database/migrations/2019_04_04_152238_update_user_movies_table.php index 5943f959f..798b32f1b 100644 --- a/database/migrations/2019_04_04_152238_update_user_movies_table.php +++ b/database/migrations/2019_04_04_152238_update_user_movies_table.php @@ -11,7 +11,7 @@ class UpdateUserMoviesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('user_movies', function (Blueprint $table) { $table->string('imdbid', 100)->change(); @@ -23,7 +23,7 @@ class UpdateUserMoviesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('user_movies', function (Blueprint $table) { $table->unsignedMediumInteger('imdbid')->change(); diff --git a/database/migrations/2019_06_14_095012_create_role_expiration_emails_table.php b/database/migrations/2019_06_14_095012_create_role_expiration_emails_table.php index 6e8b6a24f..e7410da89 100644 --- a/database/migrations/2019_06_14_095012_create_role_expiration_emails_table.php +++ b/database/migrations/2019_06_14_095012_create_role_expiration_emails_table.php @@ -11,7 +11,7 @@ class CreateRoleExpirationEmailsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('role_expiration_emails', function (Blueprint $table) { $table->id(); @@ -28,7 +28,7 @@ class CreateRoleExpirationEmailsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('role_expiration_emails'); } diff --git a/database/migrations/2019_08_06_140408_create_invitation_user_table.php b/database/migrations/2019_08_06_140408_create_invitation_user_table.php index 936f59151..39e963e28 100644 --- a/database/migrations/2019_08_06_140408_create_invitation_user_table.php +++ b/database/migrations/2019_08_06_140408_create_invitation_user_table.php @@ -10,7 +10,7 @@ class CreateInvitationUserTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('user_invitations', function (Blueprint $table) { $table->id(); @@ -28,7 +28,7 @@ class CreateInvitationUserTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::drop('user_invitations'); } diff --git a/database/migrations/2019_08_23_132941_change_passwordststatus_releases_table.php b/database/migrations/2019_08_23_132941_change_passwordststatus_releases_table.php index fbb02f6a1..a8876b4de 100644 --- a/database/migrations/2019_08_23_132941_change_passwordststatus_releases_table.php +++ b/database/migrations/2019_08_23_132941_change_passwordststatus_releases_table.php @@ -11,7 +11,7 @@ class ChangePasswordststatusReleasesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('releases', function (Blueprint $table) { $table->smallInteger('passwordstatus')->default(-1)->change(); @@ -23,7 +23,7 @@ class ChangePasswordststatusReleasesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('releases', function (Blueprint $table) { $table->boolean('passwordstatus')->default(0)->change(); diff --git a/database/migrations/2019_10_10_231045_create_paypal_payments_table.php b/database/migrations/2019_10_10_231045_create_paypal_payments_table.php index b40dbbced..c3927536d 100644 --- a/database/migrations/2019_10_10_231045_create_paypal_payments_table.php +++ b/database/migrations/2019_10_10_231045_create_paypal_payments_table.php @@ -11,7 +11,7 @@ class CreatePaypalPaymentsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('paypal_payments', function (Blueprint $table) { $table->id(); @@ -26,7 +26,7 @@ class CreatePaypalPaymentsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('paypal_payments'); } diff --git a/database/migrations/2019_10_15_215953_update_tv_episodes_firstaired_column.php b/database/migrations/2019_10_15_215953_update_tv_episodes_firstaired_column.php index 338cba02e..a65282949 100644 --- a/database/migrations/2019_10_15_215953_update_tv_episodes_firstaired_column.php +++ b/database/migrations/2019_10_15_215953_update_tv_episodes_firstaired_column.php @@ -11,7 +11,7 @@ class UpdateTvEpisodesFirstairedColumn extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('tv_episodes', function (Blueprint $table) { $table->date('firstaired')->nullable()->comment('Date of original airing/release.')->change(); @@ -23,7 +23,7 @@ class UpdateTvEpisodesFirstairedColumn extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('tv_episodes', function (Blueprint $table) { $table->date('firstaired')->comment('Date of original airing/release.')->change(); diff --git a/database/migrations/2019_10_18_205920_add_timestamps_to_videos_aliases.php b/database/migrations/2019_10_18_205920_add_timestamps_to_videos_aliases.php index e2cecc781..d876c6dbc 100644 --- a/database/migrations/2019_10_18_205920_add_timestamps_to_videos_aliases.php +++ b/database/migrations/2019_10_18_205920_add_timestamps_to_videos_aliases.php @@ -11,7 +11,7 @@ class AddTimestampsToVideosAliases extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('videos_aliases', function (Blueprint $table) { $table->timestamps(); @@ -23,7 +23,7 @@ class AddTimestampsToVideosAliases extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('videos_aliases', function (Blueprint $table) { $table->timestamps(); diff --git a/database/migrations/2019_12_30_190950_update_imdb_column_videos_table.php b/database/migrations/2019_12_30_190950_update_imdb_column_videos_table.php index d63b4b1f0..1e6376ea0 100644 --- a/database/migrations/2019_12_30_190950_update_imdb_column_videos_table.php +++ b/database/migrations/2019_12_30_190950_update_imdb_column_videos_table.php @@ -11,7 +11,7 @@ class UpdateImdbColumnVideosTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('videos', function (Blueprint $table) { $table->string('imdb', 100)->default(0)->comment('ID number for IMDB site (without the \'tt\' prefix).')->change(); @@ -23,7 +23,7 @@ class UpdateImdbColumnVideosTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('videos', function (Blueprint $table) { $table->integer('imdb')->unsigned()->default(0)->index('ix_videos_imdb')->comment('ID number for IMDB site (without the \'tt\' prefix).'); diff --git a/database/migrations/2020_01_07_001831_add_unique_index_to_api_token.php b/database/migrations/2020_01_07_001831_add_unique_index_to_api_token.php index 3d57d7d18..583e7582c 100644 --- a/database/migrations/2020_01_07_001831_add_unique_index_to_api_token.php +++ b/database/migrations/2020_01_07_001831_add_unique_index_to_api_token.php @@ -11,7 +11,7 @@ class AddUniqueIndexToApiToken extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->unique('api_token', 'ux_users_api_token'); @@ -23,7 +23,7 @@ class AddUniqueIndexToApiToken extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropUnique('ux_users_api_token'); diff --git a/database/migrations/2020_02_17_213449_add_timezone_column_to_users_table.php b/database/migrations/2020_02_17_213449_add_timezone_column_to_users_table.php index 6a9c3ac49..6efe2d908 100644 --- a/database/migrations/2020_02_17_213449_add_timezone_column_to_users_table.php +++ b/database/migrations/2020_02_17_213449_add_timezone_column_to_users_table.php @@ -10,7 +10,7 @@ class AddTimezoneColumnToUsersTable extends Migration * * @return void */ - public function up() + public function up(): void { if (! Schema::hasColumn('users', 'timezone')) { Schema::table('users', function (Blueprint $table) { @@ -24,7 +24,7 @@ class AddTimezoneColumnToUsersTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('timezone'); diff --git a/database/migrations/2020_03_07_213224_remove_text_hash.php b/database/migrations/2020_03_07_213224_remove_text_hash.php index 0f07cc33e..96a76f6e0 100644 --- a/database/migrations/2020_03_07_213224_remove_text_hash.php +++ b/database/migrations/2020_03_07_213224_remove_text_hash.php @@ -11,7 +11,7 @@ class RemoveTextHash extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('release_comments', function (Blueprint $table) { $sm = Schema::getConnection()->getDoctrineSchemaManager(); @@ -30,7 +30,7 @@ class RemoveTextHash extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('release_comments', function (Blueprint $table) { $table->string('text_hash', 32)->default(''); diff --git a/database/migrations/2020_07_09_223527_create_release_informs_table.php b/database/migrations/2020_07_09_223527_create_release_informs_table.php index 562e4986f..895d1bfe2 100644 --- a/database/migrations/2020_07_09_223527_create_release_informs_table.php +++ b/database/migrations/2020_07_09_223527_create_release_informs_table.php @@ -11,7 +11,7 @@ class CreateReleaseInformsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('release_informs', function (Blueprint $table) { $table->id(); @@ -27,7 +27,7 @@ class CreateReleaseInformsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('release_informs'); } diff --git a/database/migrations/2020_08_08_212118_create_jobs_table.php b/database/migrations/2020_08_08_212118_create_jobs_table.php index 748f1e843..8779437b5 100644 --- a/database/migrations/2020_08_08_212118_create_jobs_table.php +++ b/database/migrations/2020_08_08_212118_create_jobs_table.php @@ -11,7 +11,7 @@ class CreateJobsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('jobs', function (Blueprint $table) { $table->id(); @@ -29,7 +29,7 @@ class CreateJobsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('jobs'); } diff --git a/database/migrations/2020_09_27_163455_add_uuid_to_failed_jobs_table.php b/database/migrations/2020_09_27_163455_add_uuid_to_failed_jobs_table.php index 238b3dcb3..f026a9ef2 100644 --- a/database/migrations/2020_09_27_163455_add_uuid_to_failed_jobs_table.php +++ b/database/migrations/2020_09_27_163455_add_uuid_to_failed_jobs_table.php @@ -11,7 +11,7 @@ class AddUuidToFailedJobsTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('failed_jobs', function (Blueprint $table) { // @@ -23,7 +23,7 @@ class AddUuidToFailedJobsTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('failed_jobs', function (Blueprint $table) { // diff --git a/database/migrations/2020_12_27_214949_create_password_securities_table.php b/database/migrations/2020_12_27_214949_create_password_securities_table.php index 0208130ff..f55ee22a4 100644 --- a/database/migrations/2020_12_27_214949_create_password_securities_table.php +++ b/database/migrations/2020_12_27_214949_create_password_securities_table.php @@ -11,7 +11,7 @@ class CreatePasswordSecuritiesTable extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('password_securities', function (Blueprint $table) { $table->id(); @@ -27,7 +27,7 @@ class CreatePasswordSecuritiesTable extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('password_securities'); } diff --git a/database/migrations/2022_02_07_220221_add_timestamps_columns_to_missed_parts.php b/database/migrations/2022_02_07_220221_add_timestamps_columns_to_missed_parts.php index 3e39de43e..c55e0c6ab 100644 --- a/database/migrations/2022_02_07_220221_add_timestamps_columns_to_missed_parts.php +++ b/database/migrations/2022_02_07_220221_add_timestamps_columns_to_missed_parts.php @@ -11,7 +11,7 @@ class AddTimestampsColumnsToMissedParts extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('missed_parts', function (Blueprint $table) { $table->timestamps(); @@ -23,7 +23,7 @@ class AddTimestampsColumnsToMissedParts extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('missed_parts', function (Blueprint $table) { $table->timestamps(); diff --git a/database/seeders/BinaryblacklistTableSeeder.php b/database/seeders/BinaryblacklistTableSeeder.php index 21cca21c2..3d65a3b53 100644 --- a/database/seeders/BinaryblacklistTableSeeder.php +++ b/database/seeders/BinaryblacklistTableSeeder.php @@ -12,7 +12,7 @@ class BinaryblacklistTableSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { DB::table('binaryblacklist')->delete(); diff --git a/database/seeders/CategoriesTableSeeder.php b/database/seeders/CategoriesTableSeeder.php index 83d5f1a3e..5c49bae54 100644 --- a/database/seeders/CategoriesTableSeeder.php +++ b/database/seeders/CategoriesTableSeeder.php @@ -12,7 +12,7 @@ class CategoriesTableSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { DB::statement('SET FOREIGN_KEY_CHECKS=0;'); diff --git a/database/seeders/CategoryRegexesTableSeeder.php b/database/seeders/CategoryRegexesTableSeeder.php index 1c6304425..4bb1f1788 100644 --- a/database/seeders/CategoryRegexesTableSeeder.php +++ b/database/seeders/CategoryRegexesTableSeeder.php @@ -12,7 +12,7 @@ class CategoryRegexesTableSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { DB::table('category_regexes')->delete(); diff --git a/database/seeders/CollectionRegexesTableSeeder.php b/database/seeders/CollectionRegexesTableSeeder.php index cebdb6725..53b3ed87c 100644 --- a/database/seeders/CollectionRegexesTableSeeder.php +++ b/database/seeders/CollectionRegexesTableSeeder.php @@ -12,7 +12,7 @@ class CollectionRegexesTableSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { DB::table('collection_regexes')->delete(); diff --git a/database/seeders/ContentTableSeeder.php b/database/seeders/ContentTableSeeder.php index 786e37a87..141fbcb80 100644 --- a/database/seeders/ContentTableSeeder.php +++ b/database/seeders/ContentTableSeeder.php @@ -12,7 +12,7 @@ class ContentTableSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { DB::table('content')->delete(); diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 9d2ef53e1..9f7e8dc86 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -12,7 +12,7 @@ class DatabaseSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { // $this->call(UsersTableSeeder::class); // \App\Models\User::factory(10)->create(); diff --git a/database/seeders/GenresTableSeeder.php b/database/seeders/GenresTableSeeder.php index bb4b8f055..3b6d022f0 100644 --- a/database/seeders/GenresTableSeeder.php +++ b/database/seeders/GenresTableSeeder.php @@ -12,7 +12,7 @@ class GenresTableSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { DB::table('genres')->delete(); diff --git a/database/seeders/GroupsTableSeeder.php b/database/seeders/GroupsTableSeeder.php index d5cf74db7..2da340fb1 100644 --- a/database/seeders/GroupsTableSeeder.php +++ b/database/seeders/GroupsTableSeeder.php @@ -12,7 +12,7 @@ class GroupsTableSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { DB::table('usenet_groups')->delete(); diff --git a/database/seeders/ReleaseNamingRegexesTableSeeder.php b/database/seeders/ReleaseNamingRegexesTableSeeder.php index 71561b3d8..a1b6f6d60 100644 --- a/database/seeders/ReleaseNamingRegexesTableSeeder.php +++ b/database/seeders/ReleaseNamingRegexesTableSeeder.php @@ -12,7 +12,7 @@ class ReleaseNamingRegexesTableSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { DB::table('release_naming_regexes')->delete(); diff --git a/database/seeders/RolesAndPermissionsSeeder.php b/database/seeders/RolesAndPermissionsSeeder.php index 7df6f2f02..ce1fe8252 100644 --- a/database/seeders/RolesAndPermissionsSeeder.php +++ b/database/seeders/RolesAndPermissionsSeeder.php @@ -13,7 +13,7 @@ class RolesAndPermissionsSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { // Reset cached roles and permissions app('cache')->forget('spatie.permission.cache'); diff --git a/database/seeders/RootCategoriesTableSeeder.php b/database/seeders/RootCategoriesTableSeeder.php index 2ff221080..786e90eab 100644 --- a/database/seeders/RootCategoriesTableSeeder.php +++ b/database/seeders/RootCategoriesTableSeeder.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; class RootCategoriesTableSeeder extends Seeder { - public function run() + public function run(): void { DB::table('root_categories')->delete(); diff --git a/database/seeders/SettingsTableSeeder.php b/database/seeders/SettingsTableSeeder.php index 7c855607a..42991be7c 100644 --- a/database/seeders/SettingsTableSeeder.php +++ b/database/seeders/SettingsTableSeeder.php @@ -12,7 +12,7 @@ class SettingsTableSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { DB::table('settings')->delete(); diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index 547152f6a..a3e444031 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -2,6 +2,7 @@ namespace Tests; +use Illuminate\Foundation\Application; use Illuminate\Contracts\Console\Kernel; trait CreatesApplication @@ -11,7 +12,7 @@ trait CreatesApplication * * @return \Illuminate\Foundation\Application */ - public function createApplication() + public function createApplication(): Application { $app = require __DIR__.'/../bootstrap/app.php'; diff --git a/tests/Feature/BooksTest.php b/tests/Feature/BooksTest.php index c602d598d..83ade8800 100644 --- a/tests/Feature/BooksTest.php +++ b/tests/Feature/BooksTest.php @@ -10,7 +10,7 @@ class BooksTest extends TestCase * @throws \DariusIII\ItunesApi\Exceptions\InvalidProviderException * @throws \Exception */ - public function testFetchItunesBookProperties() + public function testFetchItunesBookProperties(): void { $book = (new \Blacklight\Books())->fetchItunesBookProperties('The Volunteer'); diff --git a/tests/Feature/GetBooksBrowseByOptionsTest.php b/tests/Feature/GetBooksBrowseByOptionsTest.php index f233069b8..e6049aff2 100644 --- a/tests/Feature/GetBooksBrowseByOptionsTest.php +++ b/tests/Feature/GetBooksBrowseByOptionsTest.php @@ -10,7 +10,7 @@ class GetBooksBrowseByOptionsTest extends TestCase /** * @throws \Exception */ - public function testBookBrowseByTest() + public function testBookBrowseByTest(): void { $books = (new Books())->getBrowseByOptions(); $this->assertArrayHasKey('author', $books); diff --git a/tests/Feature/SettingsTest.php b/tests/Feature/SettingsTest.php index a9830014a..d3e5b6d11 100644 --- a/tests/Feature/SettingsTest.php +++ b/tests/Feature/SettingsTest.php @@ -6,7 +6,7 @@ use Tests\TestCase; class SettingsTest extends TestCase { - public function testSettingValue() + public function testSettingValue(): void { $name = config('app.name'); diff --git a/tests/Install/InstallTest.php b/tests/Install/InstallTest.php index 6a5f5fe2d..10dce04c9 100644 --- a/tests/Install/InstallTest.php +++ b/tests/Install/InstallTest.php @@ -20,7 +20,7 @@ require_once \dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; */ class InstallTest extends \PHPUnit\Framework\TestCase { - public function testFullInstall() + public function testFullInstall(): void { passthru('php '.base_path().'/artisan migrate:fresh --seed');