mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 05:18:14 +08: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:
parent
d2284d9de1
commit
a6cae387d7
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user