Removes AssertPermissionTrait (#29)

* Removes AssertPermissionTrait

* Apply fixes from StyleCI

* Fix my dumb mistake

Co-authored-by: luceos <daniel+github@klabbers.email>
This commit is contained in:
Matt Kilgore 2020-07-19 17:37:05 -04:00 committed by GitHub
parent 2648ee2031
commit 1fe034460b
2 changed files with 2 additions and 8 deletions

View File

@ -10,18 +10,15 @@
namespace Flarum\Subscriptions\Listener; namespace Flarum\Subscriptions\Listener;
use Flarum\Post\Event\Posted; use Flarum\Post\Event\Posted;
use Flarum\User\AssertPermissionTrait;
class FollowAfterReply class FollowAfterReply
{ {
use AssertPermissionTrait;
public function handle(Posted $event) public function handle(Posted $event)
{ {
$actor = $event->actor; $actor = $event->actor;
if ($actor && $actor->exists && $actor->getPreference('followAfterReply')) { if ($actor && $actor->exists && $actor->getPreference('followAfterReply')) {
$this->assertRegistered($actor); $actor->assertRegistered();
$state = $event->post->discussion->stateFor($actor); $state = $event->post->discussion->stateFor($actor);

View File

@ -10,12 +10,9 @@
namespace Flarum\Subscriptions\Listener; namespace Flarum\Subscriptions\Listener;
use Flarum\Discussion\Event\Saving; use Flarum\Discussion\Event\Saving;
use Flarum\User\AssertPermissionTrait;
class SaveSubscriptionToDatabase class SaveSubscriptionToDatabase
{ {
use AssertPermissionTrait;
public function handle(Saving $event) public function handle(Saving $event)
{ {
$discussion = $event->discussion; $discussion = $event->discussion;
@ -25,7 +22,7 @@ class SaveSubscriptionToDatabase
$actor = $event->actor; $actor = $event->actor;
$subscription = $data['attributes']['subscription']; $subscription = $data['attributes']['subscription'];
$this->assertRegistered($actor); $actor->assertRegistered();
$state = $discussion->stateFor($actor); $state = $discussion->stateFor($actor);