From 52043a97824a72599cda8e68351569d4adc3bbcc Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Wed, 18 Oct 2023 12:52:21 +0100 Subject: [PATCH] fix: phpstan --- framework/core/src/Discussion/Discussion.php | 4 ++-- framework/core/src/Search/Listener/ModelObserver.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/core/src/Discussion/Discussion.php b/framework/core/src/Discussion/Discussion.php index 377bd732b3..4ec7d2b526 100644 --- a/framework/core/src/Discussion/Discussion.php +++ b/framework/core/src/Discussion/Discussion.php @@ -147,7 +147,7 @@ public function hide(?User $actor = null): static $this->raise(new Hidden($this)); $this->afterSave(function () { - $this->fireCustomModelEvent('hidden', false); + $this->fireModelEvent('hidden', false); }); } @@ -163,7 +163,7 @@ public function restore(): static $this->raise(new Restored($this)); $this->afterSave(function () { - $this->fireCustomModelEvent('restored', false); + $this->fireModelEvent('restored', false); }); } diff --git a/framework/core/src/Search/Listener/ModelObserver.php b/framework/core/src/Search/Listener/ModelObserver.php index 525b1f3f1e..b47acbb008 100644 --- a/framework/core/src/Search/Listener/ModelObserver.php +++ b/framework/core/src/Search/Listener/ModelObserver.php @@ -55,7 +55,7 @@ public function restored(AbstractModel $model): void private function runIndexJob(AbstractModel $model, string $operation): void { if ($this->search->indexable($model)) { - foreach ($this->search->indexers($model) as $indexerClass) { + foreach ($this->search->indexers($model::class) as $indexerClass) { $queue = property_exists($indexerClass, 'queue') ? $indexerClass::$queue : null; $this->queue->pushOn($queue, new IndexJob($indexerClass, [$model], $operation));