Update phpstan level to 6

This commit is contained in:
DariusIII
2026-02-11 14:02:26 +01:00
parent eed6250518
commit f4c444c9b0
291 changed files with 3684 additions and 1089 deletions
+2 -2
View File
@@ -48,7 +48,7 @@ class CleanNZB extends Command
} }
} }
private function GetNZBsWithNoDatabaseEntry($delete = false) private function GetNZBsWithNoDatabaseEntry(mixed $delete = false): void
{ {
$this->info('Getting list of NZB files on disk to check if they exist in database'); $this->info('Getting list of NZB files on disk to check if they exist in database');
$releases = new Release; $releases = new Release;
@@ -76,7 +76,7 @@ class CleanNZB extends Command
$this->info("Checked: $checked / Deleted: $deleted"); $this->info("Checked: $checked / Deleted: $deleted");
} }
private function GetReleasesWithNoNZBOnDisk($delete = false) private function GetReleasesWithNoNZBOnDisk(mixed $delete = false): void
{ {
// Setup // Setup
$nzb = app(NzbService::class); $nzb = app(NzbService::class);
+1 -1
View File
@@ -29,7 +29,7 @@ class CollectStats extends Command
/** /**
* Execute the console command. * Execute the console command.
*/ */
public function handle() public function handle(): void
{ {
$this->info('Collecting site stats...'); $this->info('Collecting site stats...');
GrabStat::insertTopGrabbers(); GrabStat::insertTopGrabbers();
@@ -154,6 +154,8 @@ class CreateManticoreIndexes extends Command
/** /**
* Create a single index with error handling. * Create a single index with error handling.
*
* @param array<string, mixed> $schema
*/ */
protected function createIndex(string $indexName, array $schema, bool $dropExisting): bool protected function createIndex(string $indexName, array $schema, bool $dropExisting): bool
{ {
@@ -141,6 +141,8 @@ class CreateMediaIndexes extends Command
/** /**
* Create a single Manticore index. * Create a single Manticore index.
*
* @param array<string, mixed> $schema
*/ */
private function createManticoreIndex(Client $client, string $indexName, array $schema, bool $dropExisting): bool private function createManticoreIndex(Client $client, string $indexName, array $schema, bool $dropExisting): bool
{ {
+6
View File
@@ -174,6 +174,8 @@ class DeleteReleases extends Command
/** /**
* Perform a dry run to show what releases would be deleted. * Perform a dry run to show what releases would be deleted.
*
* @param array<string, mixed> $criteria
*/ */
protected function performDryRun(array $criteria): int protected function performDryRun(array $criteria): int
{ {
@@ -234,6 +236,8 @@ class DeleteReleases extends Command
/** /**
* Build the SQL query from criteria array. * Build the SQL query from criteria array.
*
* @param array<string, mixed> $criteria
*/ */
protected function buildQueryFromCriteria(array $criteria): ?string protected function buildQueryFromCriteria(array $criteria): ?string
{ {
@@ -396,6 +400,8 @@ class DeleteReleases extends Command
/** /**
* Build criteria array from simple command options. * Build criteria array from simple command options.
*
* @return array<string, mixed>
*/ */
protected function buildCriteriaFromOptions(): array protected function buildCriteriaFromOptions(): array
{ {
@@ -14,7 +14,7 @@ class FindSizeMismatchedReleases extends Command
protected $description = 'Find releases where size differs significantly from release_files total. Use --direction=bigger|smaller|any'; protected $description = 'Find releases where size differs significantly from release_files total. Use --direction=bigger|smaller|any';
public function handle() public function handle(): void
{ {
$threshold = $this->option('threshold'); // Percentage difference threshold $threshold = $this->option('threshold'); // Percentage difference threshold
$limit = $this->option('limit'); $limit = $this->option('limit');
@@ -124,7 +124,7 @@ class FindSizeMismatchedReleases extends Command
return null; return null;
} }
private function outputReleaseIdsAsCsv($mismatches): void private function outputReleaseIdsAsCsv(mixed $mismatches): void
{ {
$releaseIds = $mismatches->pluck('id')->join(','); $releaseIds = $mismatches->pluck('id')->join(',');
$this->line("\nRelease IDs in CSV format:"); $this->line("\nRelease IDs in CSV format:");
+3
View File
@@ -87,6 +87,9 @@ class GetArticleRange extends Command
/** /**
* Update group records based on mode. * Update group records based on mode.
*
* @param array<string, mixed> $groupMySQL
* @param array<string, mixed> $return
*/ */
private function updateGroupRecords(string $mode, array $groupMySQL, array $return): void private function updateGroupRecords(string $mode, array $groupMySQL, array $return): void
{ {
+1 -1
View File
@@ -52,7 +52,7 @@ class MatchPrefiles extends Command
try { try {
$nameFixingService = new NameFixingService; $nameFixingService = new NameFixingService;
$nameFixingService->getPreFileNames($argv); $nameFixingService->getPreFileNames($argv); // @phpstan-ignore argument.type
return 0; return 0;
} catch (Exception $e) { } catch (Exception $e) {
+10 -2
View File
@@ -96,7 +96,7 @@ class NntmuxOffsetPopulate extends Command
// Start parallel processes // Start parallel processes
foreach ($ranges as $i => $range) { foreach ($ranges as $i => $range) {
$command = $this->buildWorkerCommand($engine, $index, $range['offset'], $range['limit'], $i); $command = $this->buildWorkerCommand($engine, $index, $range['offset'], $range['limit'], $i); // @phpstan-ignore argument.type
$this->info("Starting worker process {$i}: processing {$range['limit']} records from offset {$range['offset']}"); $this->info("Starting worker process {$i}: processing {$range['limit']} records from offset {$range['offset']}");
$process = Process::start($command); $process = Process::start($command);
@@ -108,7 +108,7 @@ class NntmuxOffsetPopulate extends Command
} }
// Monitor processes // Monitor processes
$this->monitorProcesses($processes); $this->monitorProcesses($processes); // @phpstan-ignore argument.type
// Verify final count // Verify final count
$this->verifyIndexPopulation($engine, $index, $total); $this->verifyIndexPopulation($engine, $index, $total);
@@ -120,6 +120,8 @@ class NntmuxOffsetPopulate extends Command
/** /**
* Create offset-based ranges for parallel execution * Create offset-based ranges for parallel execution
*
* @return array<string, mixed>
*/ */
private function createOffsetRanges(int $total, int $processes): array private function createOffsetRanges(int $total, int $processes): array
{ {
@@ -144,6 +146,8 @@ class NntmuxOffsetPopulate extends Command
/** /**
* Build worker command for offset-based parallel processing * Build worker command for offset-based parallel processing
*
* @return list<array<string, float|int<0, max>>>
*/ */
private function buildWorkerCommand(string $engine, string $index, int $offset, int $limit, int $workerId): string private function buildWorkerCommand(string $engine, string $index, int $offset, int $limit, int $workerId): string
{ {
@@ -176,6 +180,8 @@ class NntmuxOffsetPopulate extends Command
/** /**
* Monitor parallel processes * Monitor parallel processes
*
* @param array<string, mixed> $processes
*/ */
private function monitorProcesses(array $processes): void private function monitorProcesses(array $processes): void
{ {
@@ -353,6 +359,8 @@ class NntmuxOffsetPopulate extends Command
/** /**
* Get index mappings * Get index mappings
*
* @return array<string, mixed>
*/ */
private function getIndexMappings(string $indexName): array private function getIndexMappings(string $indexName): array
{ {
+7 -3
View File
@@ -104,7 +104,7 @@ class NntmuxOffsetWorker extends Command
$processed++; $processed++;
if (count($batchData) >= $batchSize) { if (count($batchData) >= $batchSize) {
$this->processSearchBatch($batchData, $workerId); $this->processSearchBatch($batchData, $workerId); // @phpstan-ignore argument.type
$this->info("Worker {$workerId}: Inserted batch of ".count($batchData).' records'); $this->info("Worker {$workerId}: Inserted batch of ".count($batchData).' records');
$batchData = []; $batchData = [];
} }
@@ -117,7 +117,7 @@ class NntmuxOffsetWorker extends Command
// Process remaining items // Process remaining items
if (! empty($batchData)) { if (! empty($batchData)) {
$this->processSearchBatch($batchData, $workerId); $this->processSearchBatch($batchData, $workerId); // @phpstan-ignore argument.type
$this->info("Worker {$workerId}: Inserted final batch of ".count($batchData).' records'); $this->info("Worker {$workerId}: Inserted final batch of ".count($batchData).' records');
} }
@@ -161,7 +161,7 @@ class NntmuxOffsetWorker extends Command
/** /**
* Build offset-based query * Build offset-based query
*/ */
private function buildOffsetQuery(string $index, int $offset, int $limit) private function buildOffsetQuery(string $index, int $offset, int $limit): mixed
{ {
if ($index === 'releases') { if ($index === 'releases') {
return Release::query() return Release::query()
@@ -247,6 +247,8 @@ class NntmuxOffsetWorker extends Command
/** /**
* Process search batch * Process search batch
*
* @param array<string, mixed> $data
*/ */
private function processSearchBatch(array $data, int $workerId): void private function processSearchBatch(array $data, int $workerId): void
{ {
@@ -269,6 +271,8 @@ class NntmuxOffsetWorker extends Command
/** /**
* Process ElasticSearch batch * Process ElasticSearch batch
*
* @param array<string, mixed> $data
*/ */
private function processElasticBatch(array $data, int $workerId): void private function processElasticBatch(array $data, int $workerId): void
{ {
@@ -32,7 +32,7 @@ class NntmuxOptimizeTables extends Command
if (empty($table) || $table[0] === 'all') { if (empty($table) || $table[0] === 'all') {
$this->optimizeAllTables(); $this->optimizeAllTables();
} else { } else {
$this->optimizeTable($table); $this->optimizeTable($table); // @phpstan-ignore argument.type
} }
} }
@@ -49,6 +49,8 @@ class NntmuxOptimizeTables extends Command
/** /**
* Optimize a single table. * Optimize a single table.
*
* @param array<string, mixed> $tables
*/ */
private function optimizeTable(array|string $tables): void private function optimizeTable(array|string $tables): void
{ {
@@ -61,7 +63,7 @@ class NntmuxOptimizeTables extends Command
} }
} }
private function tableCheck($table): void private function tableCheck(mixed $table): void
{ {
$this->info('Checking table: '.$table); $this->info('Checking table: '.$table);
$tableCheck = DB::select('CHECK TABLE '.$table); $tableCheck = DB::select('CHECK TABLE '.$table);
@@ -355,7 +355,7 @@ class NntmuxPopulateSearchIndexes extends Command
/** /**
* Process data for ManticoreSearch with optimizations * Process data for ManticoreSearch with optimizations
*/ */
private function processManticoreData(string $indexName, int $total, $query, callable $transformer): int private function processManticoreData(string $indexName, int $total, mixed $query, callable $transformer): int
{ {
$chunkSize = $this->getChunkSize(); $chunkSize = $this->getChunkSize();
$batchSize = $this->getBatchSize(); $batchSize = $this->getBatchSize();
@@ -388,7 +388,7 @@ class NntmuxPopulateSearchIndexes extends Command
// Process in optimized batch sizes // Process in optimized batch sizes
if (count($batchData) >= $batchSize) { if (count($batchData) >= $batchSize) {
$this->processBatch($indexName, $batchData); $this->processBatch($indexName, $batchData); // @phpstan-ignore argument.type
$batchData = []; $batchData = [];
} }
} catch (Exception $e) { } catch (Exception $e) {
@@ -403,7 +403,7 @@ class NntmuxPopulateSearchIndexes extends Command
// Process remaining items // Process remaining items
if (! empty($batchData)) { if (! empty($batchData)) {
$this->processBatch($indexName, $batchData); $this->processBatch($indexName, $batchData); // @phpstan-ignore argument.type
} }
$bar->finish(); $bar->finish();
@@ -431,7 +431,7 @@ class NntmuxPopulateSearchIndexes extends Command
/** /**
* Process data for ManticoreSearch movies index * Process data for ManticoreSearch movies index
*/ */
private function processManticoreMoviesData(string $indexName, int $total, $query, callable $transformer): int private function processManticoreMoviesData(string $indexName, int $total, mixed $query, callable $transformer): int
{ {
$chunkSize = $this->getChunkSize(); $chunkSize = $this->getChunkSize();
$batchSize = $this->getBatchSize(); $batchSize = $this->getBatchSize();
@@ -463,7 +463,7 @@ class NntmuxPopulateSearchIndexes extends Command
// Process in optimized batch sizes // Process in optimized batch sizes
if (count($batchData) >= $batchSize) { if (count($batchData) >= $batchSize) {
$this->processMoviesBatch($batchData); $this->processMoviesBatch($batchData); // @phpstan-ignore argument.type
$batchData = []; $batchData = [];
} }
} catch (Exception $e) { } catch (Exception $e) {
@@ -478,7 +478,7 @@ class NntmuxPopulateSearchIndexes extends Command
// Process remaining items // Process remaining items
if (! empty($batchData)) { if (! empty($batchData)) {
$this->processMoviesBatch($batchData); $this->processMoviesBatch($batchData); // @phpstan-ignore argument.type
} }
$bar->finish(); $bar->finish();
@@ -506,7 +506,7 @@ class NntmuxPopulateSearchIndexes extends Command
/** /**
* Process data for ManticoreSearch TV shows index * Process data for ManticoreSearch TV shows index
*/ */
private function processManticoreTvShowsData(string $indexName, int $total, $query, callable $transformer): int private function processManticoreTvShowsData(string $indexName, int $total, mixed $query, callable $transformer): int
{ {
$chunkSize = $this->getChunkSize(); $chunkSize = $this->getChunkSize();
$batchSize = $this->getBatchSize(); $batchSize = $this->getBatchSize();
@@ -538,7 +538,7 @@ class NntmuxPopulateSearchIndexes extends Command
// Process in optimized batch sizes // Process in optimized batch sizes
if (count($batchData) >= $batchSize) { if (count($batchData) >= $batchSize) {
$this->processTvShowsBatch($batchData); $this->processTvShowsBatch($batchData); // @phpstan-ignore argument.type
$batchData = []; $batchData = [];
} }
} catch (Exception $e) { } catch (Exception $e) {
@@ -553,7 +553,7 @@ class NntmuxPopulateSearchIndexes extends Command
// Process remaining items // Process remaining items
if (! empty($batchData)) { if (! empty($batchData)) {
$this->processTvShowsBatch($batchData); $this->processTvShowsBatch($batchData); // @phpstan-ignore argument.type
} }
$bar->finish(); $bar->finish();
@@ -666,7 +666,7 @@ class NntmuxPopulateSearchIndexes extends Command
/** /**
* Process data for ElasticSearch with optimizations * Process data for ElasticSearch with optimizations
*/ */
private function processElasticData(string $indexName, int $total, $query, callable $transformer): int private function processElasticData(string $indexName, int $total, mixed $query, callable $transformer): int
{ {
$chunkSize = $this->getChunkSize(); $chunkSize = $this->getChunkSize();
$batchSize = $this->getBatchSize(); $batchSize = $this->getBatchSize();
@@ -748,6 +748,8 @@ class NntmuxPopulateSearchIndexes extends Command
/** /**
* Process search index batch with retry logic * Process search index batch with retry logic
*
* @param array<string, mixed> $data
*/ */
private function processBatch(string $indexName, array $data): void private function processBatch(string $indexName, array $data): void
{ {
@@ -777,6 +779,8 @@ class NntmuxPopulateSearchIndexes extends Command
/** /**
* Process movies batch with retry logic * Process movies batch with retry logic
*
* @param array<string, mixed> $data
*/ */
private function processMoviesBatch(array $data): void private function processMoviesBatch(array $data): void
{ {
@@ -799,6 +803,8 @@ class NntmuxPopulateSearchIndexes extends Command
/** /**
* Process TV shows batch with retry logic * Process TV shows batch with retry logic
*
* @param array<string, mixed> $data
*/ */
private function processTvShowsBatch(array $data): void private function processTvShowsBatch(array $data): void
{ {
@@ -821,6 +827,8 @@ class NntmuxPopulateSearchIndexes extends Command
/** /**
* Process ElasticSearch batch with retry logic * Process ElasticSearch batch with retry logic
*
* @param array<string, mixed> $data
*/ */
private function processElasticBatch(array $data, int &$errorCount): void private function processElasticBatch(array $data, int &$errorCount): void
{ {
@@ -38,9 +38,9 @@ class NntmuxPopulateSteamApps extends Command
$this->info(sprintf( $this->info(sprintf(
'Added %d new steam app(s), %d skipped, %d errors', 'Added %d new steam app(s), %d skipped, %d errors',
$stats['inserted'], $stats['inserted'], // @phpstan-ignore offsetAccess.notFound
$stats['skipped'], $stats['skipped'], // @phpstan-ignore offsetAccess.notFound
$stats['errors'] $stats['errors'] // @phpstan-ignore offsetAccess.notFound
)); ));
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error($e->getMessage()); $this->error($e->getMessage());
@@ -9,9 +9,9 @@ use Illuminate\Console\Command;
class NntmuxResetPostProcessing extends Command class NntmuxResetPostProcessing extends Command
{ {
/** /**
* @var array * @var array<string, mixed>
*/ */
private static $allowedCategories = [ private static $allowedCategories = [ // @phpstan-ignore property.defaultValue
'music', 'music',
'console', 'console',
'movie', 'movie',
@@ -96,7 +96,7 @@ class NntmuxResetPostProcessing extends Command
$this->info('No releases to reset'); $this->info('No releases to reset');
} }
} else { } else {
$normalized = $this->normalizeCategories($raw); $normalized = $this->normalizeCategories($raw); // @phpstan-ignore argument.type
// Validate // Validate
$invalid = $this->invalidCategories($normalized); $invalid = $this->invalidCategories($normalized);
@@ -154,6 +154,9 @@ class NntmuxResetPostProcessing extends Command
* Normalize raw category options into a unique, lowercased list. * Normalize raw category options into a unique, lowercased list.
* Handles comma-separated values, repeated options, casing, simple plurals, * Handles comma-separated values, repeated options, casing, simple plurals,
* and values provided as key=value (e.g. category=tv or the single-dash typo -category=tv). * and values provided as key=value (e.g. category=tv or the single-dash typo -category=tv).
*
* @param array<string, mixed> $raw
* @return array<string, mixed>
*/ */
private function normalizeCategories(array $raw): array private function normalizeCategories(array $raw): array
{ {
@@ -190,6 +193,9 @@ class NntmuxResetPostProcessing extends Command
/** /**
* Return invalid categories from a normalized list. * Return invalid categories from a normalized list.
* Keeps 'all' as a special allowed token. * Keeps 'all' as a special allowed token.
*
* @param array<string, mixed> $normalized
* @return array<int, string>
*/ */
private function invalidCategories(array $normalized): array private function invalidCategories(array $normalized): array
{ {
+1 -1
View File
@@ -38,7 +38,7 @@ class ProcessBackfill extends Command
} }
try { try {
(new ForkingService)->backfill($options); (new ForkingService)->backfill($options); // @phpstan-ignore argument.type
return self::SUCCESS; return self::SUCCESS;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -97,8 +97,9 @@ class RecategorizeReleases extends Command
$this->line(''); $this->line('');
$this->output->writeln('<fg=yellow>ID :</> '.$result->id); $this->output->writeln('<fg=yellow>ID :</> '.$result->id);
$this->output->writeln('<fg=green>Release :</> '.$result->searchname); $this->output->writeln('<fg=green>Release :</> '.$result->searchname);
$this->output->writeln('<fg=cyan>Group :</> '.$result->group->name); // @phpstan-ignore property.notFound $this->output->writeln('<fg=cyan>Group :</> '.$result->group->name);
$oldCategoryTitle = $result->category?->parent ? ($result->category->parent->title.' -> '.$result->category->title) : ($result->category?->title ?? 'N/A'); // @phpstan-ignore property.notFound, property.notFound, property.notFound, nullsafe.neverNull $oldCategoryTitle = $result->category?->parent ? ($result->category->parent->title.' -> '.$result->category->title) : ($result->category?->title ?? 'N/A'); // @phpstan-ignore nullsafe.neverNull
$newCategoryTitle = $newCatName?->parent ? ($newCatName->parent->title.' -> '.$newCatName->title) : ($newCatName?->title ?? 'N/A'); // @phpstan-ignore nullsafe.neverNull $newCategoryTitle = $newCatName?->parent ? ($newCatName->parent->title.' -> '.$newCatName->title) : ($newCatName?->title ?? 'N/A'); // @phpstan-ignore nullsafe.neverNull
$this->output->writeln('<fg=white>Category :</> '.$oldCategoryTitle.' <fg=yellow>→</> <fg=magenta>'.$newCategoryTitle.'</>'); $this->output->writeln('<fg=white>Category :</> '.$oldCategoryTitle.' <fg=yellow>→</> <fg=magenta>'.$newCategoryTitle.'</>');
$this->line(''); $this->line('');
+2
View File
@@ -64,6 +64,8 @@ class RedisMonitor extends Command
/** /**
* Display stats in table format (for --once mode). * Display stats in table format (for --once mode).
*
* @param array<string, mixed> $stats
*/ */
protected function displayStats(array $stats): void protected function displayStats(array $stats): void
{ {
+1 -1
View File
@@ -200,7 +200,7 @@ class RefreshAnimeData extends Command
continue; continue;
} }
$anilistData = $searchResults[0]; $anilistData = $searchResults[0]; // @phpstan-ignore offsetAccess.notFound
$anilistId = $anilistData['id'] ?? null; $anilistId = $anilistData['id'] ?? null;
if (! $anilistId) { if (! $anilistId) {
@@ -325,7 +325,7 @@ class ReleasesFixNamesGroup extends Command
/** /**
* Fetch releases for processing * Fetch releases for processing
*/ */
protected function fetchReleases(string $guidChar, int $maxPerRun) protected function fetchReleases(string $guidChar, int $maxPerRun): mixed
{ {
return Release::fromQuery(sprintf(" return Release::fromQuery(sprintf("
SELECT SELECT
+2
View File
@@ -93,6 +93,8 @@ class SteamLookupGame extends Command
/** /**
* Display game details in a formatted way. * Display game details in a formatted way.
*
* @param array<string, mixed> $details
*/ */
protected function displayGameDetails(array $details): void protected function displayGameDetails(array $details): void
{ {
+12
View File
@@ -142,6 +142,8 @@ class TmuxMonitor extends Command
/** /**
* Run tasks in appropriate panes * Run tasks in appropriate panes
*
* @param array<string, mixed> $runVar
*/ */
private function runPaneTasks(array $runVar): void private function runPaneTasks(array $runVar): void
{ {
@@ -165,6 +167,8 @@ class TmuxMonitor extends Command
/** /**
* Run IRC scraper * Run IRC scraper
*
* @param array<string, mixed> $runVar
*/ */
private function runIRCScraper(array $runVar): void private function runIRCScraper(array $runVar): void
{ {
@@ -175,6 +179,8 @@ class TmuxMonitor extends Command
/** /**
* Run full non-sequential tasks * Run full non-sequential tasks
*
* @param array<string, mixed> $runVar
*/ */
private function runFullTasks(array $runVar): void private function runFullTasks(array $runVar): void
{ {
@@ -193,6 +199,8 @@ class TmuxMonitor extends Command
/** /**
* Run basic sequential tasks * Run basic sequential tasks
*
* @param array<string, mixed> $runVar
*/ */
private function runBasicTasks(array $runVar): void private function runBasicTasks(array $runVar): void
{ {
@@ -205,6 +213,8 @@ class TmuxMonitor extends Command
/** /**
* Run stripped sequential tasks * Run stripped sequential tasks
*
* @param array<string, mixed> $runVar
*/ */
private function runSequentialTasks(array $runVar): void private function runSequentialTasks(array $runVar): void
{ {
@@ -214,6 +224,8 @@ class TmuxMonitor extends Command
/** /**
* Run post-processing tasks (common to most modes) * Run post-processing tasks (common to most modes)
*
* @param array<string, mixed> $runVar
*/ */
private function runPostProcessingTasks(array $runVar): void private function runPostProcessingTasks(array $runVar): void
{ {
+4
View File
@@ -304,6 +304,8 @@ class UpdateNNTmux extends Command
/** /**
* Parse environment file into key-value pairs * Parse environment file into key-value pairs
*
* @return array<string, mixed>
*/ */
private function parseEnvFile(string $path): array private function parseEnvFile(string $path): array
{ {
@@ -329,6 +331,8 @@ class UpdateNNTmux extends Command
/** /**
* Add missing environment variables to .env file * Add missing environment variables to .env file
*
* @param array<string, mixed> $missingKeys
*/ */
private function addMissingEnvVars(string $envPath, array $missingKeys): void private function addMissingEnvVars(string $envPath, array $missingKeys): void
{ {
@@ -35,6 +35,8 @@ class UpdateReleasesIndexSchema extends Command
/** /**
* The expected schema fields for releases_rt * The expected schema fields for releases_rt
*
* @var array<string, mixed>
*/ */
private array $expectedFields = [ private array $expectedFields = [
'name' => ['type' => 'text'], 'name' => ['type' => 'text'],
@@ -386,7 +388,7 @@ class UpdateReleasesIndexSchema extends Command
// Process batch when it reaches the threshold // Process batch when it reaches the threshold
if (count($batch) >= 1000) { if (count($batch) >= 1000) {
$result = $this->processBatch($indexName, $batch); $result = $this->processBatch($indexName, $batch); // @phpstan-ignore argument.type
$updated += $result['updated']; $updated += $result['updated'];
$errors += $result['errors']; $errors += $result['errors'];
$batch = []; $batch = [];
@@ -397,7 +399,7 @@ class UpdateReleasesIndexSchema extends Command
// Process remaining batch // Process remaining batch
if (! empty($batch)) { if (! empty($batch)) {
$result = $this->processBatch($indexName, $batch); $result = $this->processBatch($indexName, $batch); // @phpstan-ignore argument.type
$updated += $result['updated']; $updated += $result['updated'];
$errors += $result['errors']; $errors += $result['errors'];
} }
@@ -417,8 +419,10 @@ class UpdateReleasesIndexSchema extends Command
/** /**
* Prepare media data for a release * Prepare media data for a release
*
* @return array<string, mixed>
*/ */
private function prepareMediaData($release): array private function prepareMediaData(mixed $release): array
{ {
return [ return [
'imdbid' => (int) ($release->imdbid ?: 0), 'imdbid' => (int) ($release->imdbid ?: 0),
@@ -462,6 +466,9 @@ class UpdateReleasesIndexSchema extends Command
/** /**
* Process a batch of updates * Process a batch of updates
*
* @param array<string, mixed> $batch
* @return array<string, mixed>
*/ */
private function processBatch(string $indexName, array $batch): array private function processBatch(string $indexName, array $batch): array
{ {
@@ -494,6 +501,8 @@ class UpdateReleasesIndexSchema extends Command
/** /**
* Insert or replace a document in the index * Insert or replace a document in the index
* This is used as a fallback when UPDATE fails * This is used as a fallback when UPDATE fails
*
* @param array<string, mixed> $mediaData
*/ */
private function insertOrReplaceDocument(string $indexName, int $id, array $mediaData): void private function insertOrReplaceDocument(string $indexName, int $id, array $mediaData): void
{ {
@@ -34,6 +34,8 @@ class UpdateReleasesIndexSchemaES extends Command
/** /**
* The media fields that should exist in the releases index * The media fields that should exist in the releases index
*
* @var array<string, mixed>
*/ */
private array $mediaFields = [ private array $mediaFields = [
'imdbid' => ['type' => 'integer'], 'imdbid' => ['type' => 'integer'],
@@ -570,8 +572,10 @@ class UpdateReleasesIndexSchemaES extends Command
/** /**
* Prepare media data for a release * Prepare media data for a release
*
* @return array<string, mixed>
*/ */
private function prepareMediaData($release): array private function prepareMediaData(mixed $release): array
{ {
return [ return [
'imdbid' => (int) ($release->imdbid ?: 0), 'imdbid' => (int) ($release->imdbid ?: 0),
+1 -1
View File
@@ -20,7 +20,7 @@ class UserAccessedApi
/** /**
* Create a new event instance. * Create a new event instance.
*/ */
public function __construct($user, ?string $ip = null) public function __construct(mixed $user, ?string $ip = null)
{ {
$this->user = $user; $this->user = $user;
$this->ip = $ip; $this->ip = $ip;
+3 -6
View File
@@ -10,17 +10,14 @@ class UserLoggedIn
{ {
use Dispatchable, InteractsWithSockets, SerializesModels; use Dispatchable, InteractsWithSockets, SerializesModels;
/** public \App\Models\User $user;
* @var \App\Models\User
*/
public $user;
public $ip; public string $ip;
/** /**
* Create a new event instance. * Create a new event instance.
*/ */
public function __construct($user, $ip = '') public function __construct(\App\Models\User $user, string $ip = '')
{ {
$this->user = $user; $this->user = $user;
$this->ip = $ip; $this->ip = $ip;
@@ -19,7 +19,7 @@ if (! function_exists('getRawHtmlWithAgeVerification')) {
* @param string $url URL to fetch * @param string $url URL to fetch
* @param string|false $cookie Optional cookie string (legacy support) * @param string|false $cookie Optional cookie string (legacy support)
* @param string|null $postData Optional POST data * @param string|null $postData Optional POST data
* @return string|array|false * @return string|array<string, mixed>|false
*/ */
function getRawHtmlWithAgeVerification($url, $cookie = false, $postData = null) function getRawHtmlWithAgeVerification($url, $cookie = false, $postData = null)
{ {
@@ -106,7 +106,7 @@ if (! function_exists('initializeAdultSiteCookies')) {
* Initialize age verification cookies for all adult sites * Initialize age verification cookies for all adult sites
* Run this once during application setup * Run this once during application setup
* *
* @return array Statistics about initialized cookies * @return array<string, mixed> Statistics about initialized cookies
*/ */
function initializeAdultSiteCookies(): array function initializeAdultSiteCookies(): array
{ {
@@ -156,7 +156,7 @@ if (! function_exists('getAdultSiteCookieStats')) {
/** /**
* Get statistics about stored adult site cookies * Get statistics about stored adult site cookies
* *
* @return array Cookie statistics * @return array<string, mixed> Cookie statistics
*/ */
function getAdultSiteCookieStats(): array function getAdultSiteCookieStats(): array
{ {
+26 -13
View File
@@ -20,7 +20,7 @@ if (! function_exists('getRawHtml')) {
* @param bool $cookie * @param bool $cookie
* @return bool|mixed|string * @return bool|mixed|string
*/ */
function getRawHtml($url, $cookie = false, $postData = null) function getRawHtml(mixed $url, $cookie = false, mixed $postData = null)
{ {
// Check if this is an adult site that needs age verification // Check if this is an adult site that needs age verification
$adultSites = [ $adultSites = [
@@ -112,7 +112,7 @@ if (! function_exists('makeFieldLinks')) {
* *
* @throws Exception * @throws Exception
*/ */
function makeFieldLinks($data, $field, $type) function makeFieldLinks(mixed $data, mixed $field, mixed $type)
{ {
$tmpArr = explode(', ', $data[$field]); $tmpArr = explode(', ', $data[$field]);
$newArr = []; $newArr = [];
@@ -139,6 +139,7 @@ if (! function_exists('makeFieldLinks')) {
if (! function_exists('getUserBrowseOrder')) { if (! function_exists('getUserBrowseOrder')) {
/** /**
* @param string $orderBy * @param string $orderBy
* @return array<string, mixed>
*/ */
function getUserBrowseOrder($orderBy): array function getUserBrowseOrder($orderBy): array
{ {
@@ -163,6 +164,9 @@ if (! function_exists('getUserBrowseOrder')) {
} }
if (! function_exists('getUserBrowseOrdering')) { if (! function_exists('getUserBrowseOrdering')) {
/**
* @return array<int, string>
*/
function getUserBrowseOrdering(): array function getUserBrowseOrdering(): array
{ {
return [ return [
@@ -206,7 +210,7 @@ if (! function_exists('human_filesize')) {
/** /**
* @param int $decimals * @param int $decimals
*/ */
function human_filesize($bytes, $decimals = 0): string function human_filesize(mixed $bytes, $decimals = 0): string
{ {
$size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
$factor = (int) floor((\strlen((string) $bytes) - 1) / 3); $factor = (int) floor((\strlen((string) $bytes) - 1) / 3);
@@ -219,7 +223,7 @@ if (! function_exists('bcdechex')) {
/** /**
* @return string * @return string
*/ */
function bcdechex($dec) function bcdechex(mixed $dec)
{ {
$hex = ''; $hex = '';
do { do {
@@ -262,7 +266,7 @@ if (! function_exists('runCmd')) {
if (! function_exists('escapeString')) { if (! function_exists('escapeString')) {
function escapeString($string): string function escapeString(mixed $string): string
{ {
return DB::connection()->getPdo()->quote($string); return DB::connection()->getPdo()->quote($string);
} }
@@ -270,7 +274,7 @@ if (! function_exists('escapeString')) {
if (! function_exists('realDuration')) { if (! function_exists('realDuration')) {
function realDuration($milliseconds): string function realDuration(mixed $milliseconds): string
{ {
$time = round($milliseconds / 1000); $time = round($milliseconds / 1000);
@@ -282,7 +286,7 @@ if (! function_exists('is_it_json')) {
/** /**
* @throws JsonException * @throws JsonException
*/ */
function is_it_json($isIt): bool function is_it_json(mixed $isIt): bool
{ {
if (is_array($isIt)) { if (is_array($isIt)) {
return false; return false;
@@ -295,6 +299,8 @@ if (! function_exists('is_it_json')) {
if (! function_exists('getStreamingZip')) { if (! function_exists('getStreamingZip')) {
/** /**
* @param array<string, mixed> $guids
*
* @throws Exception * @throws Exception
*/ */
function getStreamingZip(array $guids = []): STS\ZipStream\Builder function getStreamingZip(array $guids = []): STS\ZipStream\Builder
@@ -461,7 +467,7 @@ if (! function_exists('getReleaseCover')) {
/** /**
* Get the cover image URL for a release based on its type and ID * Get the cover image URL for a release based on its type and ID
* *
* @param object|array $release The release object or array * @param object|array<string, mixed> $release The release object or array
* @return string The cover image URL or placeholder if no cover exists * @return string The cover image URL or placeholder if no cover exists
*/ */
function getReleaseCover($release): string function getReleaseCover($release): string
@@ -524,6 +530,10 @@ if (! function_exists('getReleaseCover')) {
} }
if (! function_exists('sanitize')) { if (! function_exists('sanitize')) {
/**
* @param array<string, mixed> $doNotSanitize
* @param array<string, mixed> $phrases
*/
function sanitize(array|string $phrases, array $doNotSanitize = []): string function sanitize(array|string $phrases, array $doNotSanitize = []): string
{ {
if (! is_array($phrases)) { if (! is_array($phrases)) {
@@ -658,7 +668,7 @@ if (! function_exists('getAvailableTimezones')) {
/** /**
* Get a list of available timezones grouped by region * Get a list of available timezones grouped by region
* *
* @return array Array of timezones grouped by region * @return array<string, mixed> Array of timezones grouped by region
*/ */
function getAvailableTimezones(): array function getAvailableTimezones(): array
{ {
@@ -737,7 +747,7 @@ if (! function_exists('streamSslContextOptions')) {
* when connecting to a tls or ssl connection when using stream functions (fopen/file_get_contents/etc). * when connecting to a tls or ssl connection when using stream functions (fopen/file_get_contents/etc).
* *
* @param bool $forceIgnore Force ignoring of verification (useful for self-signed certs in development). * @param bool $forceIgnore Force ignoring of verification (useful for self-signed certs in development).
* @return array Stream context options for SSL/TLS connections * @return array<string, mixed> Stream context options for SSL/TLS connections
*/ */
function streamSslContextOptions(bool $forceIgnore = false): array function streamSslContextOptions(bool $forceIgnore = false): array
{ {
@@ -775,6 +785,9 @@ if (! function_exists('streamSslContextOptions')) {
} }
if (! function_exists('getCoverURL')) { if (! function_exists('getCoverURL')) {
/**
* @param array<string, mixed> $options
*/
function getCoverURL(array $options = []): string function getCoverURL(array $options = []): string
{ {
$defaults = [ $defaults = [
@@ -845,7 +858,7 @@ if (! function_exists('imdb_trailers')) {
/** /**
* Fetches an embeddable video to a IMDB trailer from http://www.traileraddict.com. * Fetches an embeddable video to a IMDB trailer from http://www.traileraddict.com.
*/ */
function imdb_trailers($imdbID): string function imdb_trailers(mixed $imdbID): string
{ {
$xml = getRawHtml('https://api.traileraddict.com/?imdb='.$imdbID); $xml = getRawHtml('https://api.traileraddict.com/?imdb='.$imdbID);
if ($xml !== false && preg_match('#(v\.traileraddict\.com/\d+)#i', $xml, $html)) { if ($xml !== false && preg_match('#(v\.traileraddict\.com/\d+)#i', $xml, $html)) {
@@ -857,7 +870,7 @@ if (! function_exists('imdb_trailers')) {
} }
if (! function_exists('showApiError')) { if (! function_exists('showApiError')) {
function showApiError(int $errorCode = 900, string $errorText = '') function showApiError(int $errorCode = 900, string $errorText = ''): mixed
{ {
$errorHeader = 'HTTP 1.1 400 Bad Request'; $errorHeader = 'HTTP 1.1 400 Bad Request';
if ($errorText === '') { if ($errorText === '') {
@@ -942,7 +955,7 @@ if (! function_exists('showApiError')) {
} }
if (! function_exists('getRange')) { if (! function_exists('getRange')) {
function getRange($tableName): \Illuminate\Contracts\Pagination\LengthAwarePaginator function getRange(mixed $tableName): \Illuminate\Contracts\Pagination\LengthAwarePaginator // @phpstan-ignore missingType.generics
{ {
$range = \Illuminate\Support\Facades\DB::table($tableName); $range = \Illuminate\Support\Facades\DB::table($tableName);
if ($tableName === 'xxxinfo') { if ($tableName === 'xxxinfo') {
+1 -1
View File
@@ -12,7 +12,7 @@ use Illuminate\Support\Facades\Facade;
* *
* @see \App\Services\Categorization\CategorizationPipeline * @see \App\Services\Categorization\CategorizationPipeline
*/ */
class Categorization extends Facade class Categorization extends Facade // @phpstan-ignore missingType.iterableValue, missingType.generics
{ {
protected static function getFacadeAccessor(): string protected static function getFacadeAccessor(): string
{ {
+1 -1
View File
@@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Facade;
* *
* @see \Mailerlite\LaravelElasticsearch\Manager * @see \Mailerlite\LaravelElasticsearch\Manager
*/ */
class Elasticsearch extends Facade class Elasticsearch extends Facade // @phpstan-ignore missingType.iterableValue
{ {
protected static function getFacadeAccessor(): string protected static function getFacadeAccessor(): string
{ {
+1 -1
View File
@@ -38,7 +38,7 @@ use Illuminate\Support\Facades\Facade;
* *
* @see \App\Services\Search\SearchService * @see \App\Services\Search\SearchService
*/ */
class Search extends Facade class Search extends Facade // @phpstan-ignore missingType.iterableValue
{ {
/** /**
* Get the registered name of the component. * Get the registered name of the component.
+1 -1
View File
@@ -14,7 +14,7 @@ use Illuminate\Support\Facades\Facade;
* *
* @see \App\Services\TvProcessing\TvProcessingPipeline * @see \App\Services\TvProcessing\TvProcessingPipeline
*/ */
class TvProcessing extends Facade class TvProcessing extends Facade // @phpstan-ignore missingType.iterableValue, missingType.generics
{ {
/** /**
* Get the registered name of the component. * Get the registered name of the component.
+1 -1
View File
@@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Facade;
* *
* @see \App\Services\YencService * @see \App\Services\YencService
*/ */
class Yenc extends Facade class Yenc extends Facade // @phpstan-ignore missingType.iterableValue
{ {
/** /**
* Get the registered name of the component. * Get the registered name of the component.
@@ -13,7 +13,7 @@ class AdminAjaxController extends BasePageController
/** /**
* @throws \Throwable * @throws \Throwable
*/ */
public function ajaxAction(Request $request) public function ajaxAction(Request $request): mixed
{ {
if ($request->missing('action')) { if ($request->missing('action')) {
return response()->json(['success' => false, 'message' => 'No action specified'], 400); return response()->json(['success' => false, 'message' => 'No action specified'], 400);
@@ -127,5 +127,8 @@ class AdminAjaxController extends BasePageController
} catch (\Exception $e) { } catch (\Exception $e) {
return response()->json(['success' => false, 'message' => $e->getMessage()], 500); return response()->json(['success' => false, 'message' => $e->getMessage()], 500);
} }
return null;
} }
} }
@@ -13,7 +13,7 @@ class AdminBlacklistController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index() public function index(): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
$svc = new BlacklistService; $svc = new BlacklistService;
@@ -12,7 +12,7 @@ class AdminCategoryController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index() public function index(): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
$meta_title = $title = 'Category List'; $meta_title = $title = 'Category List';
@@ -12,7 +12,7 @@ class AdminCategoryRegexesController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
$regexes = new RegexService('category_regexes'); $regexes = new RegexService('category_regexes');
@@ -12,7 +12,7 @@ class AdminCollectionRegexesController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
$regexes = new RegexService('collection_regexes'); $regexes = new RegexService('collection_regexes');
@@ -101,7 +101,7 @@ class AdminCollectionRegexesController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function testRegex(Request $request) public function testRegex(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
$meta_title = $title = 'Collections Regex Test'; $meta_title = $title = 'Collections Regex Test';
@@ -13,7 +13,7 @@ class AdminContentController extends BasePageController
* *
* @throws \Exception * @throws \Exception
*/ */
public function index() public function index(): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -116,7 +116,7 @@ class AdminContentController extends BasePageController
/** /**
* Toggle content status (enable/disable). * Toggle content status (enable/disable).
*/ */
public function toggleStatus(Request $request) public function toggleStatus(Request $request): mixed
{ {
if ($request->has('id')) { if ($request->has('id')) {
$content = Content::query()->find($request->input('id')); $content = Content::query()->find($request->input('id'));
@@ -145,7 +145,7 @@ class AdminContentController extends BasePageController
/** /**
* Delete content by ID. * Delete content by ID.
*/ */
public function destroy(Request $request) public function destroy(Request $request): mixed
{ {
if ($request->has('id')) { if ($request->has('id')) {
$content = Content::query()->find($request->input('id')); $content = Content::query()->find($request->input('id'));
@@ -180,6 +180,8 @@ class AdminContentController extends BasePageController
/** /**
* Add new content. * Add new content.
*
* @param array<string, mixed> $data
*/ */
protected function addContent(array $data): int protected function addContent(array $data): int
{ {
@@ -208,6 +210,8 @@ class AdminContentController extends BasePageController
/** /**
* Update existing content. * Update existing content.
*
* @param array<string, mixed> $data
*/ */
protected function updateContent(array $data): int protected function updateContent(array $data): int
{ {
@@ -240,6 +244,9 @@ class AdminContentController extends BasePageController
/** /**
* Normalize content URL to ensure proper formatting. * Normalize content URL to ensure proper formatting.
*
* @param array<string, mixed> $data
* @return array<string, mixed>
*/ */
protected function normalizeContentUrl(array $data): array protected function normalizeContentUrl(array $data): array
{ {
@@ -10,7 +10,7 @@ class AdminFailedReleasesController extends BasePageController
/** /**
* Display a listing of failed releases * Display a listing of failed releases
*/ */
public function index() public function index(): mixed
{ {
$meta_title = $title = 'Failed Releases List'; $meta_title = $title = 'Failed Releases List';
$releaselist = Release::getFailedRange(); $releaselist = Release::getFailedRange();
@@ -13,7 +13,7 @@ class AdminGameController extends BasePageController
/** /**
* Display a listing of games * Display a listing of games
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$game = new GamesService; $game = new GamesService;
@@ -36,7 +36,7 @@ class AdminGameController extends BasePageController
/** /**
* Show the form for editing a game * Show the form for editing a game
*/ */
public function edit(Request $request) public function edit(Request $request): mixed
{ {
$games = new GamesService; $games = new GamesService;
$gen = new GenreService; $gen = new GenreService;
@@ -11,7 +11,7 @@ class AdminGroupController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$groupname = $request->input('groupname') ?? ''; $groupname = $request->input('groupname') ?? '';
$grouplist = UsenetGroup::getGroupsRange($groupname); $grouplist = UsenetGroup::getGroupsRange($groupname);
@@ -23,7 +23,7 @@ class AdminGroupController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function createBulk(Request $request) public function createBulk(Request $request): mixed
{ {
// set the current action // set the current action
$action = $request->input('action') ?? 'view'; $action = $request->input('action') ?? 'view';
@@ -97,7 +97,7 @@ class AdminGroupController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function active(Request $request) public function active(Request $request): mixed
{ {
$gname = ''; $gname = '';
if (! empty($request->input('groupname'))) { if (! empty($request->input('groupname'))) {
@@ -114,7 +114,7 @@ class AdminGroupController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function inactive(Request $request) public function inactive(Request $request): mixed
{ {
$gname = ''; $gname = '';
if (! empty($request->input('groupname'))) { if (! empty($request->input('groupname'))) {
@@ -125,6 +125,8 @@ class AdminInvitationController extends BasePageController
/** /**
* Get overall invitation statistics with caching * Get overall invitation statistics with caching
*
* @return array<string, mixed>
*/ */
private function getOverallStats(): array private function getOverallStats(): array
{ {
@@ -149,6 +151,8 @@ class AdminInvitationController extends BasePageController
/** /**
* Get top inviters statistics with caching * Get top inviters statistics with caching
*
* @return array<string, mixed>
*/ */
private function getTopInviters(int $limit = 10): array private function getTopInviters(int $limit = 10): array
{ {
@@ -21,7 +21,7 @@ class AdminMovieController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$lastSearch = $request->input('moviesearch', ''); $lastSearch = $request->input('moviesearch', '');
@@ -13,7 +13,7 @@ class AdminMusicController extends BasePageController
/** /**
* Display a listing of music * Display a listing of music
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$meta_title = $title = 'Music List'; $meta_title = $title = 'Music List';
@@ -34,7 +34,7 @@ class AdminMusicController extends BasePageController
/** /**
* Show the form for editing music * Show the form for editing music
*/ */
public function edit(Request $request) public function edit(Request $request): mixed
{ {
$music = new MusicService; $music = new MusicService;
$gen = new GenreService; $gen = new GenreService;
@@ -23,7 +23,7 @@ class AdminPageController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index() public function index(): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -52,6 +52,8 @@ class AdminPageController extends BasePageController
/** /**
* Get recent user activity from the user_activities table with caching * Get recent user activity from the user_activities table with caching
*
* @return array<string, mixed>
*/ */
protected function getRecentUserActivity(): array protected function getRecentUserActivity(): array
{ {
@@ -78,7 +80,7 @@ class AdminPageController extends BasePageController
/** /**
* API endpoint to get recent user activity (for auto-refresh) * API endpoint to get recent user activity (for auto-refresh)
*/ */
public function getRecentActivity() public function getRecentActivity(): mixed
{ {
$activities = $this->getRecentUserActivity(); $activities = $this->getRecentUserActivity();
@@ -101,6 +103,8 @@ class AdminPageController extends BasePageController
/** /**
* Get default dashboard statistics with caching for expensive queries * Get default dashboard statistics with caching for expensive queries
*
* @return array<string, mixed>
*/ */
protected function getDefaultStats(): array protected function getDefaultStats(): array
{ {
@@ -179,6 +183,8 @@ class AdminPageController extends BasePageController
/** /**
* Get system metrics (CPU and RAM usage) with caching * Get system metrics (CPU and RAM usage) with caching
*
* @return array<string, mixed>
*/ */
protected function getSystemMetrics(): array protected function getSystemMetrics(): array
{ {
@@ -297,6 +303,8 @@ class AdminPageController extends BasePageController
/** /**
* Get detailed CPU information (cores, threads, model) * Get detailed CPU information (cores, threads, model)
*
* @return array<string, mixed>
*/ */
protected function getCpuInfo(): array protected function getCpuInfo(): array
{ {
@@ -366,6 +374,8 @@ class AdminPageController extends BasePageController
/** /**
* Get system load average * Get system load average
*
* @return array<string, mixed>
*/ */
protected function getLoadAverage(): array protected function getLoadAverage(): array
{ {
@@ -405,6 +415,8 @@ class AdminPageController extends BasePageController
/** /**
* Get RAM usage information * Get RAM usage information
*
* @return array<string, mixed>
*/ */
protected function getRamUsage(): array protected function getRamUsage(): array
{ {
@@ -460,7 +472,7 @@ class AdminPageController extends BasePageController
/** /**
* Get minute-to-minute user activity data (API endpoint) * Get minute-to-minute user activity data (API endpoint)
*/ */
public function getUserActivityMinutes() public function getUserActivityMinutes(): mixed
{ {
$downloadsPerMinute = $this->userStatsService->getDownloadsPerMinute(60); $downloadsPerMinute = $this->userStatsService->getDownloadsPerMinute(60);
$apiHitsPerMinute = $this->userStatsService->getApiHitsPerMinute(60); $apiHitsPerMinute = $this->userStatsService->getApiHitsPerMinute(60);
@@ -474,7 +486,7 @@ class AdminPageController extends BasePageController
/** /**
* Get current system metrics (API endpoint) * Get current system metrics (API endpoint)
*/ */
public function getCurrentMetrics() public function getCurrentMetrics(): mixed
{ {
$cpuUsage = $this->getCpuUsage(); $cpuUsage = $this->getCpuUsage();
$ramUsage = $this->getRamUsage(); $ramUsage = $this->getRamUsage();
@@ -501,7 +513,7 @@ class AdminPageController extends BasePageController
/** /**
* Get historical system metrics (API endpoint) * Get historical system metrics (API endpoint)
*/ */
public function getHistoricalMetrics() public function getHistoricalMetrics(): mixed
{ {
$timeRange = request('range', '24h'); // 24h or 30d $timeRange = request('range', '24h'); // 24h or 30d
@@ -12,7 +12,7 @@ class AdminReleaseNamingRegexesController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
$regexes = new RegexService('release_naming_regexes'); $regexes = new RegexService('release_naming_regexes');
@@ -108,7 +108,7 @@ class AdminReleaseNamingRegexesController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function testRegex(Request $request) public function testRegex(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
$meta_title = $title = 'Release Naming Regex Test'; $meta_title = $title = 'Release Naming Regex Test';
@@ -21,7 +21,7 @@ class AdminReleasesController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -91,7 +91,7 @@ class AdminReleasesController extends BasePageController
]); ]);
} }
public function destroy($id) public function destroy(mixed $id): mixed
{ {
try { try {
if ($id) { if ($id) {
@@ -11,7 +11,7 @@ class AdminRoleController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index() public function index(): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -32,7 +32,7 @@ class AdminRoleController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function create(Request $request) public function create(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -114,7 +114,7 @@ class AdminRoleController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function edit(Request $request) public function edit(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -139,7 +139,7 @@ class AdminSiteController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function stats() public function stats(): mixed
{ {
$meta_title = $title = 'Site Stats'; $meta_title = $title = 'Site Stats';
@@ -11,7 +11,7 @@ class AdminTmuxController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function edit(Request $request) public function edit(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -18,7 +18,7 @@ class AdminUserController extends BasePageController
/** /**
* @throws \Throwable * @throws \Throwable
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -13,7 +13,7 @@ class AdminUserRoleHistoryController extends BasePageController
/** /**
* Display user role history list * Display user role history list
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -83,7 +83,7 @@ class AdminUserRoleHistoryController extends BasePageController
/** /**
* Display role history for a specific user * Display role history for a specific user
*/ */
public function show(Request $request, int $userId) public function show(Request $request, int $userId): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -12,7 +12,7 @@ class DeletedUsersController extends BasePageController
/** /**
* Display a listing of soft-deleted users with filtering, sorting and pagination. * Display a listing of soft-deleted users with filtering, sorting and pagination.
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$this->setAdminPrefs(); $this->setAdminPrefs();
@@ -71,7 +71,7 @@ class DeletedUsersController extends BasePageController
}); });
// Sorting // Sorting
[$orderField, $orderSort] = $this->getSortOrder($orderBy); [$orderField, $orderSort] = $this->getSortOrder($orderBy); // @phpstan-ignore offsetAccess.notFound
$deletedUsers = $deletedUsers->orderBy($orderField, $orderSort) $deletedUsers = $deletedUsers->orderBy($orderField, $orderSort)
->paginate(25) ->paginate(25)
->appends($request->except('page')); ->appends($request->except('page'));
@@ -103,7 +103,7 @@ class DeletedUsersController extends BasePageController
/** /**
* Bulk restore or permanent delete. * Bulk restore or permanent delete.
*/ */
public function bulkAction(Request $request) public function bulkAction(Request $request): mixed
{ {
$action = $request->input('action'); $action = $request->input('action');
$userIds = $request->input('user_ids', []); $userIds = $request->input('user_ids', []);
@@ -136,7 +136,7 @@ class DeletedUsersController extends BasePageController
/** /**
* Restore single user. * Restore single user.
*/ */
public function restore($id) public function restore(mixed $id): mixed
{ {
$user = User::onlyTrashed()->find($id); $user = User::onlyTrashed()->find($id);
if ($user) { if ($user) {
@@ -151,7 +151,7 @@ class DeletedUsersController extends BasePageController
/** /**
* Permanently delete single user. * Permanently delete single user.
*/ */
public function permanentDelete($id) public function permanentDelete(mixed $id): mixed
{ {
$user = User::onlyTrashed()->find($id); $user = User::onlyTrashed()->find($id);
if ($user) { if ($user) {
@@ -166,6 +166,8 @@ class DeletedUsersController extends BasePageController
/** /**
* Parse and validate sort order. * Parse and validate sort order.
*
* @return array<string, mixed>
*/ */
private function getSortOrder(string $orderBy): array private function getSortOrder(string $orderBy): array
{ {
@@ -198,6 +200,6 @@ class DeletedUsersController extends BasePageController
} }
} }
return [$orderField, $orderSort]; return [$orderField, $orderSort]; // @phpstan-ignore return.type
} }
} }
+2 -2
View File
@@ -21,7 +21,7 @@ class AdultController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function show(Request $request, string $id = '') public function show(Request $request, string $id = ''): mixed
{ {
$moviecats = Category::getChildren(Category::XXX_ROOT); $moviecats = Category::getChildren(Category::XXX_ROOT);
$mtmp = []; $mtmp = [];
@@ -48,7 +48,7 @@ class AdultController extends BasePageController
$page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1;
$offset = ($page - 1) * config('nntmux.items_per_page'); $offset = ($page - 1) * config('nntmux.items_per_page');
$rslt = $this->xxxBrowseService->getXXXRange($page, $catarray, $offset, config('nntmux.items_per_page'), $orderby, -1, $this->userdata['categoryexclusions']); $rslt = $this->xxxBrowseService->getXXXRange($page, $catarray, $offset, config('nntmux.items_per_page'), $orderby, -1, $this->userdata['categoryexclusions']); // @phpstan-ignore argument.type
$results = $this->paginate($rslt, $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_page'), $page, $request->url(), $request->query()); $results = $this->paginate($rslt, $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_page'), $page, $request->url(), $request->query());
$title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : '';
+10 -2
View File
@@ -219,6 +219,7 @@ class ApiController extends BasePageController
'trakt' => $request->input('traktid') ?? '0', 'trakt' => $request->input('traktid') ?? '0',
'tvrage' => $request->input('rid') ?? '0', 'tvrage' => $request->input('rid') ?? '0',
'tvmaze' => $request->input('tvmazeid') ?? '0', 'tvmaze' => $request->input('tvmazeid') ?? '0',
/** @phpstan-ignore argument.templateType */
'imdb' => Str::replace('tt', '', $request->input('imdbid')) ?? '0', 'imdb' => Str::replace('tt', '', $request->input('imdbid')) ?? '0',
'tmdb' => $request->input('tmdbid') ?? '0', 'tmdb' => $request->input('tmdbid') ?? '0',
]; ];
@@ -393,11 +394,12 @@ class ApiController extends BasePageController
} }
/** /**
* @param array<string, mixed> $params
* @return Response|void * @return Response|void
* *
* @throws \Exception * @throws \Exception
*/ */
public function output($data, array $params, bool $xml, int $offset, string $type = '') public function output(mixed $data, array $params, bool $xml, int $offset, string $type = '')
{ {
$this->type = $type; $this->type = $type;
$options = [ $options = [
@@ -431,6 +433,8 @@ class ApiController extends BasePageController
* Collect and return various capability information for usage in API. * Collect and return various capability information for usage in API.
* *
* *
* @return array<string, mixed>
*
* @throws \Exception * @throws \Exception
*/ */
public function getForMenu(): array public function getForMenu(): array
@@ -487,6 +491,8 @@ class ApiController extends BasePageController
/** /**
* Verify cat parameter. * Verify cat parameter.
*
* @return array<string, mixed>
*/ */
public function categoryID(Request $request): array public function categoryID(Request $request): array
{ {
@@ -507,6 +513,8 @@ class ApiController extends BasePageController
* Verify groupName parameter. * Verify groupName parameter.
* *
* *
* @return list<int|string>
*
* @throws \Exception * @throws \Exception
*/ */
public function group(Request $request): string|int|bool public function group(Request $request): string|int|bool
@@ -560,7 +568,7 @@ class ApiController extends BasePageController
} }
} }
public function addCoverURL(&$releases, callable $getCoverURL): void public function addCoverURL(mixed &$releases, callable $getCoverURL): void
{ {
if ($releases && \count($releases)) { if ($releases && \count($releases)) {
foreach ($releases as $key => $release) { foreach ($releases as $key => $release) {
+6 -6
View File
@@ -6,7 +6,6 @@ use App\Models\Category;
use App\Models\Release; use App\Models\Release;
use App\Services\Releases\ReleaseBrowseService; use App\Services\Releases\ReleaseBrowseService;
use App\Services\Releases\ReleaseSearchService; use App\Services\Releases\ReleaseSearchService;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
@@ -29,7 +28,7 @@ class RSS extends ApiController
/** /**
* @return Release[]|Collection|mixed * @return Release[]|Collection|mixed
*/ */
public function getRss($cat, $videosId, $aniDbID, int $userID = 0, int $airDate = -1, int $limit = 100, int $offset = 0) public function getRss(mixed $cat, mixed $videosId, mixed $aniDbID, int $userID = 0, int $airDate = -1, int $limit = 100, int $offset = 0)
{ {
$catSearch = $cartSearch = ''; $catSearch = $cartSearch = '';
$catLimit = 'AND r.categories_id BETWEEN '.Category::TV_ROOT.' AND '.Category::TV_OTHER; $catLimit = 'AND r.categories_id BETWEEN '.Category::TV_ROOT.' AND '.Category::TV_OTHER;
@@ -93,9 +92,9 @@ class RSS extends ApiController
} }
/** /**
* @return Builder|Collection * @param array<string, mixed> $excludedCats
*/ */
public function getShowsRss(int $limit, int $userID = 0, array $excludedCats = [], int $airDate = -1) public function getShowsRss(int $limit, int $userID = 0, array $excludedCats = [], int $airDate = -1): mixed
{ {
$sql = sprintf( $sql = sprintf(
@@ -122,6 +121,7 @@ class RSS extends ApiController
} }
/** /**
* @param array<string, mixed> $excludedCats
* @return Release[]|Collection|mixed * @return Release[]|Collection|mixed
*/ */
public function getMyMoviesRss(int $limit, int $userID = 0, array $excludedCats = []) public function getMyMoviesRss(int $limit, int $userID = 0, array $excludedCats = [])
@@ -152,7 +152,7 @@ class RSS extends ApiController
/** /**
* Get trending movies RSS (top 15 most downloaded in last 48 hours) * Get trending movies RSS (top 15 most downloaded in last 48 hours)
* *
* @return \Illuminate\Support\Collection * @return \Illuminate\Support\Collection<int, mixed>
*/ */
public function getTrendingMoviesRss() public function getTrendingMoviesRss()
{ {
@@ -216,7 +216,7 @@ class RSS extends ApiController
/** /**
* Get trending TV shows RSS (top 15 most downloaded in last 48 hours) * Get trending TV shows RSS (top 15 most downloaded in last 48 hours)
* *
* @return \Illuminate\Support\Collection * @return \Illuminate\Support\Collection<int, mixed>
*/ */
public function getTrendingShowsRss() public function getTrendingShowsRss()
{ {
+8 -6
View File
@@ -76,6 +76,8 @@ class XML_Response
/** /**
* XMLReturn constructor. * XMLReturn constructor.
*
* @param array<string, mixed> $options
*/ */
public function __construct(array $options = []) public function __construct(array $options = [])
{ {
@@ -203,7 +205,7 @@ class XML_Response
/** /**
* Starts a new element, loops through the attribute data and ends the element. * Starts a new element, loops through the attribute data and ends the element.
* *
* @param array $element An array with the name of the element and the attribute data * @param array<string, mixed> $element An array with the name of the element and the attribute data
*/ */
protected function addNode(array $element): void protected function addNode(array $element): void
{ {
@@ -217,7 +219,7 @@ class XML_Response
/** /**
* Starts a new element, loops through the attribute data and ends the element. * Starts a new element, loops through the attribute data and ends the element.
* *
* @param array $element An array with the name of the element and the attribute data * @param array<string, mixed> $element An array with the name of the element and the attribute data
*/ */
protected function addNodes(array $element): void protected function addNodes(array $element): void
{ {
@@ -593,7 +595,7 @@ class XML_Response
{ {
$movieCol = ['rating', 'plot', 'year', 'genre', 'director', 'actors']; $movieCol = ['rating', 'plot', 'year', 'genre', 'director', 'actors'];
$cData = $this->buildCdata($movieCol); $cData = $this->buildCdata($movieCol); // @phpstan-ignore argument.type
$this->cdata .= $this->cdata .=
"\t<li>Imdb Info: "\t<li>Imdb Info:
@@ -614,7 +616,7 @@ class XML_Response
$musicCol = ['mu_artist', 'mu_genre', 'mu_publisher', 'mu_releasedate', 'mu_review']; $musicCol = ['mu_artist', 'mu_genre', 'mu_publisher', 'mu_releasedate', 'mu_review'];
$cData = $this->buildCdata($musicCol); $cData = $this->buildCdata($musicCol); // @phpstan-ignore argument.type
if ($this->release->mu_url !== '') { if ($this->release->mu_url !== '') {
$cDataUrl = "<li>Amazon: <a href=\"{$this->release->mu_url}\">{$this->release->mu_title}</a></li>"; $cDataUrl = "<li>Amazon: <a href=\"{$this->release->mu_url}\">{$this->release->mu_title}</a></li>";
@@ -651,7 +653,7 @@ class XML_Response
{ {
$gamesCol = ['co_genre', 'co_publisher', 'year', 'co_review']; $gamesCol = ['co_genre', 'co_publisher', 'year', 'co_review'];
$cData = $this->buildCdata($gamesCol); $cData = $this->buildCdata($gamesCol); // @phpstan-ignore argument.type
$this->cdata .= " $this->cdata .= "
<li>Console Info: <li>Console Info:
@@ -665,7 +667,7 @@ class XML_Response
/** /**
* Accepts an array of values to loop through to build cData from the release info. * Accepts an array of values to loop through to build cData from the release info.
* *
* @param array $columns The columns in the release we need to insert * @param array<string, mixed> $columns The columns in the release we need to insert
* @return string The HTML format cData * @return string The HTML format cData
*/ */
protected function buildCdata(array $columns): string protected function buildCdata(array $columns): string
@@ -35,7 +35,7 @@ class ForgotPasswordController extends Controller
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function showLinkRequestForm(Request $request) public function showLinkRequestForm(Request $request): mixed
{ {
// If it's a GET request, just show the form // If it's a GET request, just show the form
if ($request->isMethod('get')) { if ($request->isMethod('get')) {
@@ -186,7 +186,7 @@ class LoginController extends Controller
return redirect()->to('login'); return redirect()->to('login');
} }
public function showLoginForm() public function showLoginForm(): mixed
{ {
return view('auth.login'); return view('auth.login');
} }
@@ -52,6 +52,9 @@ class RegisterController extends Controller
$this->middleware('guest', ['except' => ['getVerification', 'getVerificationError']]); $this->middleware('guest', ['except' => ['getVerification', 'getVerificationError']]);
} }
/**
* @param array<string, mixed> $data
*/
protected function create(array $data): User protected function create(array $data): User
{ {
$user = User::create([ $user = User::create([
@@ -243,7 +246,7 @@ class RegisterController extends Controller
return $this->showRegistrationForm($request, $error, $showRegister); return $this->showRegistrationForm($request, $error, $showRegister);
} }
public function showRegistrationForm(Request $request, string $error = '', int $showRegister = 0) public function showRegistrationForm(Request $request, string $error = '', int $showRegister = 0): mixed
{ {
$inviteCode = ''; $inviteCode = '';
if ($request->has('invitecode')) { if ($request->has('invitecode')) {
@@ -41,7 +41,7 @@ class ResetPasswordController extends Controller
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function reset(Request $request) public function reset(Request $request): mixed
{ {
if ($request->missing('guid')) { if ($request->missing('guid')) {
return redirect()->route('password.request')->withErrors(['error' => 'No reset code provided.']); return redirect()->route('password.request')->withErrors(['error' => 'No reset code provided.']);
@@ -69,7 +69,7 @@ class ResetPasswordController extends Controller
->with('message_type', 'success'); ->with('message_type', 'success');
} }
public function showResetForm(Request $request, $token = null) public function showResetForm(Request $request, mixed $token = null): mixed
{ {
return view('auth.passwords.reset')->with([ return view('auth.passwords.reset')->with([
'token' => $token, 'token' => $token,
+10 -2
View File
@@ -13,7 +13,10 @@ use Illuminate\View\View;
class BasePageController extends Controller class BasePageController extends Controller
{ {
public \Illuminate\Support\Collection $settings; /**
* @var Collection<int, mixed>
*/
public \Illuminate\Support\Collection $settings; // @phpstan-ignore property.phpDocType, class.notFound, missingType.generics
public string $title = ''; public string $title = '';
@@ -39,6 +42,8 @@ class BasePageController extends Controller
/** /**
* View data array for Blade templates * View data array for Blade templates
*
* @var array<string, mixed>
*/ */
protected array $viewData = []; protected array $viewData = [];
@@ -85,7 +90,10 @@ class BasePageController extends Controller
}); });
} }
public function paginate($query, $totalCount, $items, $page, $path, $reqQuery): LengthAwarePaginator /**
* @return LengthAwarePaginator<int, mixed>
*/
public function paginate(mixed $query, mixed $totalCount, mixed $items, mixed $page, mixed $path, mixed $reqQuery): LengthAwarePaginator
{ {
return new LengthAwarePaginator($query, $totalCount, $items, $page, ['path' => $path, 'query' => $reqQuery]); return new LengthAwarePaginator($query, $totalCount, $items, $page, ['path' => $path, 'query' => $reqQuery]);
} }
+2 -2
View File
@@ -12,7 +12,7 @@ class BooksController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index(Request $request, string $id = '') public function index(Request $request, string $id = ''): mixed
{ {
$bookService = new BookService; $bookService = new BookService;
@@ -44,7 +44,7 @@ class BooksController extends BasePageController
$books = []; $books = [];
$page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1;
$offset = ($page - 1) * config('nntmux.items_per_cover_page'); $offset = ($page - 1) * config('nntmux.items_per_cover_page');
$rslt = $bookService->getBookRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, (array) $this->userdata->categoryexclusions); $rslt = $bookService->getBookRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, (array) $this->userdata->categoryexclusions); // @phpstan-ignore argument.type
$results = $this->paginate($rslt, $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); $results = $this->paginate($rslt, $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query());
$maxwords = 50; $maxwords = 50;
foreach ($results as $result) { foreach ($results as $result) {
+3 -3
View File
@@ -20,7 +20,7 @@ class BrowseController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index(Request $request) public function index(Request $request): mixed
{ {
$ordering = $this->releaseBrowseService->getBrowseOrdering(); $ordering = $this->releaseBrowseService->getBrowseOrdering();
$orderBy = $request->has('ob') && ! empty($request->input('ob')) ? $request->input('ob') : ''; $orderBy = $request->has('ob') && ! empty($request->input('ob')) ? $request->input('ob') : '';
@@ -52,7 +52,7 @@ class BrowseController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function show(Request $request, string $parentCategory, string $id = 'All') public function show(Request $request, string $parentCategory, string $id = 'All'): mixed
{ {
$parentId = RootCategory::query()->where('title', $parentCategory)->value('id'); $parentId = RootCategory::query()->where('title', $parentCategory)->value('id');
@@ -158,7 +158,7 @@ class BrowseController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function group(Request $request) public function group(Request $request): mixed
{ {
if ($request->has('g')) { if ($request->has('g')) {
$group = $request->input('g'); $group = $request->input('g');
@@ -10,7 +10,7 @@ class BrowseGroupController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function show(Request $request) public function show(Request $request): mixed
{ {
// Get the search term from the request // Get the search term from the request
$search = $request->get('search', '') ?? ''; $search = $request->get('search', '') ?? '';
+3 -2
View File
@@ -13,10 +13,9 @@ class CartController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index() public function index(): mixed
{ {
$results = UsersRelease::getCart(Auth::id()) $results = UsersRelease::getCart(Auth::id())
/** @phpstan-ignore property.notFound */
->filter(fn ($item) => $item->release !== null); ->filter(fn ($item) => $item->release !== null);
$this->viewData = array_merge($this->viewData, [ $this->viewData = array_merge($this->viewData, [
@@ -65,6 +64,8 @@ class CartController extends BasePageController
} }
/** /**
* @param array<string, mixed> $id
*
* @throws \Exception * @throws \Exception
*/ */
public function destroy(array|string $id): RedirectResponse public function destroy(array|string $id): RedirectResponse
+2 -2
View File
@@ -21,7 +21,7 @@ class ConsoleController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function show(Request $request, string $id = '') public function show(Request $request, string $id = ''): mixed
{ {
if ($id === 'WiiVare') { if ($id === 'WiiVare') {
$id = 'WiiVareVC'; $id = 'WiiVareVC';
@@ -55,7 +55,7 @@ class ConsoleController extends BasePageController
$offset = ($page - 1) * config('nntmux.items_per_cover_page'); $offset = ($page - 1) * config('nntmux.items_per_cover_page');
$consoles = []; $consoles = [];
$rslt = $this->consoleService->getConsoleRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, (array) $this->userdata->categoryexclusions); $rslt = $this->consoleService->getConsoleRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, (array) $this->userdata->categoryexclusions); // @phpstan-ignore argument.type
$results = $this->paginate($rslt, $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); $results = $this->paginate($rslt, $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query());
$maxwords = 50; $maxwords = 50;
+1 -1
View File
@@ -10,7 +10,7 @@ class ContactUsController extends BasePageController
/** /**
* @throws \Illuminate\Validation\ValidationException * @throws \Illuminate\Validation\ValidationException
*/ */
public function contact(ContactContactURequest $request) public function contact(ContactContactURequest $request): mixed
{ {
$msg = ''; $msg = '';
+9 -3
View File
@@ -79,8 +79,10 @@ class ContentController extends BasePageController
/** /**
* Get all active content ordered by type and ordinal. * Get all active content ordered by type and ordinal.
*
* @return Collection<int, mixed>
*/ */
protected function getActiveContent(): \Illuminate\Database\Eloquent\Collection protected function getActiveContent(): \Illuminate\Database\Eloquent\Collection // @phpstan-ignore class.notFound, missingType.generics, return.phpDocType
{ {
return Content::active() return Content::active()
->orderByRaw('contenttype, COALESCE(ordinal, 1000000)') ->orderByRaw('contenttype, COALESCE(ordinal, 1000000)')
@@ -89,8 +91,10 @@ class ContentController extends BasePageController
/** /**
* Get all content except the front page. * Get all content except the front page.
*
* @return Collection<int, mixed>
*/ */
protected function getAllButFront(): \Illuminate\Database\Eloquent\Collection protected function getAllButFront(): \Illuminate\Database\Eloquent\Collection // @phpstan-ignore class.notFound, missingType.generics, return.phpDocType
{ {
return Content::query() return Content::query()
->where('id', '<>', 1) ->where('id', '<>', 1)
@@ -111,8 +115,10 @@ class ContentController extends BasePageController
/** /**
* Get front page content. * Get front page content.
*
* @return Collection<int, mixed>
*/ */
protected function getFrontPageContent(): \Illuminate\Database\Eloquent\Collection protected function getFrontPageContent(): \Illuminate\Database\Eloquent\Collection // @phpstan-ignore class.notFound, missingType.generics, return.phpDocType
{ {
return Content::frontPage()->get(); return Content::frontPage()->get();
} }
+1 -1
View File
@@ -48,7 +48,7 @@ class DetailsController extends BasePageController
$this->releaseExtraService = $releaseExtraService; $this->releaseExtraService = $releaseExtraService;
} }
public function show(Request $request, string $guid) public function show(Request $request, string $guid): mixed
{ {
$data = Release::getByGuid($guid); $data = Release::getByGuid($guid);
$releaseRegex = ''; $releaseRegex = '';
+1 -1
View File
@@ -12,7 +12,7 @@ class GamesController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function show(Request $request) public function show(Request $request): mixed
{ {
$games = new GamesService; $games = new GamesService;
$gen = new GenreService; $gen = new GenreService;
+4 -2
View File
@@ -206,13 +206,13 @@ class GetNzbController extends BasePageController
return showApiError(501); return showApiError(501);
} }
$zip = getStreamingZip($guids); $zip = getStreamingZip($guids); // @phpstan-ignore argument.type
if ($zip === '') { // @phpstan-ignore identical.alwaysFalse if ($zip === '') { // @phpstan-ignore identical.alwaysFalse
return response()->json(['message' => 'Unable to create .zip file'], 404); return response()->json(['message' => 'Unable to create .zip file'], 404);
} }
// Update statistics // Update statistics
$this->updateZipDownloadStatistics($request, $uid, $guids); $this->updateZipDownloadStatistics($request, $uid, $guids); // @phpstan-ignore argument.type
Log::channel('zipped')->info("User {$userName} downloaded zipped files from site with IP: {$request->ip()}"); Log::channel('zipped')->info("User {$userName} downloaded zipped files from site with IP: {$request->ip()}");
@@ -221,6 +221,8 @@ class GetNzbController extends BasePageController
/** /**
* Update statistics for zip downloads * Update statistics for zip downloads
*
* @param array<string, mixed> $guids
*/ */
private function updateZipDownloadStatistics(Request $request, int $uid, array $guids): void private function updateZipDownloadStatistics(Request $request, int $uid, array $guids): void
{ {
+5 -4
View File
@@ -23,7 +23,7 @@ class MovieController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function showMovies(Request $request, string $id = '') public function showMovies(Request $request, string $id = ''): mixed
{ {
$moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function ($mcat) { $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function ($mcat) {
return ['id' => $mcat->id, 'title' => $mcat->title]; return ['id' => $mcat->id, 'title' => $mcat->title];
@@ -102,7 +102,7 @@ class MovieController extends BasePageController
* *
* @throws \Exception * @throws \Exception
*/ */
public function showMovie(Request $request, string $imdbid) public function showMovie(Request $request, string $imdbid): mixed
{ {
// Get movie info // Get movie info
$movieInfo = $this->movieService->getMovieInfo($imdbid); $movieInfo = $this->movieService->getMovieInfo($imdbid);
@@ -115,6 +115,7 @@ class MovieController extends BasePageController
$rslt = $this->movieBrowseService->getMovieRange(1, [], 0, 1000, '', -1, (array) $this->userdata->categoryexclusions); $rslt = $this->movieBrowseService->getMovieRange(1, [], 0, 1000, '', -1, (array) $this->userdata->categoryexclusions);
// Filter to only this movie's IMDB ID // Filter to only this movie's IMDB ID
/** @phpstan-ignore argument.templateType */
$movieData = collect($rslt)->firstWhere('imdbid', $imdbid); $movieData = collect($rslt)->firstWhere('imdbid', $imdbid);
if (! $movieData) { if (! $movieData) {
@@ -219,7 +220,7 @@ class MovieController extends BasePageController
* *
* @throws \Exception * @throws \Exception
*/ */
public function showTrending(Request $request) public function showTrending(Request $request): mixed
{ {
// Cache key for trending movies (48 hours) // Cache key for trending movies (48 hours)
@@ -284,7 +285,7 @@ class MovieController extends BasePageController
/** /**
* Update user's movie layout preference * Update user's movie layout preference
*/ */
public function updateLayout(Request $request) public function updateLayout(Request $request): mixed
{ {
$request->validate([ $request->validate([
'layout' => 'required|integer|in:1,2', 'layout' => 'required|integer|in:1,2',
+2 -2
View File
@@ -13,7 +13,7 @@ class MusicController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function show(Request $request, string $id = '') public function show(Request $request, string $id = ''): mixed
{ {
$music = new MusicService; $music = new MusicService;
$gen = new GenreService; $gen = new GenreService;
@@ -46,7 +46,7 @@ class MusicController extends BasePageController
$orderby = $request->has('ob') && \in_array($request->input('ob'), $ordering, false) ? $request->input('ob') : ''; $orderby = $request->has('ob') && \in_array($request->input('ob'), $ordering, false) ? $request->input('ob') : '';
$musics = []; $musics = [];
$rslt = $music->getMusicRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, (array) $this->userdata->categoryexclusions); $rslt = $music->getMusicRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, (array) $this->userdata->categoryexclusions); // @phpstan-ignore argument.type
$results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query());
$artist = ($request->has('artist') && ! empty($request->input('artist'))) ? stripslashes($request->input('artist')) : ''; $artist = ($request->has('artist') && ! empty($request->input('artist'))) ? stripslashes($request->input('artist')) : '';
+1 -1
View File
@@ -24,7 +24,7 @@ class MyMoviesController extends BasePageController
$this->movieBrowseService = $movieBrowseService; $this->movieBrowseService = $movieBrowseService;
} }
public function show(Request $request) public function show(Request $request): mixed
{ {
$action = $request->input('id') ?? ''; $action = $request->input('id') ?? '';
$imdbid = $request->input('imdb') ?? ''; $imdbid = $request->input('imdb') ?? '';
+2 -2
View File
@@ -19,7 +19,7 @@ class MyShowsController extends BasePageController
$this->releaseBrowseService = $releaseBrowseService; $this->releaseBrowseService = $releaseBrowseService;
} }
public function show(Request $request) public function show(Request $request): mixed
{ {
$action = $request->input('action') ?? ''; $action = $request->input('action') ?? '';
$videoId = $request->input('id') ?? ''; $videoId = $request->input('id') ?? '';
@@ -167,7 +167,7 @@ class MyShowsController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function browse(Request $request) public function browse(Request $request): mixed
{ {
$title = 'Browse My Shows'; $title = 'Browse My Shows';
$meta_title = 'My Shows'; $meta_title = 'My Shows';
+1 -1
View File
@@ -11,7 +11,7 @@ class NfoController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function showNfo(Request $request, string $id = '') public function showNfo(Request $request, string $id = ''): mixed
{ {
if ($id) { if ($id) {
$rel = Release::getByGuid($id); $rel = Release::getByGuid($id);
@@ -273,7 +273,7 @@ class PasswordSecurityController extends Controller
* Display the 2FA verification form for a user who has already authenticated with username/password * Display the 2FA verification form for a user who has already authenticated with username/password
* but needs to enter their 2FA code. * but needs to enter their 2FA code.
*/ */
public function getVerify2fa(Request $request) public function getVerify2fa(Request $request): mixed
{ {
// Check if user ID is stored in the session // Check if user ID is stored in the session
if (! $request->session()->has('2fa:user:id')) { if (! $request->session()->has('2fa:user:id')) {
+2 -2
View File
@@ -25,7 +25,7 @@ class ProfileController extends BasePageController
/** /**
* @throws \Throwable * @throws \Throwable
*/ */
public function show(Request $request) public function show(Request $request): mixed
{ {
$userID = $this->userdata->id; $userID = $this->userdata->id;
@@ -346,7 +346,7 @@ class ProfileController extends BasePageController
/** /**
* Update user's dark mode preference * Update user's dark mode preference
*/ */
public function updateTheme(Request $request) public function updateTheme(Request $request): mixed
{ {
$user = Auth::user(); $user = Auth::user();
+22 -5
View File
@@ -91,7 +91,7 @@ class RssController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function showRssDesc() public function showRssDesc(): mixed
{ {
$rss = app(RSS::class); $rss = app(RSS::class);
@@ -120,7 +120,7 @@ class RssController extends BasePageController
/** /**
* @throws \Throwable * @throws \Throwable
*/ */
public function cartRss(Request $request) public function cartRss(Request $request): mixed
{ {
$rss = app(RSS::class); $rss = app(RSS::class);
$offset = 0; $offset = 0;
@@ -141,12 +141,14 @@ class RssController extends BasePageController
$relData = $rss->getRss([-2], $userShow, $userAnidb, $user['user_id'], $userAirDate, $userLimit, $userNum); $relData = $rss->getRss([-2], $userShow, $userAnidb, $user['user_id'], $userAirDate, $userLimit, $userNum);
$rss->output($relData, $user['params'], $outputXML, $offset, 'rss'); $rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
return null;
} }
/** /**
* @throws \Throwable * @throws \Throwable
*/ */
public function categoryFeedRss(Request $request) public function categoryFeedRss(Request $request): mixed
{ {
$rss = app(RSS::class); $rss = app(RSS::class);
$offset = 0; $offset = 0;
@@ -171,12 +173,19 @@ class RssController extends BasePageController
$outputXML = (! ($request->has('o') && $request->input('o') === 'json')); $outputXML = (! ($request->has('o') && $request->input('o') === 'json'));
$relData = $rss->getRss($categoryId, $userShow, $userAnidb, $user['user_id'], $userAirDate, $userLimit, $userNum); $relData = $rss->getRss($categoryId, $userShow, $userAnidb, $user['user_id'], $userAirDate, $userLimit, $userNum);
$rss->output($relData, $user['params'], $outputXML, $offset, 'rss'); $rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
return null;
return null;
return null;
} }
/** /**
* @throws \Throwable * @throws \Throwable
*/ */
public function trendingMoviesRss(Request $request) public function trendingMoviesRss(Request $request): mixed
{ {
$rss = app(RSS::class); $rss = app(RSS::class);
$offset = 0; $offset = 0;
@@ -189,12 +198,15 @@ class RssController extends BasePageController
$relData = $rss->getTrendingMoviesRss(); $relData = $rss->getTrendingMoviesRss();
$rss->output($relData, $user['params'], $outputXML, $offset, 'rss'); $rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
return null;
} }
/** /**
* @throws \Throwable * @throws \Throwable
*/ */
public function trendingShowsRss(Request $request) public function trendingShowsRss(Request $request): mixed
{ {
$rss = app(RSS::class); $rss = app(RSS::class);
$offset = 0; $offset = 0;
@@ -207,9 +219,14 @@ class RssController extends BasePageController
$relData = $rss->getTrendingShowsRss(); $relData = $rss->getTrendingShowsRss();
$rss->output($relData, $user['params'], $outputXML, $offset, 'rss'); $rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
return null;
} }
/** /**
* @return array<string, mixed>
*
* @throws \Throwable * @throws \Throwable
*/ */
private function userCheck(Request $request): JsonResponse|array private function userCheck(Request $request): JsonResponse|array
+3 -3
View File
@@ -31,7 +31,7 @@ class SearchController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function search(Request $request) public function search(Request $request): mixed
{ {
$results = []; $results = [];
@@ -94,7 +94,7 @@ class SearchController extends BasePageController
-1, -1,
$this->userdata->categoryexclusions ?? [], $this->userdata->categoryexclusions ?? [],
'basic', 'basic',
$categoryID); $categoryID); // @phpstan-ignore argument.type
$results = $this->paginate($rslt ?? [], $rslt[0]->_totalrows ?? 0, config('nntmux.items_per_page'), $page, $request->url(), $request->query()); $results = $this->paginate($rslt ?? [], $rslt[0]->_totalrows ?? 0, config('nntmux.items_per_page'), $page, $request->url(), $request->query());
$category = $categoryID; $category = $categoryID;
@@ -199,7 +199,7 @@ class SearchController extends BasePageController
-1, -1,
$this->userdata->categoryexclusions ?? [], $this->userdata->categoryexclusions ?? [],
'advanced', 'advanced',
[$searchVars['searchadvcat'] === '' ? -1 : $searchVars['searchadvcat']] [$searchVars['searchadvcat'] === '' ? -1 : $searchVars['searchadvcat']] // @phpstan-ignore argument.type
); );
$results = $this->paginate($rslt ?? [], $rslt[0]->_totalrows ?? 0, config('nntmux.items_per_page'), $page, $request->url(), $request->query()); $results = $this->paginate($rslt ?? [], $rslt[0]->_totalrows ?? 0, config('nntmux.items_per_page'), $page, $request->url(), $request->query());
+4 -3
View File
@@ -23,7 +23,7 @@ class SeriesController extends BasePageController
/** /**
* @throws \Exception * @throws \Exception
*/ */
public function index(Request $request, string $id = '') public function index(Request $request, string $id = ''): mixed
{ {
if ($id && ctype_digit($id)) { if ($id && ctype_digit($id)) {
@@ -40,7 +40,7 @@ class SeriesController extends BasePageController
$page = max($page, 1); $page = max($page, 1);
$offset = $seriesLimit > 0 ? ($page - 1) * $seriesLimit : 0; $offset = $seriesLimit > 0 ? ($page - 1) * $seriesLimit : 0;
$rel = $this->releaseSearchService->tvSearch(['id' => $id], '', '', '', $offset, $seriesLimit, '', $catarray, -1); $rel = $this->releaseSearchService->tvSearch(['id' => $id], '', '', '', $offset, $seriesLimit, '', $catarray, -1); // @phpstan-ignore argument.type
$show = Video::getByVideoID($id); $show = Video::getByVideoID($id);
@@ -60,6 +60,7 @@ class SeriesController extends BasePageController
// Hydrate missing season/episode numbers if tv_episodes_id is set but series/episode missing or zero. // Hydrate missing season/episode numbers if tv_episodes_id is set but series/episode missing or zero.
$episodeMeta = collect(); $episodeMeta = collect();
/** @phpstan-ignore argument.templateType */
$episodeIds = collect($rel)->pluck('tv_episodes_id')->filter(fn ($v) => $v > 0)->unique()->values(); $episodeIds = collect($rel)->pluck('tv_episodes_id')->filter(fn ($v) => $v > 0)->unique()->values();
if ($episodeIds->isNotEmpty()) { if ($episodeIds->isNotEmpty()) {
$episodeMeta = TvEpisode::whereIn('id', $episodeIds)->get()->keyBy('id'); $episodeMeta = TvEpisode::whereIn('id', $episodeIds)->get()->keyBy('id');
@@ -303,7 +304,7 @@ class SeriesController extends BasePageController
* *
* @throws \Exception * @throws \Exception
*/ */
public function showTrending(Request $request) public function showTrending(Request $request): mixed
{ {
// Cache key for trending TV shows (48 hours) // Cache key for trending TV shows (48 hours)
$cacheKey = 'trending_tv_top_15_48h'; $cacheKey = 'trending_tv_top_15_48h';
+2 -2
View File
@@ -145,7 +145,7 @@ class ClearanceMiddleware
* *
* @return string|null The blocked category name, or null if allowed * @return string|null The blocked category name, or null if allowed
*/ */
protected function checkMainCategoryPermission($user, string $parentCategoryName): ?string protected function checkMainCategoryPermission(mixed $user, string $parentCategoryName): ?string
{ {
$categoryPermissions = [ $categoryPermissions = [
'movies' => 'view movies', 'movies' => 'view movies',
@@ -184,7 +184,7 @@ class ClearanceMiddleware
* *
* @return string|null The blocked subcategory name, or null if allowed * @return string|null The blocked subcategory name, or null if allowed
*/ */
protected function checkSubcategoryExclusion($user, string $parentCategoryName, string $subcategoryName): ?string protected function checkSubcategoryExclusion(mixed $user, string $parentCategoryName, string $subcategoryName): ?string
{ {
// Get the root category ID // Get the root category ID
$rootCategory = RootCategory::query() $rootCategory = RootCategory::query()
@@ -9,6 +9,8 @@ class LoginLoginRequest extends FormRequest
{ {
/** /**
* Get the validation rules that apply to the request. * Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/ */
public function rules(): array public function rules(): array
{ {
@@ -9,6 +9,8 @@ class RegisterRegisterRequest extends FormRequest
{ {
/** /**
* Get the validation rules that apply to the request. * Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/ */
public function rules(): array public function rules(): array
{ {
@@ -10,7 +10,7 @@ class ShowLinkRequestFormForgotPasswordRequest extends FormRequest
/** /**
* Get the validation rules that apply to the request. * Get the validation rules that apply to the request.
* *
* @return array * @return array<string, mixed>
*/ */
public function rules() public function rules()
{ {
@@ -9,6 +9,8 @@ class ContactContactURequest extends FormRequest
{ {
/** /**
* Get the validation rules that apply to the request. * Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/ */
public function rules(): array public function rules(): array
{ {
@@ -8,6 +8,8 @@ class Disable2faPasswordSecurityRequest extends FormRequest
{ {
/** /**
* Get the validation rules that apply to the request. * Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/ */
public function rules(): array public function rules(): array
{ {
+3 -5
View File
@@ -14,16 +14,14 @@ class SendAccountWillExpireEmail implements ShouldQueue
{ {
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private $days; private int $days;
private $user; private \App\Models\User $user;
/** /**
* Create a new job instance. * Create a new job instance.
*
* @return void
*/ */
public function __construct($user, $days) public function __construct(\App\Models\User $user, int $days)
{ {
$this->user = $user; $this->user = $user;
$this->days = $days; $this->days = $days;
+4 -4
View File
@@ -14,16 +14,16 @@ class SendContactUsEmail implements ShouldQueue
{ {
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private $email; private string $email;
private $mailTo; private string $mailTo;
private $mailBody; private string $mailBody;
/** /**
* SendContactUsEmail constructor. * SendContactUsEmail constructor.
*/ */
public function __construct($email, $mailTo, $mailBody) public function __construct(string $email, string $mailTo, string $mailBody)
{ {
$this->email = $email; $this->email = $email;
$this->mailTo = $mailTo; $this->mailTo = $mailTo;
+4 -7
View File
@@ -14,19 +14,16 @@ class SendInviteEmail implements ShouldQueue
{ {
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private $email; private string $email;
private $url; private string $url;
/** private \App\Models\User $user;
* @var \App\Models\User
*/
private $user;
/** /**
* SendInviteEmail constructor. * SendInviteEmail constructor.
*/ */
public function __construct($email, $user, $url) public function __construct(string $email, \App\Models\User $user, string $url)
{ {
$this->email = $email; $this->email = $email;
$this->user = $user; $this->user = $user;
+3 -6
View File
@@ -15,17 +15,14 @@ class SendPasswordForgottenEmail implements ShouldQueue
{ {
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private $resetLink; private string $resetLink;
/** private User $user;
* @var User
*/
private $user;
/** /**
* Create a new job instance. * Create a new job instance.
*/ */
public function __construct(User $user, $resetLink) public function __construct(User $user, string $resetLink)
{ {
$this->user = $user; $this->user = $user;
$this->resetLink = $resetLink; $this->resetLink = $resetLink;
+1 -1
View File
@@ -28,7 +28,7 @@ class AccountDeleted extends Mailable
/** /**
* Create a new message instance. * Create a new message instance.
*/ */
public function __construct($user) public function __construct(mixed $user)
{ {
$this->user = $user; $this->user = $user;
$this->siteEmail = config('mail.from.address'); $this->siteEmail = config('mail.from.address');
+4 -4
View File
@@ -10,16 +10,16 @@ class AccountExpired extends Mailable
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
public $user; public \App\Models\User $user;
private $siteEmail; private mixed $siteEmail;
private $siteTitle; private mixed $siteTitle;
/** /**
* Create a new message instance. * Create a new message instance.
*/ */
public function __construct($user) public function __construct(\App\Models\User $user)
{ {
$this->user = $user; $this->user = $user;
$this->siteEmail = config('mail.from.address'); $this->siteEmail = config('mail.from.address');
+5 -13
View File
@@ -10,26 +10,18 @@ class AccountWillExpire extends Mailable
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
private $days; private int $days;
private $user; private \App\Models\User $user;
/** private mixed $siteEmail;
* @var mixed
*/
private $siteEmail;
/** private mixed $siteTitle;
* @var mixed
*/
private $siteTitle;
/** /**
* Create a new message instance. * Create a new message instance.
*
* @return void
*/ */
public function __construct($user, $days) public function __construct(\App\Models\User $user, int $days)
{ {
$this->user = $user; $this->user = $user;
$this->days = $days; $this->days = $days;
+1 -1
View File
@@ -19,7 +19,7 @@ class ContactUs extends Mailable
/** /**
* Create a new message instance. * Create a new message instance.
*/ */
public function __construct($mailTo, $mailFrom, $mailBody) public function __construct(mixed $mailTo, mixed $mailFrom, mixed $mailBody)
{ {
$this->mailTo = $mailTo; $this->mailTo = $mailTo;
$this->mailFrom = $mailFrom; $this->mailFrom = $mailFrom;
+5 -11
View File
@@ -10,24 +10,18 @@ class ForgottenPassword extends Mailable
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
public $user; public mixed $user;
public $resetLink; public string $resetLink;
/** private mixed $siteEmail;
* @var mixed
*/
private $siteEmail;
/** private mixed $siteTitle;
* @var mixed
*/
private $siteTitle;
/** /**
* Create a new message instance. * Create a new message instance.
*/ */
public function __construct($resetLink) public function __construct(string $resetLink)
{ {
$this->resetLink = $resetLink; $this->resetLink = $resetLink;
$this->siteEmail = config('mail.from.address'); $this->siteEmail = config('mail.from.address');
+1 -1
View File
@@ -30,7 +30,7 @@ class NewAccountCreatedEmail extends Mailable
* *
* @return void * @return void
*/ */
public function __construct($user) public function __construct(mixed $user)
{ {
$this->user = $user; $this->user = $user;
$this->siteEmail = config('mail.from.address'); $this->siteEmail = config('mail.from.address');
+1 -1
View File
@@ -34,7 +34,7 @@ class PasswordReset extends Mailable
/** /**
* PasswordReset constructor. * PasswordReset constructor.
*/ */
public function __construct(User $user, $newPass) public function __construct(User $user, mixed $newPass)
{ {
$this->user = $user; $this->user = $user;
$this->newPass = $newPass; $this->newPass = $newPass;

Some files were not shown because too many files have changed in this diff Show More