mirror of
https://github.com/flarum/framework.git
synced 2024-11-23 10:50:50 +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
d2d7b3026e
commit
787bbc0f33
|
@ -17,7 +17,7 @@ class ApproveContent
|
|||
/**
|
||||
* @param Saving $event
|
||||
*/
|
||||
public function approvePost(Saving $event)
|
||||
public static function approvePost(Saving $event)
|
||||
{
|
||||
$attributes = $event->data['attributes'];
|
||||
$post = $event->post;
|
||||
|
@ -40,7 +40,7 @@ class ApproveContent
|
|||
/**
|
||||
* @param PostWasApproved $event
|
||||
*/
|
||||
public function approveDiscussion(PostWasApproved $event)
|
||||
public static function approveDiscussion(PostWasApproved $event)
|
||||
{
|
||||
$post = $event->post;
|
||||
$discussion = $post->discussion;
|
||||
|
|
|
@ -20,7 +20,7 @@ class UnapproveNewContent
|
|||
/**
|
||||
* @param Saving $event
|
||||
*/
|
||||
public function unapproveNewPosts(Saving $event)
|
||||
public static function unapproveNewPosts(Saving $event)
|
||||
{
|
||||
$post = $event->post;
|
||||
|
||||
|
@ -58,7 +58,7 @@ class UnapproveNewContent
|
|||
* @param GetModelIsPrivate $event
|
||||
* @return bool|null
|
||||
*/
|
||||
public function markUnapprovedContentAsPrivate(GetModelIsPrivate $event)
|
||||
public static function markUnapprovedContentAsPrivate(GetModelIsPrivate $event)
|
||||
{
|
||||
if ($event->model instanceof Post || $event->model instanceof Discussion) {
|
||||
if (! $event->model->is_approved) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user