Fix typos and Lint

pull/7387/head
Daniel Supernault 3 days ago
parent 5d00f2e69b
commit e0073e0de4
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -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,
];
})

@ -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);

@ -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);

@ -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,
];
});

@ -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,
];

@ -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') {

Loading…
Cancel
Save