1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 09:26:34 +02:00

Make listener methods static

This is needed since we're listening to the individual methods of the class, as opposed to registering the class as a subscriber.
This commit is contained in:
Alexander Skvortsov
2020-12-10 23:35:42 -05:00
parent d2284d9de1
commit a6cae387d7

View File

@@ -19,7 +19,7 @@ class SaveLikesToDatabase
/** /**
* @param Saving $event * @param Saving $event
*/ */
public function whenPostIsSaving(Saving $event) public static function whenPostIsSaving(Saving $event)
{ {
$post = $event->post; $post = $event->post;
$data = $event->data; $data = $event->data;
@@ -47,7 +47,7 @@ class SaveLikesToDatabase
/** /**
* @param Deleted $event * @param Deleted $event
*/ */
public function whenPostIsDeleted(Deleted $event) public static function whenPostIsDeleted(Deleted $event)
{ {
$event->post->likes()->detach(); $event->post->likes()->detach();
} }