Skip to content

Commit 23c05cf

Browse files
committed
Apply fixes from StyleCI
1 parent 9e7a897 commit 23c05cf

File tree

106 files changed

+150
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+150
-150
lines changed

extensions/likes/tests/integration/api/LikePostTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function rewriteDefaultPermissionsAfterBoot()
6060
* @dataProvider allowedUsersToLike
6161
* @test
6262
*/
63-
public function can_like_a_post_if_allowed(int $postId, ?int $authenticatedAs, string $message, bool $canLikeOwnPost = null)
63+
public function can_like_a_post_if_allowed(int $postId, ?int $authenticatedAs, string $message, ?bool $canLikeOwnPost = null)
6464
{
6565
if (! is_null($canLikeOwnPost)) {
6666
$this->setting('flarum-likes.like_own_post', $canLikeOwnPost);
@@ -80,7 +80,7 @@ public function can_like_a_post_if_allowed(int $postId, ?int $authenticatedAs, s
8080
* @dataProvider unallowedUsersToLike
8181
* @test
8282
*/
83-
public function cannot_like_a_post_if_not_allowed(int $postId, ?int $authenticatedAs, string $message, bool $canLikeOwnPost = null)
83+
public function cannot_like_a_post_if_not_allowed(int $postId, ?int $authenticatedAs, string $message, ?bool $canLikeOwnPost = null)
8484
{
8585
if (! is_null($canLikeOwnPost)) {
8686
$this->setting('flarum-likes.like_own_post', $canLikeOwnPost);
@@ -100,7 +100,7 @@ public function cannot_like_a_post_if_not_allowed(int $postId, ?int $authenticat
100100
* @dataProvider allowedUsersToLike
101101
* @test
102102
*/
103-
public function can_dislike_a_post_if_liked_and_allowed(int $postId, ?int $authenticatedAs, string $message, bool $canLikeOwnPost = null)
103+
public function can_dislike_a_post_if_liked_and_allowed(int $postId, ?int $authenticatedAs, string $message, ?bool $canLikeOwnPost = null)
104104
{
105105
if (! is_null($canLikeOwnPost)) {
106106
$this->setting('flarum-likes.like_own_post', $canLikeOwnPost);

extensions/lock/src/Post/DiscussionLockedPost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DiscussionLockedPost extends AbstractEventPost implements MergeableInterfa
2424
/**
2525
* {@inheritdoc}
2626
*/
27-
public function saveAfter(Post $previous = null)
27+
public function saveAfter(?Post $previous = null)
2828
{
2929
// If the previous post is another 'discussion locked' post, and it's
3030
// by the same user, then we can merge this post into it. If we find

extensions/mentions/src/Formatter/FormatPostMentions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(TranslatorInterface $translator, SlugManager $slugMa
4444
* @param \Psr\Http\Message\ServerRequestInterface|null $request
4545
* @return string $xml to be rendered
4646
*/
47-
public function __invoke(Renderer $renderer, $context, $xml, Request $request = null)
47+
public function __invoke(Renderer $renderer, $context, $xml, ?Request $request = null)
4848
{
4949
return Utils::replaceAttributes($xml, 'POSTMENTION', function ($attributes) use ($context) {
5050
$post = (($context && isset($context->getRelations()['mentionsPosts'])) || $context instanceof Post)

extensions/mentions/src/Formatter/FormatTagMentions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class FormatTagMentions
1919
{
20-
public function __invoke(Renderer $renderer, $context, ?string $xml, Request $request = null): string
20+
public function __invoke(Renderer $renderer, $context, ?string $xml, ?Request $request = null): string
2121
{
2222
return Utils::replaceAttributes($xml, 'TAGMENTION', function ($attributes) use ($context) {
2323
/** @var Tag|null $tag */

extensions/package-manager/src/Task/TaskRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function query()
2727
* @param User $actor
2828
* @return Task
2929
*/
30-
public function findOrFail($id, User $actor = null): Task
30+
public function findOrFail($id, ?User $actor = null): Task
3131
{
3232
return Task::findOrFail($id);
3333
}

extensions/package-manager/tests/integration/SetupComposer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SetupComposer
1717

1818
private $config;
1919

20-
public function __construct(array $config = null)
20+
public function __construct(?array $config = null)
2121
{
2222
$this->config = $config;
2323
}

extensions/sticky/src/Post/DiscussionStickiedPost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DiscussionStickiedPost extends AbstractEventPost implements MergeableInter
2424
/**
2525
* {@inheritdoc}
2626
*/
27-
public function saveAfter(Post $previous = null)
27+
public function saveAfter(?Post $previous = null)
2828
{
2929
// If the previous post is another 'discussion stickied' post, and it's
3030
// by the same user, then we can merge this post into it. If we find

extensions/tags/src/Post/DiscussionTaggedPost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DiscussionTaggedPost extends AbstractEventPost implements MergeableInterfa
2424
/**
2525
* {@inheritdoc}
2626
*/
27-
public function saveAfter(Post $previous = null)
27+
public function saveAfter(?Post $previous = null)
2828
{
2929
// If the previous post is another 'discussion tagged' post, and it's
3030
// by the same user, then we can merge this post into it. If we find

extensions/tags/src/Tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function refreshLastPostedDiscussion()
137137
return $this;
138138
}
139139

140-
public function setLastPostedDiscussion(Discussion $discussion = null)
140+
public function setLastPostedDiscussion(?Discussion $discussion = null)
141141
{
142142
$this->last_posted_at = optional($discussion)->last_posted_at;
143143
$this->last_posted_discussion_id = optional($discussion)->id;

extensions/tags/src/TagRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function getAuthorizedRelations($relations, User $actor): array
7878
* @param User|null $actor
7979
* @return Tag
8080
*/
81-
public function findOrFail($id, User $actor = null)
81+
public function findOrFail($id, ?User $actor = null)
8282
{
8383
$query = Tag::where('id', $id);
8484

@@ -92,7 +92,7 @@ public function findOrFail($id, User $actor = null)
9292
* @param User|null $user
9393
* @return \Illuminate\Database\Eloquent\Collection<Tag>
9494
*/
95-
public function all(User $user = null)
95+
public function all(?User $user = null)
9696
{
9797
$query = Tag::query();
9898

@@ -106,7 +106,7 @@ public function all(User $user = null)
106106
* @param User|null $user
107107
* @return int
108108
*/
109-
public function getIdForSlug($slug, User $user = null): ?int
109+
public function getIdForSlug($slug, ?User $user = null): ?int
110110
{
111111
$query = Tag::where('slug', $slug);
112112

0 commit comments

Comments
 (0)