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:
@@ -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();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user