From e0073e0de4ba4ac4b59b82cb054535d1cb6b15a3 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 20 Sep 2026 02:35:39 -0600 Subject: [PATCH] Fix typos and Lint --- app/Http/Controllers/Admin/AdminAutospamController.php | 2 ++ app/Http/Controllers/AdminController.php | 4 ++++ app/Http/Controllers/AvatarController.php | 5 +++-- app/Http/Controllers/ComposeController.php | 3 +++ app/Http/Controllers/Groups/GroupsAdminController.php | 1 + app/Http/Controllers/Groups/GroupsSearchController.php | 9 ++++----- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Admin/AdminAutospamController.php b/app/Http/Controllers/Admin/AdminAutospamController.php index f4e2a376e..80d8a11ab 100644 --- a/app/Http/Controllers/Admin/AdminAutospamController.php +++ b/app/Http/Controllers/Admin/AdminAutospamController.php @@ -47,11 +47,13 @@ trait AdminAutospamController ->groupBy($gb) ->get() ->map(function ($s) { + // @phpstan-ignore-next-line $dt = now()->parse('01-'.$s->month_year); return [ 'id' => $dt->format('Ym'), 'x' => $dt->format('M Y'), + // @phpstan-ignore-next-line 'y' => $s->count, ]; }) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 2c4016ce6..0381f4bdc 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -460,10 +460,12 @@ class AdminController extends Controller foreach ($fields as $field => $type) { switch ($type) { case 'string': + // @phpstan-ignore-next-line if ($request->{$field} != $news->{$field}) { if ($field === 'title') { $news->slug = $slug; } + // @phpstan-ignore-next-line $news->{$field} = $request->{$field}; $changed = true; array_push($changedFields, $field); @@ -472,7 +474,9 @@ class AdminController extends Controller case 'boolean': $state = $request->{$field} == 'on' ? true : false; + // @phpstan-ignore-next-line if ($state != $news->{$field}) { + // @phpstan-ignore-next-line $news->{$field} = $state; $changed = true; array_push($changedFields, $field); diff --git a/app/Http/Controllers/AvatarController.php b/app/Http/Controllers/AvatarController.php index 78ec9de33..946747be7 100644 --- a/app/Http/Controllers/AvatarController.php +++ b/app/Http/Controllers/AvatarController.php @@ -35,7 +35,7 @@ class AvatarController extends Controller $loc = $request->file('avatar')->storePubliclyAs($public, $name); $avatar = Avatar::firstOrNew(['profile_id' => $profile->id]); - $currentAvatar = $avatar->recentlyCreated ? null : storage_path('app/'.$profile->avatar->media_path); + $currentAvatar = $avatar->wasRecentlyCreated ? null : storage_path('app/'.$profile->avatar->media_path); $avatar->media_path = "$public/$name"; $avatar->change_count = ++$avatar->change_count; $avatar->last_processed_at = null; @@ -130,7 +130,8 @@ class AvatarController extends Controller $avatar = $profile->avatar; - if ($avatar->media_path == 'public/avatars/default.png' || + if ( + $avatar->media_path == 'public/avatars/default.png' || $avatar->media_path == 'public/avatars/default.jpg' ) { return response()->json(200); diff --git a/app/Http/Controllers/ComposeController.php b/app/Http/Controllers/ComposeController.php index 8da45ed05..681351b45 100644 --- a/app/Http/Controllers/ComposeController.php +++ b/app/Http/Controllers/ComposeController.php @@ -369,6 +369,7 @@ class ComposeController extends Controller ->map(function ($place) { return [ 'id' => $place->place_id, + // @phpstan-ignore-next-line 'count' => $place->pc, ]; }) @@ -390,6 +391,7 @@ class ComposeController extends Controller ->map(function ($place) { return [ 'id' => $place->place_id, + // @phpstan-ignore-next-line 'count' => $place->pc, ]; }); @@ -485,6 +487,7 @@ class ComposeController extends Controller return [ 'key' => '@'.Str::limit($username, 30), 'value' => $username, + // @phpstan-ignore-next-line 'is_followed' => (bool) $profile->is_followed, ]; }); diff --git a/app/Http/Controllers/Groups/GroupsAdminController.php b/app/Http/Controllers/Groups/GroupsAdminController.php index 4c273d1ac..f642e742a 100644 --- a/app/Http/Controllers/Groups/GroupsAdminController.php +++ b/app/Http/Controllers/Groups/GroupsAdminController.php @@ -331,6 +331,7 @@ class GroupsAdminController extends Controller 'profile' => GroupAccountService::get($group->id, $report->profile_id), 'type' => $report->type, 'created_at' => $report->created_at->format('c'), + // @phpstan-ignore-next-line 'total_count' => $report->total, ]; diff --git a/app/Http/Controllers/Groups/GroupsSearchController.php b/app/Http/Controllers/Groups/GroupsSearchController.php index 3d88e67c4..262034f2c 100644 --- a/app/Http/Controllers/Groups/GroupsSearchController.php +++ b/app/Http/Controllers/Groups/GroupsSearchController.php @@ -98,19 +98,19 @@ class GroupsSearchController extends Controller ->take(10) ->get() ->filter(function ($p) use ($group) { - return $group->isMember($p->profile_id) == false; + return $group->isMember($p->id) == false; }) ->filter(function ($p) use ($group, $pid) { return GroupInvitation::whereGroupId($group->id) ->whereFromProfileId($pid) - ->whereToProfileId($p->profile_id) + ->whereToProfileId($p->id) ->exists() == false; }) ->map(function ($gm) use ($gid) { - $a = AccountService::get($gm->profile_id); + $a = AccountService::get($gm->id); return [ - 'id' => (string) $gm->profile_id, + 'id' => (string) $gm->id, 'username' => $a['acct'], 'url' => url("/groups/{$gid}/user/{$a['id']}?rf=group_search"), ]; @@ -132,7 +132,6 @@ class GroupsSearchController extends Controller if (str_starts_with($q, 'https://')) { $res = Helpers::getSignedFetch($q); if ($res && $res = json_decode($res, true)) { - } if ($res && isset($res['type']) && in_array($res['type'], ['Group', 'Note', 'Page'])) { if ($res['type'] === 'Group') {