Skip to content

Commit 29da25d

Browse files
committed
Apply fixes from StyleCI
1 parent b94c6f9 commit 29da25d

File tree

24 files changed

+117
-115
lines changed

24 files changed

+117
-115
lines changed

extensions/akismet/src/Akismet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function sendRequest(string $type): ResponseInterface
5050
$client = new Client();
5151

5252
return $client->request('POST', "$this->apiUrl/$type", [
53-
'headers' => [
53+
'headers' => [
5454
'User-Agent' => "Flarum/$this->flarumVersion | Akismet/$this->extensionVersion",
5555
],
5656
'form_params' => $this->params,

extensions/flags/src/AddCanFlagAttribute.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ protected function checkFlagOwnPostSetting(User $actor, Post $post): bool
4040
// If $actor is the post author, check to see if the setting is enabled
4141
return (bool) $this->settings->get('flarum-flags.can_flag_own');
4242
}
43+
4344
// $actor is not the post author
4445
return true;
4546
}

extensions/flags/src/Api/Serializer/FlagSerializer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ protected function getDefaultAttributes($flag)
3131
}
3232

3333
return [
34-
'type' => $flag->type,
35-
'reason' => $flag->reason,
34+
'type' => $flag->type,
35+
'reason' => $flag->reason,
3636
'reasonDetail' => $flag->reason_detail,
37-
'createdAt' => $this->formatDate($flag->created_at),
37+
'createdAt' => $this->formatDate($flag->created_at),
3838
];
3939
}
4040

extensions/tags/src/Api/Serializer/TagSerializer.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ protected function getDefaultAttributes($tag)
4747
}
4848

4949
$attributes = [
50-
'name' => $tag->name,
51-
'description' => $tag->description,
52-
'slug' => $this->slugManager->forResource(Tag::class)->toSlug($tag),
53-
'color' => $tag->color,
54-
'backgroundUrl' => $tag->background_path,
55-
'backgroundMode' => $tag->background_mode,
56-
'icon' => $tag->icon,
57-
'discussionCount' => (int) $tag->discussion_count,
58-
'position' => $tag->position === null ? null : (int) $tag->position,
59-
'defaultSort' => $tag->default_sort,
60-
'isChild' => (bool) $tag->parent_id,
61-
'isHidden' => (bool) $tag->is_hidden,
62-
'lastPostedAt' => $this->formatDate($tag->last_posted_at),
50+
'name' => $tag->name,
51+
'description' => $tag->description,
52+
'slug' => $this->slugManager->forResource(Tag::class)->toSlug($tag),
53+
'color' => $tag->color,
54+
'backgroundUrl' => $tag->background_path,
55+
'backgroundMode' => $tag->background_mode,
56+
'icon' => $tag->icon,
57+
'discussionCount' => (int) $tag->discussion_count,
58+
'position' => $tag->position === null ? null : (int) $tag->position,
59+
'defaultSort' => $tag->default_sort,
60+
'isChild' => (bool) $tag->parent_id,
61+
'isHidden' => (bool) $tag->is_hidden,
62+
'lastPostedAt' => $this->formatDate($tag->last_posted_at),
6363
'canStartDiscussion' => $this->actor->can('startDiscussion', $tag),
6464
'canAddToDiscussion' => $this->actor->can('addToDiscussion', $tag)
6565
];

extensions/tags/tests/integration/RetrievesRepresentativeTags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected function tags()
2727
['id' => 11, 'name' => 'Secondary Restricted', 'slug' => 'secondary-restricted', 'position' => null, 'parent_id' => null, 'is_restricted' => true],
2828
['id' => 12, 'name' => 'Primary Restricted 2', 'slug' => 'primary-2-restricted', 'position' => 100, 'parent_id' => null, 'is_restricted' => true],
2929
['id' => 13, 'name' => 'Primary Restricted 2 Child 1', 'slug' => 'primary-2-restricted-child-1', 'position' => 101, 'parent_id' => 12],
30-
['id' => 14, 'name' => 'Primary Restricted 3', 'slug' => 'primary-3-restricted', 'position' => 102, 'parent_id' =>null, 'is_restricted' => true],
30+
['id' => 14, 'name' => 'Primary Restricted 3', 'slug' => 'primary-3-restricted', 'position' => 102, 'parent_id' => null, 'is_restricted' => true],
3131
];
3232
}
3333
}

framework/core/src/Api/Serializer/BasicDiscussionSerializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function getDefaultAttributes($discussion)
4646

4747
return [
4848
'title' => $discussion->title,
49-
'slug' => $this->slugManager->forResource(Discussion::class)->toSlug($discussion),
49+
'slug' => $this->slugManager->forResource(Discussion::class)->toSlug($discussion),
5050
];
5151
}
5252

framework/core/src/Api/Serializer/BasicPostSerializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ protected function getDefaultAttributes($post)
5353
}
5454

5555
$attributes = [
56-
'number' => (int) $post->number,
57-
'createdAt' => $this->formatDate($post->created_at),
56+
'number' => (int) $post->number,
57+
'createdAt' => $this->formatDate($post->created_at),
5858
'contentType' => $post->type
5959
];
6060

framework/core/src/Api/Serializer/BasicUserSerializer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ protected function getDefaultAttributes($user)
4545
}
4646

4747
return [
48-
'username' => $user->username,
48+
'username' => $user->username,
4949
'displayName' => $user->display_name,
50-
'avatarUrl' => $user->avatar_url,
51-
'slug' => $this->slugManager->forResource(User::class)->toSlug($user)
50+
'avatarUrl' => $user->avatar_url,
51+
'slug' => $this->slugManager->forResource(User::class)->toSlug($user)
5252
];
5353
}
5454

framework/core/src/Api/Serializer/CurrentUserSerializer.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ protected function getDefaultAttributes($user)
2020
$attributes = parent::getDefaultAttributes($user);
2121

2222
$attributes += [
23-
'isEmailConfirmed' => (bool) $user->is_email_confirmed,
24-
'email' => $user->email,
25-
'markedAllAsReadAt' => $this->formatDate($user->marked_all_as_read_at),
26-
'unreadNotificationCount' => (int) $user->getUnreadNotificationCount(),
27-
'newNotificationCount' => (int) $user->getNewNotificationCount(),
28-
'preferences' => (array) $user->preferences,
29-
'isAdmin' => $user->isAdmin(),
23+
'isEmailConfirmed' => (bool) $user->is_email_confirmed,
24+
'email' => $user->email,
25+
'markedAllAsReadAt' => $this->formatDate($user->marked_all_as_read_at),
26+
'unreadNotificationCount' => (int) $user->getUnreadNotificationCount(),
27+
'newNotificationCount' => (int) $user->getNewNotificationCount(),
28+
'preferences' => (array) $user->preferences,
29+
'isAdmin' => $user->isAdmin(),
3030
];
3131

3232
return $attributes;

framework/core/src/Api/Serializer/DiscussionSerializer.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ class DiscussionSerializer extends BasicDiscussionSerializer
1919
protected function getDefaultAttributes($discussion)
2020
{
2121
$attributes = parent::getDefaultAttributes($discussion) + [
22-
'commentCount' => (int) $discussion->comment_count,
23-
'participantCount' => (int) $discussion->participant_count,
24-
'createdAt' => $this->formatDate($discussion->created_at),
25-
'lastPostedAt' => $this->formatDate($discussion->last_posted_at),
26-
'lastPostNumber' => (int) $discussion->last_post_number,
27-
'canReply' => $this->actor->can('reply', $discussion),
28-
'canRename' => $this->actor->can('rename', $discussion),
29-
'canDelete' => $this->actor->can('delete', $discussion),
30-
'canHide' => $this->actor->can('hide', $discussion)
22+
'commentCount' => (int) $discussion->comment_count,
23+
'participantCount' => (int) $discussion->participant_count,
24+
'createdAt' => $this->formatDate($discussion->created_at),
25+
'lastPostedAt' => $this->formatDate($discussion->last_posted_at),
26+
'lastPostNumber' => (int) $discussion->last_post_number,
27+
'canReply' => $this->actor->can('reply', $discussion),
28+
'canRename' => $this->actor->can('rename', $discussion),
29+
'canDelete' => $this->actor->can('delete', $discussion),
30+
'canHide' => $this->actor->can('hide', $discussion)
3131
];
3232

3333
if ($discussion->hidden_at) {

0 commit comments

Comments
 (0)