mirror of
https://github.com/flarum/core.git
synced 2025-08-01 22:20:21 +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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user