From 36528d3089837117129c9ca920ad5163ef4d6d41 Mon Sep 17 00:00:00 2001 From: Jay Sizzla Date: Sun, 22 Dec 2024 11:52:03 +0000 Subject: [PATCH] Fix larastan error --- app/Http/Controllers/API/TorrentController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/Http/Controllers/API/TorrentController.php b/app/Http/Controllers/API/TorrentController.php index 830ac1aab6..94f3b97dfa 100644 --- a/app/Http/Controllers/API/TorrentController.php +++ b/app/Http/Controllers/API/TorrentController.php @@ -166,21 +166,35 @@ public function store(Request $request): \Illuminate\Http\JsonResponse $torrent->stream = $request->input('stream'); $torrent->sd = $request->input('sd'); $torrent->personal_release = $request->input('personal_release') ?? 0; + + /** @phpstan-ignore property.notFound (Larastan doesn't yet support loadExists()) */ $torrent->internal = $user->group->is_modo || $user->internals_exists ? ($request->input('internal') ?? 0) : 0; + + /** @phpstan-ignore property.notFound (Larastan doesn't yet support loadExists()) */ $torrent->featured = $user->group->is_modo || $user->internals_exists ? ($request->input('featured') ?? false) : false; + + /** @phpstan-ignore property.notFound (Larastan doesn't yet support loadExists()) */ $torrent->doubleup = $user->group->is_modo || $user->internals_exists ? ($request->input('doubleup') ?? 0) : 0; + + /** @phpstan-ignore property.notFound (Larastan doesn't yet support loadExists()) */ $torrent->refundable = $user->group->is_modo || $user->internals_exists ? ($request->input('refundable') ?? false) : false; $du_until = $request->input('du_until'); + /** @phpstan-ignore property.notFound (Larastan doesn't yet support loadExists()) */ if (($user->group->is_modo || $user->internals_exists) && isset($du_until)) { $torrent->du_until = Carbon::now()->addDays($request->integer('du_until')); } + + /** @phpstan-ignore property.notFound (Larastan doesn't yet support loadExists()) */ $torrent->free = $user->group->is_modo || $user->internals_exists ? ($request->input('free') ?? 0) : 0; $fl_until = $request->input('fl_until'); + /** @phpstan-ignore property.notFound (Larastan doesn't yet support loadExists()) */ if (($user->group->is_modo || $user->internals_exists) && isset($fl_until)) { $torrent->fl_until = Carbon::now()->addDays($request->integer('fl_until')); } + + /** @phpstan-ignore property.notFound (Larastan doesn't yet support loadExists()) */ $torrent->sticky = $user->group->is_modo || $user->internals_exists ? ($request->input('sticky') ?? 0) : 0; $torrent->moderated_at = Carbon::now(); $torrent->moderated_by = User::SYSTEM_USER_ID;