1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2024-01-09 15:06:12 +00:00
parent 74ce4cf1a7
commit 5399c86a1b
25 changed files with 118 additions and 116 deletions

View File

@@ -47,7 +47,7 @@ class Akismet
$client = new Client();
return $client->request('POST', "$this->apiUrl/$type", [
'headers' => [
'headers' => [
'User-Agent' => "Flarum/$this->flarumVersion | Akismet/$this->extensionVersion",
],
'form_params' => $this->params,

View File

@@ -32,6 +32,7 @@ class AddCanFlagAttribute
// If $actor is the post author, check to see if the setting is enabled
return (bool) $this->settings->get('flarum-flags.can_flag_own');
}
// $actor is not the post author
return true;
}

View File

@@ -29,10 +29,10 @@ class FlagSerializer extends AbstractSerializer
}
return [
'type' => $model->type,
'reason' => $model->reason,
'type' => $model->type,
'reason' => $model->reason,
'reasonDetail' => $model->reason_detail,
'createdAt' => $this->formatDate($model->created_at),
'createdAt' => $this->formatDate($model->created_at),
];
}

View File

@@ -34,19 +34,19 @@ class TagSerializer extends AbstractSerializer
}
$attributes = [
'name' => $model->name,
'description' => $model->description,
'slug' => $this->slugManager->forResource(Tag::class)->toSlug($model),
'color' => $model->color,
'backgroundUrl' => $model->background_path,
'backgroundMode' => $model->background_mode,
'icon' => $model->icon,
'discussionCount' => (int) $model->discussion_count,
'position' => $model->position === null ? null : (int) $model->position,
'defaultSort' => $model->default_sort,
'isChild' => (bool) $model->parent_id,
'isHidden' => (bool) $model->is_hidden,
'lastPostedAt' => $this->formatDate($model->last_posted_at),
'name' => $model->name,
'description' => $model->description,
'slug' => $this->slugManager->forResource(Tag::class)->toSlug($model),
'color' => $model->color,
'backgroundUrl' => $model->background_path,
'backgroundMode' => $model->background_mode,
'icon' => $model->icon,
'discussionCount' => (int) $model->discussion_count,
'position' => $model->position === null ? null : (int) $model->position,
'defaultSort' => $model->default_sort,
'isChild' => (bool) $model->parent_id,
'isHidden' => (bool) $model->is_hidden,
'lastPostedAt' => $this->formatDate($model->last_posted_at),
'canStartDiscussion' => $this->actor->can('startDiscussion', $model),
'canAddToDiscussion' => $this->actor->can('addToDiscussion', $model)
];

View File

@@ -27,7 +27,7 @@ trait RetrievesRepresentativeTags
['id' => 11, 'name' => 'Secondary Restricted', 'slug' => 'secondary-restricted', 'position' => null, 'parent_id' => null, 'is_restricted' => true],
['id' => 12, 'name' => 'Primary Restricted 2', 'slug' => 'primary-2-restricted', 'position' => 100, 'parent_id' => null, 'is_restricted' => true],
['id' => 13, 'name' => 'Primary Restricted 2 Child 1', 'slug' => 'primary-2-restricted-child-1', 'position' => 101, 'parent_id' => 12],
['id' => 14, 'name' => 'Primary Restricted 3', 'slug' => 'primary-3-restricted', 'position' => 102, 'parent_id' =>null, 'is_restricted' => true],
['id' => 14, 'name' => 'Primary Restricted 3', 'slug' => 'primary-3-restricted', 'position' => 102, 'parent_id' => null, 'is_restricted' => true],
];
}
}