mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 22:01:33 +00:00
Update phpstan level to 6
This commit is contained in:
@@ -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');
|
||||
$releases = new Release;
|
||||
@@ -76,7 +76,7 @@ class CleanNZB extends Command
|
||||
$this->info("Checked: $checked / Deleted: $deleted");
|
||||
}
|
||||
|
||||
private function GetReleasesWithNoNZBOnDisk($delete = false)
|
||||
private function GetReleasesWithNoNZBOnDisk(mixed $delete = false): void
|
||||
{
|
||||
// Setup
|
||||
$nzb = app(NzbService::class);
|
||||
|
||||
@@ -29,7 +29,7 @@ class CollectStats extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$this->info('Collecting site stats...');
|
||||
GrabStat::insertTopGrabbers();
|
||||
|
||||
@@ -154,6 +154,8 @@ class CreateManticoreIndexes extends Command
|
||||
|
||||
/**
|
||||
* Create a single index with error handling.
|
||||
*
|
||||
* @param array<string, mixed> $schema
|
||||
*/
|
||||
protected function createIndex(string $indexName, array $schema, bool $dropExisting): bool
|
||||
{
|
||||
|
||||
@@ -141,6 +141,8 @@ class CreateMediaIndexes extends Command
|
||||
|
||||
/**
|
||||
* Create a single Manticore index.
|
||||
*
|
||||
* @param array<string, mixed> $schema
|
||||
*/
|
||||
private function createManticoreIndex(Client $client, string $indexName, array $schema, bool $dropExisting): bool
|
||||
{
|
||||
|
||||
@@ -174,6 +174,8 @@ class DeleteReleases extends Command
|
||||
|
||||
/**
|
||||
* Perform a dry run to show what releases would be deleted.
|
||||
*
|
||||
* @param array<string, mixed> $criteria
|
||||
*/
|
||||
protected function performDryRun(array $criteria): int
|
||||
{
|
||||
@@ -234,6 +236,8 @@ class DeleteReleases extends Command
|
||||
|
||||
/**
|
||||
* Build the SQL query from criteria array.
|
||||
*
|
||||
* @param array<string, mixed> $criteria
|
||||
*/
|
||||
protected function buildQueryFromCriteria(array $criteria): ?string
|
||||
{
|
||||
@@ -396,6 +400,8 @@ class DeleteReleases extends Command
|
||||
|
||||
/**
|
||||
* Build criteria array from simple command options.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
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';
|
||||
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
$threshold = $this->option('threshold'); // Percentage difference threshold
|
||||
$limit = $this->option('limit');
|
||||
@@ -124,7 +124,7 @@ class FindSizeMismatchedReleases extends Command
|
||||
return null;
|
||||
}
|
||||
|
||||
private function outputReleaseIdsAsCsv($mismatches): void
|
||||
private function outputReleaseIdsAsCsv(mixed $mismatches): void
|
||||
{
|
||||
$releaseIds = $mismatches->pluck('id')->join(',');
|
||||
$this->line("\nRelease IDs in CSV format:");
|
||||
|
||||
@@ -87,6 +87,9 @@ class GetArticleRange extends Command
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ class MatchPrefiles extends Command
|
||||
|
||||
try {
|
||||
$nameFixingService = new NameFixingService;
|
||||
$nameFixingService->getPreFileNames($argv);
|
||||
$nameFixingService->getPreFileNames($argv); // @phpstan-ignore argument.type
|
||||
|
||||
return 0;
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -96,7 +96,7 @@ class NntmuxOffsetPopulate extends Command
|
||||
|
||||
// Start parallel processes
|
||||
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']}");
|
||||
|
||||
$process = Process::start($command);
|
||||
@@ -108,7 +108,7 @@ class NntmuxOffsetPopulate extends Command
|
||||
}
|
||||
|
||||
// Monitor processes
|
||||
$this->monitorProcesses($processes);
|
||||
$this->monitorProcesses($processes); // @phpstan-ignore argument.type
|
||||
|
||||
// Verify final count
|
||||
$this->verifyIndexPopulation($engine, $index, $total);
|
||||
@@ -120,6 +120,8 @@ class NntmuxOffsetPopulate extends Command
|
||||
|
||||
/**
|
||||
* Create offset-based ranges for parallel execution
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function createOffsetRanges(int $total, int $processes): array
|
||||
{
|
||||
@@ -144,6 +146,8 @@ class NntmuxOffsetPopulate extends Command
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
@@ -176,6 +180,8 @@ class NntmuxOffsetPopulate extends Command
|
||||
|
||||
/**
|
||||
* Monitor parallel processes
|
||||
*
|
||||
* @param array<string, mixed> $processes
|
||||
*/
|
||||
private function monitorProcesses(array $processes): void
|
||||
{
|
||||
@@ -353,6 +359,8 @@ class NntmuxOffsetPopulate extends Command
|
||||
|
||||
/**
|
||||
* Get index mappings
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function getIndexMappings(string $indexName): array
|
||||
{
|
||||
|
||||
@@ -104,7 +104,7 @@ class NntmuxOffsetWorker extends Command
|
||||
$processed++;
|
||||
|
||||
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');
|
||||
$batchData = [];
|
||||
}
|
||||
@@ -117,7 +117,7 @@ class NntmuxOffsetWorker extends Command
|
||||
|
||||
// Process remaining items
|
||||
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');
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ class NntmuxOffsetWorker extends Command
|
||||
/**
|
||||
* 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') {
|
||||
return Release::query()
|
||||
@@ -247,6 +247,8 @@ class NntmuxOffsetWorker extends Command
|
||||
|
||||
/**
|
||||
* Process search batch
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function processSearchBatch(array $data, int $workerId): void
|
||||
{
|
||||
@@ -269,6 +271,8 @@ class NntmuxOffsetWorker extends Command
|
||||
|
||||
/**
|
||||
* Process ElasticSearch batch
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function processElasticBatch(array $data, int $workerId): void
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ class NntmuxOptimizeTables extends Command
|
||||
if (empty($table) || $table[0] === 'all') {
|
||||
$this->optimizeAllTables();
|
||||
} else {
|
||||
$this->optimizeTable($table);
|
||||
$this->optimizeTable($table); // @phpstan-ignore argument.type
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ class NntmuxOptimizeTables extends Command
|
||||
|
||||
/**
|
||||
* Optimize a single table.
|
||||
*
|
||||
* @param array<string, mixed> $tables
|
||||
*/
|
||||
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);
|
||||
$tableCheck = DB::select('CHECK TABLE '.$table);
|
||||
|
||||
@@ -355,7 +355,7 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
/**
|
||||
* 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();
|
||||
$batchSize = $this->getBatchSize();
|
||||
@@ -388,7 +388,7 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
|
||||
// Process in optimized batch sizes
|
||||
if (count($batchData) >= $batchSize) {
|
||||
$this->processBatch($indexName, $batchData);
|
||||
$this->processBatch($indexName, $batchData); // @phpstan-ignore argument.type
|
||||
$batchData = [];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
@@ -403,7 +403,7 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
|
||||
// Process remaining items
|
||||
if (! empty($batchData)) {
|
||||
$this->processBatch($indexName, $batchData);
|
||||
$this->processBatch($indexName, $batchData); // @phpstan-ignore argument.type
|
||||
}
|
||||
|
||||
$bar->finish();
|
||||
@@ -431,7 +431,7 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
/**
|
||||
* 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();
|
||||
$batchSize = $this->getBatchSize();
|
||||
@@ -463,7 +463,7 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
|
||||
// Process in optimized batch sizes
|
||||
if (count($batchData) >= $batchSize) {
|
||||
$this->processMoviesBatch($batchData);
|
||||
$this->processMoviesBatch($batchData); // @phpstan-ignore argument.type
|
||||
$batchData = [];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
@@ -478,7 +478,7 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
|
||||
// Process remaining items
|
||||
if (! empty($batchData)) {
|
||||
$this->processMoviesBatch($batchData);
|
||||
$this->processMoviesBatch($batchData); // @phpstan-ignore argument.type
|
||||
}
|
||||
|
||||
$bar->finish();
|
||||
@@ -506,7 +506,7 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
/**
|
||||
* 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();
|
||||
$batchSize = $this->getBatchSize();
|
||||
@@ -538,7 +538,7 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
|
||||
// Process in optimized batch sizes
|
||||
if (count($batchData) >= $batchSize) {
|
||||
$this->processTvShowsBatch($batchData);
|
||||
$this->processTvShowsBatch($batchData); // @phpstan-ignore argument.type
|
||||
$batchData = [];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
@@ -553,7 +553,7 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
|
||||
// Process remaining items
|
||||
if (! empty($batchData)) {
|
||||
$this->processTvShowsBatch($batchData);
|
||||
$this->processTvShowsBatch($batchData); // @phpstan-ignore argument.type
|
||||
}
|
||||
|
||||
$bar->finish();
|
||||
@@ -666,7 +666,7 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
/**
|
||||
* 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();
|
||||
$batchSize = $this->getBatchSize();
|
||||
@@ -748,6 +748,8 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
|
||||
/**
|
||||
* Process search index batch with retry logic
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function processBatch(string $indexName, array $data): void
|
||||
{
|
||||
@@ -777,6 +779,8 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
|
||||
/**
|
||||
* Process movies batch with retry logic
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function processMoviesBatch(array $data): void
|
||||
{
|
||||
@@ -799,6 +803,8 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
|
||||
/**
|
||||
* Process TV shows batch with retry logic
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function processTvShowsBatch(array $data): void
|
||||
{
|
||||
@@ -821,6 +827,8 @@ class NntmuxPopulateSearchIndexes extends Command
|
||||
|
||||
/**
|
||||
* Process ElasticSearch batch with retry logic
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function processElasticBatch(array $data, int &$errorCount): void
|
||||
{
|
||||
|
||||
@@ -38,9 +38,9 @@ class NntmuxPopulateSteamApps extends Command
|
||||
|
||||
$this->info(sprintf(
|
||||
'Added %d new steam app(s), %d skipped, %d errors',
|
||||
$stats['inserted'],
|
||||
$stats['skipped'],
|
||||
$stats['errors']
|
||||
$stats['inserted'], // @phpstan-ignore offsetAccess.notFound
|
||||
$stats['skipped'], // @phpstan-ignore offsetAccess.notFound
|
||||
$stats['errors'] // @phpstan-ignore offsetAccess.notFound
|
||||
));
|
||||
} catch (\Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
|
||||
@@ -9,9 +9,9 @@ use Illuminate\Console\Command;
|
||||
class NntmuxResetPostProcessing extends Command
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
* @var array<string, mixed>
|
||||
*/
|
||||
private static $allowedCategories = [
|
||||
private static $allowedCategories = [ // @phpstan-ignore property.defaultValue
|
||||
'music',
|
||||
'console',
|
||||
'movie',
|
||||
@@ -96,7 +96,7 @@ class NntmuxResetPostProcessing extends Command
|
||||
$this->info('No releases to reset');
|
||||
}
|
||||
} else {
|
||||
$normalized = $this->normalizeCategories($raw);
|
||||
$normalized = $this->normalizeCategories($raw); // @phpstan-ignore argument.type
|
||||
|
||||
// Validate
|
||||
$invalid = $this->invalidCategories($normalized);
|
||||
@@ -154,6 +154,9 @@ class NntmuxResetPostProcessing extends Command
|
||||
* Normalize raw category options into a unique, lowercased list.
|
||||
* 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).
|
||||
*
|
||||
* @param array<string, mixed> $raw
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function normalizeCategories(array $raw): array
|
||||
{
|
||||
@@ -190,6 +193,9 @@ class NntmuxResetPostProcessing extends Command
|
||||
/**
|
||||
* Return invalid categories from a normalized list.
|
||||
* Keeps 'all' as a special allowed token.
|
||||
*
|
||||
* @param array<string, mixed> $normalized
|
||||
* @return array<int, string>
|
||||
*/
|
||||
private function invalidCategories(array $normalized): array
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ class ProcessBackfill extends Command
|
||||
}
|
||||
|
||||
try {
|
||||
(new ForkingService)->backfill($options);
|
||||
(new ForkingService)->backfill($options); // @phpstan-ignore argument.type
|
||||
|
||||
return self::SUCCESS;
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@@ -97,8 +97,9 @@ class RecategorizeReleases extends Command
|
||||
$this->line('');
|
||||
$this->output->writeln('<fg=yellow>ID :</> '.$result->id);
|
||||
$this->output->writeln('<fg=green>Release :</> '.$result->searchname);
|
||||
$this->output->writeln('<fg=cyan>Group :</> '.$result->group->name); // @phpstan-ignore property.notFound
|
||||
$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
|
||||
$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 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->line('');
|
||||
|
||||
@@ -64,6 +64,8 @@ class RedisMonitor extends Command
|
||||
|
||||
/**
|
||||
* Display stats in table format (for --once mode).
|
||||
*
|
||||
* @param array<string, mixed> $stats
|
||||
*/
|
||||
protected function displayStats(array $stats): void
|
||||
{
|
||||
|
||||
@@ -200,7 +200,7 @@ class RefreshAnimeData extends Command
|
||||
continue;
|
||||
}
|
||||
|
||||
$anilistData = $searchResults[0];
|
||||
$anilistData = $searchResults[0]; // @phpstan-ignore offsetAccess.notFound
|
||||
$anilistId = $anilistData['id'] ?? null;
|
||||
|
||||
if (! $anilistId) {
|
||||
|
||||
@@ -325,7 +325,7 @@ class ReleasesFixNamesGroup extends Command
|
||||
/**
|
||||
* Fetch releases for processing
|
||||
*/
|
||||
protected function fetchReleases(string $guidChar, int $maxPerRun)
|
||||
protected function fetchReleases(string $guidChar, int $maxPerRun): mixed
|
||||
{
|
||||
return Release::fromQuery(sprintf("
|
||||
SELECT
|
||||
|
||||
@@ -93,6 +93,8 @@ class SteamLookupGame extends Command
|
||||
|
||||
/**
|
||||
* Display game details in a formatted way.
|
||||
*
|
||||
* @param array<string, mixed> $details
|
||||
*/
|
||||
protected function displayGameDetails(array $details): void
|
||||
{
|
||||
|
||||
@@ -142,6 +142,8 @@ class TmuxMonitor extends Command
|
||||
|
||||
/**
|
||||
* Run tasks in appropriate panes
|
||||
*
|
||||
* @param array<string, mixed> $runVar
|
||||
*/
|
||||
private function runPaneTasks(array $runVar): void
|
||||
{
|
||||
@@ -165,6 +167,8 @@ class TmuxMonitor extends Command
|
||||
|
||||
/**
|
||||
* Run IRC scraper
|
||||
*
|
||||
* @param array<string, mixed> $runVar
|
||||
*/
|
||||
private function runIRCScraper(array $runVar): void
|
||||
{
|
||||
@@ -175,6 +179,8 @@ class TmuxMonitor extends Command
|
||||
|
||||
/**
|
||||
* Run full non-sequential tasks
|
||||
*
|
||||
* @param array<string, mixed> $runVar
|
||||
*/
|
||||
private function runFullTasks(array $runVar): void
|
||||
{
|
||||
@@ -193,6 +199,8 @@ class TmuxMonitor extends Command
|
||||
|
||||
/**
|
||||
* Run basic sequential tasks
|
||||
*
|
||||
* @param array<string, mixed> $runVar
|
||||
*/
|
||||
private function runBasicTasks(array $runVar): void
|
||||
{
|
||||
@@ -205,6 +213,8 @@ class TmuxMonitor extends Command
|
||||
|
||||
/**
|
||||
* Run stripped sequential tasks
|
||||
*
|
||||
* @param array<string, mixed> $runVar
|
||||
*/
|
||||
private function runSequentialTasks(array $runVar): void
|
||||
{
|
||||
@@ -214,6 +224,8 @@ class TmuxMonitor extends Command
|
||||
|
||||
/**
|
||||
* Run post-processing tasks (common to most modes)
|
||||
*
|
||||
* @param array<string, mixed> $runVar
|
||||
*/
|
||||
private function runPostProcessingTasks(array $runVar): void
|
||||
{
|
||||
|
||||
@@ -304,6 +304,8 @@ class UpdateNNTmux extends Command
|
||||
|
||||
/**
|
||||
* Parse environment file into key-value pairs
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function parseEnvFile(string $path): array
|
||||
{
|
||||
@@ -329,6 +331,8 @@ class UpdateNNTmux extends Command
|
||||
|
||||
/**
|
||||
* Add missing environment variables to .env file
|
||||
*
|
||||
* @param array<string, mixed> $missingKeys
|
||||
*/
|
||||
private function addMissingEnvVars(string $envPath, array $missingKeys): void
|
||||
{
|
||||
|
||||
@@ -35,6 +35,8 @@ class UpdateReleasesIndexSchema extends Command
|
||||
|
||||
/**
|
||||
* The expected schema fields for releases_rt
|
||||
*
|
||||
* @var array<string, mixed>
|
||||
*/
|
||||
private array $expectedFields = [
|
||||
'name' => ['type' => 'text'],
|
||||
@@ -386,7 +388,7 @@ class UpdateReleasesIndexSchema extends Command
|
||||
|
||||
// Process batch when it reaches the threshold
|
||||
if (count($batch) >= 1000) {
|
||||
$result = $this->processBatch($indexName, $batch);
|
||||
$result = $this->processBatch($indexName, $batch); // @phpstan-ignore argument.type
|
||||
$updated += $result['updated'];
|
||||
$errors += $result['errors'];
|
||||
$batch = [];
|
||||
@@ -397,7 +399,7 @@ class UpdateReleasesIndexSchema extends Command
|
||||
|
||||
// Process remaining batch
|
||||
if (! empty($batch)) {
|
||||
$result = $this->processBatch($indexName, $batch);
|
||||
$result = $this->processBatch($indexName, $batch); // @phpstan-ignore argument.type
|
||||
$updated += $result['updated'];
|
||||
$errors += $result['errors'];
|
||||
}
|
||||
@@ -417,8 +419,10 @@ class UpdateReleasesIndexSchema extends Command
|
||||
|
||||
/**
|
||||
* Prepare media data for a release
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function prepareMediaData($release): array
|
||||
private function prepareMediaData(mixed $release): array
|
||||
{
|
||||
return [
|
||||
'imdbid' => (int) ($release->imdbid ?: 0),
|
||||
@@ -462,6 +466,9 @@ class UpdateReleasesIndexSchema extends Command
|
||||
|
||||
/**
|
||||
* Process a batch of updates
|
||||
*
|
||||
* @param array<string, mixed> $batch
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function processBatch(string $indexName, array $batch): array
|
||||
{
|
||||
@@ -494,6 +501,8 @@ class UpdateReleasesIndexSchema extends Command
|
||||
/**
|
||||
* Insert or replace a document in the index
|
||||
* This is used as a fallback when UPDATE fails
|
||||
*
|
||||
* @param array<string, mixed> $mediaData
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @var array<string, mixed>
|
||||
*/
|
||||
private array $mediaFields = [
|
||||
'imdbid' => ['type' => 'integer'],
|
||||
@@ -570,8 +572,10 @@ class UpdateReleasesIndexSchemaES extends Command
|
||||
|
||||
/**
|
||||
* Prepare media data for a release
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function prepareMediaData($release): array
|
||||
private function prepareMediaData(mixed $release): array
|
||||
{
|
||||
return [
|
||||
'imdbid' => (int) ($release->imdbid ?: 0),
|
||||
|
||||
@@ -20,7 +20,7 @@ class UserAccessedApi
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*/
|
||||
public function __construct($user, ?string $ip = null)
|
||||
public function __construct(mixed $user, ?string $ip = null)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->ip = $ip;
|
||||
|
||||
@@ -10,17 +10,14 @@ class UserLoggedIn
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
/**
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
public $user;
|
||||
public \App\Models\User $user;
|
||||
|
||||
public $ip;
|
||||
public string $ip;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*/
|
||||
public function __construct($user, $ip = '')
|
||||
public function __construct(\App\Models\User $user, string $ip = '')
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->ip = $ip;
|
||||
|
||||
@@ -19,7 +19,7 @@ if (! function_exists('getRawHtmlWithAgeVerification')) {
|
||||
* @param string $url URL to fetch
|
||||
* @param string|false $cookie Optional cookie string (legacy support)
|
||||
* @param string|null $postData Optional POST data
|
||||
* @return string|array|false
|
||||
* @return string|array<string, mixed>|false
|
||||
*/
|
||||
function getRawHtmlWithAgeVerification($url, $cookie = false, $postData = null)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ if (! function_exists('initializeAdultSiteCookies')) {
|
||||
* Initialize age verification cookies for all adult sites
|
||||
* Run this once during application setup
|
||||
*
|
||||
* @return array Statistics about initialized cookies
|
||||
* @return array<string, mixed> Statistics about initialized cookies
|
||||
*/
|
||||
function initializeAdultSiteCookies(): array
|
||||
{
|
||||
@@ -156,7 +156,7 @@ if (! function_exists('getAdultSiteCookieStats')) {
|
||||
/**
|
||||
* Get statistics about stored adult site cookies
|
||||
*
|
||||
* @return array Cookie statistics
|
||||
* @return array<string, mixed> Cookie statistics
|
||||
*/
|
||||
function getAdultSiteCookieStats(): array
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ if (! function_exists('getRawHtml')) {
|
||||
* @param bool $cookie
|
||||
* @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
|
||||
$adultSites = [
|
||||
@@ -112,7 +112,7 @@ if (! function_exists('makeFieldLinks')) {
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
function makeFieldLinks($data, $field, $type)
|
||||
function makeFieldLinks(mixed $data, mixed $field, mixed $type)
|
||||
{
|
||||
$tmpArr = explode(', ', $data[$field]);
|
||||
$newArr = [];
|
||||
@@ -139,6 +139,7 @@ if (! function_exists('makeFieldLinks')) {
|
||||
if (! function_exists('getUserBrowseOrder')) {
|
||||
/**
|
||||
* @param string $orderBy
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
function getUserBrowseOrder($orderBy): array
|
||||
{
|
||||
@@ -163,6 +164,9 @@ if (! function_exists('getUserBrowseOrder')) {
|
||||
}
|
||||
|
||||
if (! function_exists('getUserBrowseOrdering')) {
|
||||
/**
|
||||
* @return array<int, string>
|
||||
*/
|
||||
function getUserBrowseOrdering(): array
|
||||
{
|
||||
return [
|
||||
@@ -206,7 +210,7 @@ if (! function_exists('human_filesize')) {
|
||||
/**
|
||||
* @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'];
|
||||
$factor = (int) floor((\strlen((string) $bytes) - 1) / 3);
|
||||
@@ -219,7 +223,7 @@ if (! function_exists('bcdechex')) {
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function bcdechex($dec)
|
||||
function bcdechex(mixed $dec)
|
||||
{
|
||||
$hex = '';
|
||||
do {
|
||||
@@ -262,7 +266,7 @@ if (! function_exists('runCmd')) {
|
||||
|
||||
if (! function_exists('escapeString')) {
|
||||
|
||||
function escapeString($string): string
|
||||
function escapeString(mixed $string): string
|
||||
{
|
||||
return DB::connection()->getPdo()->quote($string);
|
||||
}
|
||||
@@ -270,7 +274,7 @@ if (! function_exists('escapeString')) {
|
||||
|
||||
if (! function_exists('realDuration')) {
|
||||
|
||||
function realDuration($milliseconds): string
|
||||
function realDuration(mixed $milliseconds): string
|
||||
{
|
||||
$time = round($milliseconds / 1000);
|
||||
|
||||
@@ -282,7 +286,7 @@ if (! function_exists('is_it_json')) {
|
||||
/**
|
||||
* @throws JsonException
|
||||
*/
|
||||
function is_it_json($isIt): bool
|
||||
function is_it_json(mixed $isIt): bool
|
||||
{
|
||||
if (is_array($isIt)) {
|
||||
return false;
|
||||
@@ -295,6 +299,8 @@ if (! function_exists('is_it_json')) {
|
||||
|
||||
if (! function_exists('getStreamingZip')) {
|
||||
/**
|
||||
* @param array<string, mixed> $guids
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
function getReleaseCover($release): string
|
||||
@@ -524,6 +530,10 @@ if (! function_exists('getReleaseCover')) {
|
||||
}
|
||||
|
||||
if (! function_exists('sanitize')) {
|
||||
/**
|
||||
* @param array<string, mixed> $doNotSanitize
|
||||
* @param array<string, mixed> $phrases
|
||||
*/
|
||||
function sanitize(array|string $phrases, array $doNotSanitize = []): string
|
||||
{
|
||||
if (! is_array($phrases)) {
|
||||
@@ -658,7 +668,7 @@ if (! function_exists('getAvailableTimezones')) {
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
@@ -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).
|
||||
*
|
||||
* @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
|
||||
{
|
||||
@@ -775,6 +785,9 @@ if (! function_exists('streamSslContextOptions')) {
|
||||
}
|
||||
|
||||
if (! function_exists('getCoverURL')) {
|
||||
/**
|
||||
* @param array<string, mixed> $options
|
||||
*/
|
||||
function getCoverURL(array $options = []): string
|
||||
{
|
||||
$defaults = [
|
||||
@@ -845,7 +858,7 @@ if (! function_exists('imdb_trailers')) {
|
||||
/**
|
||||
* 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);
|
||||
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')) {
|
||||
function showApiError(int $errorCode = 900, string $errorText = '')
|
||||
function showApiError(int $errorCode = 900, string $errorText = ''): mixed
|
||||
{
|
||||
$errorHeader = 'HTTP 1.1 400 Bad Request';
|
||||
if ($errorText === '') {
|
||||
@@ -942,7 +955,7 @@ if (! function_exists('showApiError')) {
|
||||
}
|
||||
|
||||
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);
|
||||
if ($tableName === 'xxxinfo') {
|
||||
|
||||
@@ -12,7 +12,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
*
|
||||
* @see \App\Services\Categorization\CategorizationPipeline
|
||||
*/
|
||||
class Categorization extends Facade
|
||||
class Categorization extends Facade // @phpstan-ignore missingType.iterableValue, missingType.generics
|
||||
{
|
||||
protected static function getFacadeAccessor(): string
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
*
|
||||
* @see \Mailerlite\LaravelElasticsearch\Manager
|
||||
*/
|
||||
class Elasticsearch extends Facade
|
||||
class Elasticsearch extends Facade // @phpstan-ignore missingType.iterableValue
|
||||
{
|
||||
protected static function getFacadeAccessor(): string
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
*
|
||||
* @see \App\Services\Search\SearchService
|
||||
*/
|
||||
class Search extends Facade
|
||||
class Search extends Facade // @phpstan-ignore missingType.iterableValue
|
||||
{
|
||||
/**
|
||||
* Get the registered name of the component.
|
||||
|
||||
@@ -14,7 +14,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
*
|
||||
* @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.
|
||||
|
||||
@@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
*
|
||||
* @see \App\Services\YencService
|
||||
*/
|
||||
class Yenc extends Facade
|
||||
class Yenc extends Facade // @phpstan-ignore missingType.iterableValue
|
||||
{
|
||||
/**
|
||||
* Get the registered name of the component.
|
||||
|
||||
@@ -13,7 +13,7 @@ class AdminAjaxController extends BasePageController
|
||||
/**
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function ajaxAction(Request $request)
|
||||
public function ajaxAction(Request $request): mixed
|
||||
{
|
||||
if ($request->missing('action')) {
|
||||
return response()->json(['success' => false, 'message' => 'No action specified'], 400);
|
||||
@@ -127,5 +127,8 @@ class AdminAjaxController extends BasePageController
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['success' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class AdminBlacklistController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index()
|
||||
public function index(): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$svc = new BlacklistService;
|
||||
|
||||
@@ -12,7 +12,7 @@ class AdminCategoryController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index()
|
||||
public function index(): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$meta_title = $title = 'Category List';
|
||||
|
||||
@@ -12,7 +12,7 @@ class AdminCategoryRegexesController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$regexes = new RegexService('category_regexes');
|
||||
|
||||
@@ -12,7 +12,7 @@ class AdminCollectionRegexesController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$regexes = new RegexService('collection_regexes');
|
||||
@@ -101,7 +101,7 @@ class AdminCollectionRegexesController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testRegex(Request $request)
|
||||
public function testRegex(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$meta_title = $title = 'Collections Regex Test';
|
||||
|
||||
@@ -13,7 +13,7 @@ class AdminContentController extends BasePageController
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index()
|
||||
public function index(): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
@@ -116,7 +116,7 @@ class AdminContentController extends BasePageController
|
||||
/**
|
||||
* Toggle content status (enable/disable).
|
||||
*/
|
||||
public function toggleStatus(Request $request)
|
||||
public function toggleStatus(Request $request): mixed
|
||||
{
|
||||
if ($request->has('id')) {
|
||||
$content = Content::query()->find($request->input('id'));
|
||||
@@ -145,7 +145,7 @@ class AdminContentController extends BasePageController
|
||||
/**
|
||||
* Delete content by ID.
|
||||
*/
|
||||
public function destroy(Request $request)
|
||||
public function destroy(Request $request): mixed
|
||||
{
|
||||
if ($request->has('id')) {
|
||||
$content = Content::query()->find($request->input('id'));
|
||||
@@ -180,6 +180,8 @@ class AdminContentController extends BasePageController
|
||||
|
||||
/**
|
||||
* Add new content.
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
protected function addContent(array $data): int
|
||||
{
|
||||
@@ -208,6 +210,8 @@ class AdminContentController extends BasePageController
|
||||
|
||||
/**
|
||||
* Update existing content.
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
protected function updateContent(array $data): int
|
||||
{
|
||||
@@ -240,6 +244,9 @@ class AdminContentController extends BasePageController
|
||||
|
||||
/**
|
||||
* Normalize content URL to ensure proper formatting.
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function normalizeContentUrl(array $data): array
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ class AdminFailedReleasesController extends BasePageController
|
||||
/**
|
||||
* Display a listing of failed releases
|
||||
*/
|
||||
public function index()
|
||||
public function index(): mixed
|
||||
{
|
||||
$meta_title = $title = 'Failed Releases List';
|
||||
$releaselist = Release::getFailedRange();
|
||||
|
||||
@@ -13,7 +13,7 @@ class AdminGameController extends BasePageController
|
||||
/**
|
||||
* Display a listing of games
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$game = new GamesService;
|
||||
|
||||
@@ -36,7 +36,7 @@ class AdminGameController extends BasePageController
|
||||
/**
|
||||
* Show the form for editing a game
|
||||
*/
|
||||
public function edit(Request $request)
|
||||
public function edit(Request $request): mixed
|
||||
{
|
||||
$games = new GamesService;
|
||||
$gen = new GenreService;
|
||||
|
||||
@@ -11,7 +11,7 @@ class AdminGroupController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$groupname = $request->input('groupname') ?? '';
|
||||
$grouplist = UsenetGroup::getGroupsRange($groupname);
|
||||
@@ -23,7 +23,7 @@ class AdminGroupController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function createBulk(Request $request)
|
||||
public function createBulk(Request $request): mixed
|
||||
{
|
||||
// set the current action
|
||||
$action = $request->input('action') ?? 'view';
|
||||
@@ -97,7 +97,7 @@ class AdminGroupController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function active(Request $request)
|
||||
public function active(Request $request): mixed
|
||||
{
|
||||
$gname = '';
|
||||
if (! empty($request->input('groupname'))) {
|
||||
@@ -114,7 +114,7 @@ class AdminGroupController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function inactive(Request $request)
|
||||
public function inactive(Request $request): mixed
|
||||
{
|
||||
$gname = '';
|
||||
if (! empty($request->input('groupname'))) {
|
||||
|
||||
@@ -125,6 +125,8 @@ class AdminInvitationController extends BasePageController
|
||||
|
||||
/**
|
||||
* Get overall invitation statistics with caching
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function getOverallStats(): array
|
||||
{
|
||||
@@ -149,6 +151,8 @@ class AdminInvitationController extends BasePageController
|
||||
|
||||
/**
|
||||
* Get top inviters statistics with caching
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function getTopInviters(int $limit = 10): array
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ class AdminMovieController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$lastSearch = $request->input('moviesearch', '');
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class AdminMusicController extends BasePageController
|
||||
/**
|
||||
* Display a listing of music
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$meta_title = $title = 'Music List';
|
||||
|
||||
@@ -34,7 +34,7 @@ class AdminMusicController extends BasePageController
|
||||
/**
|
||||
* Show the form for editing music
|
||||
*/
|
||||
public function edit(Request $request)
|
||||
public function edit(Request $request): mixed
|
||||
{
|
||||
$music = new MusicService;
|
||||
$gen = new GenreService;
|
||||
|
||||
@@ -23,7 +23,7 @@ class AdminPageController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index()
|
||||
public function index(): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
@@ -52,6 +52,8 @@ class AdminPageController extends BasePageController
|
||||
|
||||
/**
|
||||
* Get recent user activity from the user_activities table with caching
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getRecentUserActivity(): array
|
||||
{
|
||||
@@ -78,7 +80,7 @@ class AdminPageController extends BasePageController
|
||||
/**
|
||||
* API endpoint to get recent user activity (for auto-refresh)
|
||||
*/
|
||||
public function getRecentActivity()
|
||||
public function getRecentActivity(): mixed
|
||||
{
|
||||
$activities = $this->getRecentUserActivity();
|
||||
|
||||
@@ -101,6 +103,8 @@ class AdminPageController extends BasePageController
|
||||
|
||||
/**
|
||||
* Get default dashboard statistics with caching for expensive queries
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getDefaultStats(): array
|
||||
{
|
||||
@@ -179,6 +183,8 @@ class AdminPageController extends BasePageController
|
||||
|
||||
/**
|
||||
* Get system metrics (CPU and RAM usage) with caching
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getSystemMetrics(): array
|
||||
{
|
||||
@@ -297,6 +303,8 @@ class AdminPageController extends BasePageController
|
||||
|
||||
/**
|
||||
* Get detailed CPU information (cores, threads, model)
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getCpuInfo(): array
|
||||
{
|
||||
@@ -366,6 +374,8 @@ class AdminPageController extends BasePageController
|
||||
|
||||
/**
|
||||
* Get system load average
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getLoadAverage(): array
|
||||
{
|
||||
@@ -405,6 +415,8 @@ class AdminPageController extends BasePageController
|
||||
|
||||
/**
|
||||
* Get RAM usage information
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getRamUsage(): array
|
||||
{
|
||||
@@ -460,7 +472,7 @@ class AdminPageController extends BasePageController
|
||||
/**
|
||||
* Get minute-to-minute user activity data (API endpoint)
|
||||
*/
|
||||
public function getUserActivityMinutes()
|
||||
public function getUserActivityMinutes(): mixed
|
||||
{
|
||||
$downloadsPerMinute = $this->userStatsService->getDownloadsPerMinute(60);
|
||||
$apiHitsPerMinute = $this->userStatsService->getApiHitsPerMinute(60);
|
||||
@@ -474,7 +486,7 @@ class AdminPageController extends BasePageController
|
||||
/**
|
||||
* Get current system metrics (API endpoint)
|
||||
*/
|
||||
public function getCurrentMetrics()
|
||||
public function getCurrentMetrics(): mixed
|
||||
{
|
||||
$cpuUsage = $this->getCpuUsage();
|
||||
$ramUsage = $this->getRamUsage();
|
||||
@@ -501,7 +513,7 @@ class AdminPageController extends BasePageController
|
||||
/**
|
||||
* Get historical system metrics (API endpoint)
|
||||
*/
|
||||
public function getHistoricalMetrics()
|
||||
public function getHistoricalMetrics(): mixed
|
||||
{
|
||||
$timeRange = request('range', '24h'); // 24h or 30d
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class AdminReleaseNamingRegexesController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$regexes = new RegexService('release_naming_regexes');
|
||||
@@ -108,7 +108,7 @@ class AdminReleaseNamingRegexesController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testRegex(Request $request)
|
||||
public function testRegex(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$meta_title = $title = 'Release Naming Regex Test';
|
||||
|
||||
@@ -21,7 +21,7 @@ class AdminReleasesController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
@@ -91,7 +91,7 @@ class AdminReleasesController extends BasePageController
|
||||
]);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
public function destroy(mixed $id): mixed
|
||||
{
|
||||
try {
|
||||
if ($id) {
|
||||
|
||||
@@ -11,7 +11,7 @@ class AdminRoleController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index()
|
||||
public function index(): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
@@ -32,7 +32,7 @@ class AdminRoleController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function create(Request $request)
|
||||
public function create(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
@@ -114,7 +114,7 @@ class AdminRoleController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function edit(Request $request)
|
||||
public function edit(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ class AdminSiteController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function stats()
|
||||
public function stats(): mixed
|
||||
{
|
||||
|
||||
$meta_title = $title = 'Site Stats';
|
||||
|
||||
@@ -11,7 +11,7 @@ class AdminTmuxController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function edit(Request $request)
|
||||
public function edit(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class AdminUserController extends BasePageController
|
||||
/**
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class AdminUserRoleHistoryController extends BasePageController
|
||||
/**
|
||||
* Display user role history list
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
@@ -83,7 +83,7 @@ class AdminUserRoleHistoryController extends BasePageController
|
||||
/**
|
||||
* Display role history for a specific user
|
||||
*/
|
||||
public function show(Request $request, int $userId)
|
||||
public function show(Request $request, int $userId): mixed
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class DeletedUsersController extends BasePageController
|
||||
/**
|
||||
* 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();
|
||||
|
||||
@@ -71,7 +71,7 @@ class DeletedUsersController extends BasePageController
|
||||
});
|
||||
|
||||
// Sorting
|
||||
[$orderField, $orderSort] = $this->getSortOrder($orderBy);
|
||||
[$orderField, $orderSort] = $this->getSortOrder($orderBy); // @phpstan-ignore offsetAccess.notFound
|
||||
$deletedUsers = $deletedUsers->orderBy($orderField, $orderSort)
|
||||
->paginate(25)
|
||||
->appends($request->except('page'));
|
||||
@@ -103,7 +103,7 @@ class DeletedUsersController extends BasePageController
|
||||
/**
|
||||
* Bulk restore or permanent delete.
|
||||
*/
|
||||
public function bulkAction(Request $request)
|
||||
public function bulkAction(Request $request): mixed
|
||||
{
|
||||
$action = $request->input('action');
|
||||
$userIds = $request->input('user_ids', []);
|
||||
@@ -136,7 +136,7 @@ class DeletedUsersController extends BasePageController
|
||||
/**
|
||||
* Restore single user.
|
||||
*/
|
||||
public function restore($id)
|
||||
public function restore(mixed $id): mixed
|
||||
{
|
||||
$user = User::onlyTrashed()->find($id);
|
||||
if ($user) {
|
||||
@@ -151,7 +151,7 @@ class DeletedUsersController extends BasePageController
|
||||
/**
|
||||
* Permanently delete single user.
|
||||
*/
|
||||
public function permanentDelete($id)
|
||||
public function permanentDelete(mixed $id): mixed
|
||||
{
|
||||
$user = User::onlyTrashed()->find($id);
|
||||
if ($user) {
|
||||
@@ -166,6 +166,8 @@ class DeletedUsersController extends BasePageController
|
||||
|
||||
/**
|
||||
* Parse and validate sort order.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function getSortOrder(string $orderBy): array
|
||||
{
|
||||
@@ -198,6 +200,6 @@ class DeletedUsersController extends BasePageController
|
||||
}
|
||||
}
|
||||
|
||||
return [$orderField, $orderSort];
|
||||
return [$orderField, $orderSort]; // @phpstan-ignore return.type
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class AdultController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function show(Request $request, string $id = '')
|
||||
public function show(Request $request, string $id = ''): mixed
|
||||
{
|
||||
$moviecats = Category::getChildren(Category::XXX_ROOT);
|
||||
$mtmp = [];
|
||||
@@ -48,7 +48,7 @@ class AdultController extends BasePageController
|
||||
|
||||
$page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1;
|
||||
$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());
|
||||
|
||||
$title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : '';
|
||||
|
||||
@@ -219,6 +219,7 @@ class ApiController extends BasePageController
|
||||
'trakt' => $request->input('traktid') ?? '0',
|
||||
'tvrage' => $request->input('rid') ?? '0',
|
||||
'tvmaze' => $request->input('tvmazeid') ?? '0',
|
||||
/** @phpstan-ignore argument.templateType */
|
||||
'imdb' => Str::replace('tt', '', $request->input('imdbid')) ?? '0',
|
||||
'tmdb' => $request->input('tmdbid') ?? '0',
|
||||
];
|
||||
@@ -393,11 +394,12 @@ class ApiController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $params
|
||||
* @return Response|void
|
||||
*
|
||||
* @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;
|
||||
$options = [
|
||||
@@ -431,6 +433,8 @@ class ApiController extends BasePageController
|
||||
* Collect and return various capability information for usage in API.
|
||||
*
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getForMenu(): array
|
||||
@@ -487,6 +491,8 @@ class ApiController extends BasePageController
|
||||
|
||||
/**
|
||||
* Verify cat parameter.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function categoryID(Request $request): array
|
||||
{
|
||||
@@ -507,6 +513,8 @@ class ApiController extends BasePageController
|
||||
* Verify groupName parameter.
|
||||
*
|
||||
*
|
||||
* @return list<int|string>
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
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)) {
|
||||
foreach ($releases as $key => $release) {
|
||||
|
||||
@@ -6,7 +6,6 @@ use App\Models\Category;
|
||||
use App\Models\Release;
|
||||
use App\Services\Releases\ReleaseBrowseService;
|
||||
use App\Services\Releases\ReleaseSearchService;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -29,7 +28,7 @@ class RSS extends ApiController
|
||||
/**
|
||||
* @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 = '';
|
||||
$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(
|
||||
|
||||
@@ -122,6 +121,7 @@ class RSS extends ApiController
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $excludedCats
|
||||
* @return Release[]|Collection|mixed
|
||||
*/
|
||||
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)
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
* @return \Illuminate\Support\Collection<int, mixed>
|
||||
*/
|
||||
public function getTrendingMoviesRss()
|
||||
{
|
||||
@@ -216,7 +216,7 @@ class RSS extends ApiController
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
|
||||
@@ -76,6 +76,8 @@ class XML_Response
|
||||
|
||||
/**
|
||||
* XMLReturn constructor.
|
||||
*
|
||||
* @param array<string, mixed> $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.
|
||||
*
|
||||
* @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
|
||||
{
|
||||
@@ -217,7 +219,7 @@ class XML_Response
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
@@ -593,7 +595,7 @@ class XML_Response
|
||||
{
|
||||
$movieCol = ['rating', 'plot', 'year', 'genre', 'director', 'actors'];
|
||||
|
||||
$cData = $this->buildCdata($movieCol);
|
||||
$cData = $this->buildCdata($movieCol); // @phpstan-ignore argument.type
|
||||
|
||||
$this->cdata .=
|
||||
"\t<li>Imdb Info:
|
||||
@@ -614,7 +616,7 @@ class XML_Response
|
||||
|
||||
$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 !== '') {
|
||||
$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'];
|
||||
|
||||
$cData = $this->buildCdata($gamesCol);
|
||||
$cData = $this->buildCdata($gamesCol); // @phpstan-ignore argument.type
|
||||
|
||||
$this->cdata .= "
|
||||
<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.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
protected function buildCdata(array $columns): string
|
||||
|
||||
@@ -35,7 +35,7 @@ class ForgotPasswordController extends Controller
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function showLinkRequestForm(Request $request)
|
||||
public function showLinkRequestForm(Request $request): mixed
|
||||
{
|
||||
// If it's a GET request, just show the form
|
||||
if ($request->isMethod('get')) {
|
||||
|
||||
@@ -186,7 +186,7 @@ class LoginController extends Controller
|
||||
return redirect()->to('login');
|
||||
}
|
||||
|
||||
public function showLoginForm()
|
||||
public function showLoginForm(): mixed
|
||||
{
|
||||
return view('auth.login');
|
||||
}
|
||||
|
||||
@@ -52,6 +52,9 @@ class RegisterController extends Controller
|
||||
$this->middleware('guest', ['except' => ['getVerification', 'getVerificationError']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
protected function create(array $data): User
|
||||
{
|
||||
$user = User::create([
|
||||
@@ -243,7 +246,7 @@ class RegisterController extends Controller
|
||||
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 = '';
|
||||
if ($request->has('invitecode')) {
|
||||
|
||||
@@ -41,7 +41,7 @@ class ResetPasswordController extends Controller
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function reset(Request $request)
|
||||
public function reset(Request $request): mixed
|
||||
{
|
||||
if ($request->missing('guid')) {
|
||||
return redirect()->route('password.request')->withErrors(['error' => 'No reset code provided.']);
|
||||
@@ -69,7 +69,7 @@ class ResetPasswordController extends Controller
|
||||
->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([
|
||||
'token' => $token,
|
||||
|
||||
@@ -13,7 +13,10 @@ use Illuminate\View\View;
|
||||
|
||||
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 = '';
|
||||
|
||||
@@ -39,6 +42,8 @@ class BasePageController extends Controller
|
||||
|
||||
/**
|
||||
* View data array for Blade templates
|
||||
*
|
||||
* @var array<string, mixed>
|
||||
*/
|
||||
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]);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class BooksController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request, string $id = '')
|
||||
public function index(Request $request, string $id = ''): mixed
|
||||
{
|
||||
$bookService = new BookService;
|
||||
|
||||
@@ -44,7 +44,7 @@ class BooksController extends BasePageController
|
||||
$books = [];
|
||||
$page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1;
|
||||
$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());
|
||||
$maxwords = 50;
|
||||
foreach ($results as $result) {
|
||||
|
||||
@@ -20,7 +20,7 @@ class BrowseController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): mixed
|
||||
{
|
||||
$ordering = $this->releaseBrowseService->getBrowseOrdering();
|
||||
$orderBy = $request->has('ob') && ! empty($request->input('ob')) ? $request->input('ob') : '';
|
||||
@@ -52,7 +52,7 @@ class BrowseController extends BasePageController
|
||||
/**
|
||||
* @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');
|
||||
@@ -158,7 +158,7 @@ class BrowseController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function group(Request $request)
|
||||
public function group(Request $request): mixed
|
||||
{
|
||||
if ($request->has('g')) {
|
||||
$group = $request->input('g');
|
||||
|
||||
@@ -10,7 +10,7 @@ class BrowseGroupController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function show(Request $request)
|
||||
public function show(Request $request): mixed
|
||||
{
|
||||
// Get the search term from the request
|
||||
$search = $request->get('search', '') ?? '';
|
||||
|
||||
@@ -13,10 +13,9 @@ class CartController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index()
|
||||
public function index(): mixed
|
||||
{
|
||||
$results = UsersRelease::getCart(Auth::id())
|
||||
/** @phpstan-ignore property.notFound */
|
||||
->filter(fn ($item) => $item->release !== null);
|
||||
|
||||
$this->viewData = array_merge($this->viewData, [
|
||||
@@ -65,6 +64,8 @@ class CartController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $id
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy(array|string $id): RedirectResponse
|
||||
|
||||
@@ -21,7 +21,7 @@ class ConsoleController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function show(Request $request, string $id = '')
|
||||
public function show(Request $request, string $id = ''): mixed
|
||||
{
|
||||
if ($id === 'WiiVare') {
|
||||
$id = 'WiiVareVC';
|
||||
@@ -55,7 +55,7 @@ class ConsoleController extends BasePageController
|
||||
$offset = ($page - 1) * config('nntmux.items_per_cover_page');
|
||||
|
||||
$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());
|
||||
|
||||
$maxwords = 50;
|
||||
|
||||
@@ -10,7 +10,7 @@ class ContactUsController extends BasePageController
|
||||
/**
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function contact(ContactContactURequest $request)
|
||||
public function contact(ContactContactURequest $request): mixed
|
||||
{
|
||||
|
||||
$msg = '';
|
||||
|
||||
@@ -79,8 +79,10 @@ class ContentController extends BasePageController
|
||||
|
||||
/**
|
||||
* 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()
|
||||
->orderByRaw('contenttype, COALESCE(ordinal, 1000000)')
|
||||
@@ -89,8 +91,10 @@ class ContentController extends BasePageController
|
||||
|
||||
/**
|
||||
* 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()
|
||||
->where('id', '<>', 1)
|
||||
@@ -111,8 +115,10 @@ class ContentController extends BasePageController
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class DetailsController extends BasePageController
|
||||
$this->releaseExtraService = $releaseExtraService;
|
||||
}
|
||||
|
||||
public function show(Request $request, string $guid)
|
||||
public function show(Request $request, string $guid): mixed
|
||||
{
|
||||
$data = Release::getByGuid($guid);
|
||||
$releaseRegex = '';
|
||||
|
||||
@@ -12,7 +12,7 @@ class GamesController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function show(Request $request)
|
||||
public function show(Request $request): mixed
|
||||
{
|
||||
$games = new GamesService;
|
||||
$gen = new GenreService;
|
||||
|
||||
@@ -206,13 +206,13 @@ class GetNzbController extends BasePageController
|
||||
return showApiError(501);
|
||||
}
|
||||
|
||||
$zip = getStreamingZip($guids);
|
||||
$zip = getStreamingZip($guids); // @phpstan-ignore argument.type
|
||||
if ($zip === '') { // @phpstan-ignore identical.alwaysFalse
|
||||
return response()->json(['message' => 'Unable to create .zip file'], 404);
|
||||
}
|
||||
|
||||
// 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()}");
|
||||
|
||||
@@ -221,6 +221,8 @@ class GetNzbController extends BasePageController
|
||||
|
||||
/**
|
||||
* Update statistics for zip downloads
|
||||
*
|
||||
* @param array<string, mixed> $guids
|
||||
*/
|
||||
private function updateZipDownloadStatistics(Request $request, int $uid, array $guids): void
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ class MovieController extends BasePageController
|
||||
/**
|
||||
* @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) {
|
||||
return ['id' => $mcat->id, 'title' => $mcat->title];
|
||||
@@ -102,7 +102,7 @@ class MovieController extends BasePageController
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function showMovie(Request $request, string $imdbid)
|
||||
public function showMovie(Request $request, string $imdbid): mixed
|
||||
{
|
||||
// Get movie info
|
||||
$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);
|
||||
|
||||
// Filter to only this movie's IMDB ID
|
||||
/** @phpstan-ignore argument.templateType */
|
||||
$movieData = collect($rslt)->firstWhere('imdbid', $imdbid);
|
||||
|
||||
if (! $movieData) {
|
||||
@@ -219,7 +220,7 @@ class MovieController extends BasePageController
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function showTrending(Request $request)
|
||||
public function showTrending(Request $request): mixed
|
||||
{
|
||||
|
||||
// Cache key for trending movies (48 hours)
|
||||
@@ -284,7 +285,7 @@ class MovieController extends BasePageController
|
||||
/**
|
||||
* Update user's movie layout preference
|
||||
*/
|
||||
public function updateLayout(Request $request)
|
||||
public function updateLayout(Request $request): mixed
|
||||
{
|
||||
$request->validate([
|
||||
'layout' => 'required|integer|in:1,2',
|
||||
|
||||
@@ -13,7 +13,7 @@ class MusicController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function show(Request $request, string $id = '')
|
||||
public function show(Request $request, string $id = ''): mixed
|
||||
{
|
||||
$music = new MusicService;
|
||||
$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') : '';
|
||||
|
||||
$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());
|
||||
|
||||
$artist = ($request->has('artist') && ! empty($request->input('artist'))) ? stripslashes($request->input('artist')) : '';
|
||||
|
||||
@@ -24,7 +24,7 @@ class MyMoviesController extends BasePageController
|
||||
$this->movieBrowseService = $movieBrowseService;
|
||||
}
|
||||
|
||||
public function show(Request $request)
|
||||
public function show(Request $request): mixed
|
||||
{
|
||||
$action = $request->input('id') ?? '';
|
||||
$imdbid = $request->input('imdb') ?? '';
|
||||
|
||||
@@ -19,7 +19,7 @@ class MyShowsController extends BasePageController
|
||||
$this->releaseBrowseService = $releaseBrowseService;
|
||||
}
|
||||
|
||||
public function show(Request $request)
|
||||
public function show(Request $request): mixed
|
||||
{
|
||||
$action = $request->input('action') ?? '';
|
||||
$videoId = $request->input('id') ?? '';
|
||||
@@ -167,7 +167,7 @@ class MyShowsController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function browse(Request $request)
|
||||
public function browse(Request $request): mixed
|
||||
{
|
||||
$title = 'Browse My Shows';
|
||||
$meta_title = 'My Shows';
|
||||
|
||||
@@ -11,7 +11,7 @@ class NfoController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function showNfo(Request $request, string $id = '')
|
||||
public function showNfo(Request $request, string $id = ''): mixed
|
||||
{
|
||||
if ($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
|
||||
* 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
|
||||
if (! $request->session()->has('2fa:user:id')) {
|
||||
|
||||
@@ -25,7 +25,7 @@ class ProfileController extends BasePageController
|
||||
/**
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function show(Request $request)
|
||||
public function show(Request $request): mixed
|
||||
{
|
||||
|
||||
$userID = $this->userdata->id;
|
||||
@@ -346,7 +346,7 @@ class ProfileController extends BasePageController
|
||||
/**
|
||||
* Update user's dark mode preference
|
||||
*/
|
||||
public function updateTheme(Request $request)
|
||||
public function updateTheme(Request $request): mixed
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class RssController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function showRssDesc()
|
||||
public function showRssDesc(): mixed
|
||||
{
|
||||
$rss = app(RSS::class);
|
||||
|
||||
@@ -120,7 +120,7 @@ class RssController extends BasePageController
|
||||
/**
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function cartRss(Request $request)
|
||||
public function cartRss(Request $request): mixed
|
||||
{
|
||||
$rss = app(RSS::class);
|
||||
$offset = 0;
|
||||
@@ -141,12 +141,14 @@ class RssController extends BasePageController
|
||||
|
||||
$relData = $rss->getRss([-2], $userShow, $userAnidb, $user['user_id'], $userAirDate, $userLimit, $userNum);
|
||||
$rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function categoryFeedRss(Request $request)
|
||||
public function categoryFeedRss(Request $request): mixed
|
||||
{
|
||||
$rss = app(RSS::class);
|
||||
$offset = 0;
|
||||
@@ -171,12 +173,19 @@ class RssController extends BasePageController
|
||||
$outputXML = (! ($request->has('o') && $request->input('o') === 'json'));
|
||||
$relData = $rss->getRss($categoryId, $userShow, $userAnidb, $user['user_id'], $userAirDate, $userLimit, $userNum);
|
||||
$rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
|
||||
|
||||
return null;
|
||||
|
||||
return null;
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function trendingMoviesRss(Request $request)
|
||||
public function trendingMoviesRss(Request $request): mixed
|
||||
{
|
||||
$rss = app(RSS::class);
|
||||
$offset = 0;
|
||||
@@ -189,12 +198,15 @@ class RssController extends BasePageController
|
||||
$relData = $rss->getTrendingMoviesRss();
|
||||
|
||||
$rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function trendingShowsRss(Request $request)
|
||||
public function trendingShowsRss(Request $request): mixed
|
||||
{
|
||||
$rss = app(RSS::class);
|
||||
$offset = 0;
|
||||
@@ -207,9 +219,14 @@ class RssController extends BasePageController
|
||||
$relData = $rss->getTrendingShowsRss();
|
||||
|
||||
$rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
private function userCheck(Request $request): JsonResponse|array
|
||||
|
||||
@@ -31,7 +31,7 @@ class SearchController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function search(Request $request)
|
||||
public function search(Request $request): mixed
|
||||
{
|
||||
|
||||
$results = [];
|
||||
@@ -94,7 +94,7 @@ class SearchController extends BasePageController
|
||||
-1,
|
||||
$this->userdata->categoryexclusions ?? [],
|
||||
'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());
|
||||
$category = $categoryID;
|
||||
@@ -199,7 +199,7 @@ class SearchController extends BasePageController
|
||||
-1,
|
||||
$this->userdata->categoryexclusions ?? [],
|
||||
'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());
|
||||
|
||||
@@ -23,7 +23,7 @@ class SeriesController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request, string $id = '')
|
||||
public function index(Request $request, string $id = ''): mixed
|
||||
{
|
||||
|
||||
if ($id && ctype_digit($id)) {
|
||||
@@ -40,7 +40,7 @@ class SeriesController extends BasePageController
|
||||
$page = max($page, 1);
|
||||
$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);
|
||||
|
||||
@@ -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.
|
||||
$episodeMeta = collect();
|
||||
/** @phpstan-ignore argument.templateType */
|
||||
$episodeIds = collect($rel)->pluck('tv_episodes_id')->filter(fn ($v) => $v > 0)->unique()->values();
|
||||
if ($episodeIds->isNotEmpty()) {
|
||||
$episodeMeta = TvEpisode::whereIn('id', $episodeIds)->get()->keyBy('id');
|
||||
@@ -303,7 +304,7 @@ class SeriesController extends BasePageController
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function showTrending(Request $request)
|
||||
public function showTrending(Request $request): mixed
|
||||
{
|
||||
// Cache key for trending TV shows (48 hours)
|
||||
$cacheKey = 'trending_tv_top_15_48h';
|
||||
|
||||
@@ -145,7 +145,7 @@ class ClearanceMiddleware
|
||||
*
|
||||
* @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 = [
|
||||
'movies' => 'view movies',
|
||||
@@ -184,7 +184,7 @@ class ClearanceMiddleware
|
||||
*
|
||||
* @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
|
||||
$rootCategory = RootCategory::query()
|
||||
|
||||
@@ -9,6 +9,8 @@ class LoginLoginRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
@@ -9,6 +9,8 @@ class RegisterRegisterRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ class ShowLinkRequestFormForgotPasswordRequest extends FormRequest
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
|
||||
@@ -9,6 +9,8 @@ class ContactContactURequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@ class Disable2faPasswordSecurityRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
@@ -14,16 +14,14 @@ class SendAccountWillExpireEmail implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
private $days;
|
||||
private int $days;
|
||||
|
||||
private $user;
|
||||
private \App\Models\User $user;
|
||||
|
||||
/**
|
||||
* 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->days = $days;
|
||||
|
||||
@@ -14,16 +14,16 @@ class SendContactUsEmail implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
private $email;
|
||||
private string $email;
|
||||
|
||||
private $mailTo;
|
||||
private string $mailTo;
|
||||
|
||||
private $mailBody;
|
||||
private string $mailBody;
|
||||
|
||||
/**
|
||||
* SendContactUsEmail constructor.
|
||||
*/
|
||||
public function __construct($email, $mailTo, $mailBody)
|
||||
public function __construct(string $email, string $mailTo, string $mailBody)
|
||||
{
|
||||
$this->email = $email;
|
||||
$this->mailTo = $mailTo;
|
||||
|
||||
@@ -14,19 +14,16 @@ class SendInviteEmail implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
private $email;
|
||||
private string $email;
|
||||
|
||||
private $url;
|
||||
private string $url;
|
||||
|
||||
/**
|
||||
* @var \App\Models\User
|
||||
*/
|
||||
private $user;
|
||||
private \App\Models\User $user;
|
||||
|
||||
/**
|
||||
* SendInviteEmail constructor.
|
||||
*/
|
||||
public function __construct($email, $user, $url)
|
||||
public function __construct(string $email, \App\Models\User $user, string $url)
|
||||
{
|
||||
$this->email = $email;
|
||||
$this->user = $user;
|
||||
|
||||
@@ -15,17 +15,14 @@ class SendPasswordForgottenEmail implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
private $resetLink;
|
||||
private string $resetLink;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
private $user;
|
||||
private User $user;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct(User $user, $resetLink)
|
||||
public function __construct(User $user, string $resetLink)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->resetLink = $resetLink;
|
||||
|
||||
@@ -28,7 +28,7 @@ class AccountDeleted extends Mailable
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct($user)
|
||||
public function __construct(mixed $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->siteEmail = config('mail.from.address');
|
||||
|
||||
@@ -10,16 +10,16 @@ class AccountExpired extends Mailable
|
||||
{
|
||||
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.
|
||||
*/
|
||||
public function __construct($user)
|
||||
public function __construct(\App\Models\User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->siteEmail = config('mail.from.address');
|
||||
|
||||
@@ -10,26 +10,18 @@ class AccountWillExpire extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
private $days;
|
||||
private int $days;
|
||||
|
||||
private $user;
|
||||
private \App\Models\User $user;
|
||||
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
private $siteEmail;
|
||||
private mixed $siteEmail;
|
||||
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
private $siteTitle;
|
||||
private mixed $siteTitle;
|
||||
|
||||
/**
|
||||
* 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->days = $days;
|
||||
|
||||
@@ -19,7 +19,7 @@ class ContactUs extends Mailable
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct($mailTo, $mailFrom, $mailBody)
|
||||
public function __construct(mixed $mailTo, mixed $mailFrom, mixed $mailBody)
|
||||
{
|
||||
$this->mailTo = $mailTo;
|
||||
$this->mailFrom = $mailFrom;
|
||||
|
||||
@@ -10,24 +10,18 @@ class ForgottenPassword extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public $user;
|
||||
public mixed $user;
|
||||
|
||||
public $resetLink;
|
||||
public string $resetLink;
|
||||
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
private $siteEmail;
|
||||
private mixed $siteEmail;
|
||||
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
private $siteTitle;
|
||||
private mixed $siteTitle;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct($resetLink)
|
||||
public function __construct(string $resetLink)
|
||||
{
|
||||
$this->resetLink = $resetLink;
|
||||
$this->siteEmail = config('mail.from.address');
|
||||
|
||||
@@ -30,7 +30,7 @@ class NewAccountCreatedEmail extends Mailable
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($user)
|
||||
public function __construct(mixed $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->siteEmail = config('mail.from.address');
|
||||
|
||||
@@ -34,7 +34,7 @@ class PasswordReset extends Mailable
|
||||
/**
|
||||
* PasswordReset constructor.
|
||||
*/
|
||||
public function __construct(User $user, $newPass)
|
||||
public function __construct(User $user, mixed $newPass)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->newPass = $newPass;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user