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:
Alexander Skvortsov 2020-12-10 23:33:45 -05:00
parent d2d7b3026e
commit 787bbc0f33
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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) {