From f27c5e97dd01598c8a9767cc5689d22b68aeedb1 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 18 Oct 2023 15:11:23 +0000 Subject: [PATCH] Apply fixes from StyleCI --- framework/core/src/Post/CommentPost.php | 6 ++--- .../integration/extenders/SearchIndexTest.php | 24 ++++++------------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/framework/core/src/Post/CommentPost.php b/framework/core/src/Post/CommentPost.php index b5d9066aab..c93216f65a 100644 --- a/framework/core/src/Post/CommentPost.php +++ b/framework/core/src/Post/CommentPost.php @@ -91,9 +91,9 @@ public function restore(): static $this->raise(new Restored($this)); $this->saved(function (self $model) { - if ($model === $this) { - $model->fireModelEvent('restored', false); - } + if ($model === $this) { + $model->fireModelEvent('restored', false); + } }); } diff --git a/framework/core/tests/integration/extenders/SearchIndexTest.php b/framework/core/tests/integration/extenders/SearchIndexTest.php index acbb3ead43..0ceccaa471 100644 --- a/framework/core/tests/integration/extenders/SearchIndexTest.php +++ b/framework/core/tests/integration/extenders/SearchIndexTest.php @@ -11,20 +11,11 @@ use Carbon\Carbon; use Flarum\Discussion\Discussion; -use Flarum\Discussion\Search\DiscussionSearcher; use Flarum\Extend; use Flarum\Post\CommentPost; -use Flarum\Search\AbstractFulltextFilter; -use Flarum\Search\Database\DatabaseSearchDriver; -use Flarum\Search\Database\DatabaseSearchState; -use Flarum\Search\Filter\FilterInterface; use Flarum\Search\IndexerInterface; -use Flarum\Search\SearchCriteria; -use Flarum\Search\SearchManager; -use Flarum\Search\SearchState; use Flarum\Testing\integration\RetrievesAuthorizedUsers; use Flarum\Testing\integration\TestCase; -use Flarum\User\User; use PHPUnit\Framework\Assert; class SearchIndexTest extends TestCase @@ -72,15 +63,14 @@ public function test_indexer_triggered_on_create(string $type, string $modelClas 'attributes' => [ $attribute => 'test', ], - 'relationships' => - ($type === 'posts' ? [ - 'discussion' => [ - 'data' => [ - 'type' => 'discussions', - 'id' => 1, - ], + 'relationships' => ($type === 'posts' ? [ + 'discussion' => [ + 'data' => [ + 'type' => 'discussions', + 'id' => 1, ], - ] : null), + ], + ] : null), ] ], ]),