mirror of
https://github.com/flarum/core.git
synced 2025-08-07 17:07:19 +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:
@@ -19,7 +19,7 @@ class SaveLikesToDatabase
|
||||
/**
|
||||
* @param Saving $event
|
||||
*/
|
||||
public function whenPostIsSaving(Saving $event)
|
||||
public static function whenPostIsSaving(Saving $event)
|
||||
{
|
||||
$post = $event->post;
|
||||
$data = $event->data;
|
||||
@@ -47,7 +47,7 @@ class SaveLikesToDatabase
|
||||
/**
|
||||
* @param Deleted $event
|
||||
*/
|
||||
public function whenPostIsDeleted(Deleted $event)
|
||||
public static function whenPostIsDeleted(Deleted $event)
|
||||
{
|
||||
$event->post->likes()->detach();
|
||||
}
|
||||
|
Reference in New Issue
Block a user