1
0
mirror of https://github.com/flarum/core.git synced 2025-09-06 14:10:49 +02:00

Update namespaces for beta 8

Refs flarum/core#1235.
This commit is contained in:
Franz Liedke
2017-10-01 19:54:13 +02:00
parent c134843633
commit e2c97286e1
7 changed files with 44 additions and 44 deletions

View File

@@ -11,7 +11,7 @@
namespace Flarum\Subscriptions\Listener; namespace Flarum\Subscriptions\Listener;
use Flarum\Event\ConfigureWebApp; use Flarum\Frontend\Event\Rendering;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
class AddClientAssets class AddClientAssets
@@ -21,13 +21,13 @@ class AddClientAssets
*/ */
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(ConfigureWebApp::class, [$this, 'addAssets']); $events->listen(Rendering::class, [$this, 'addAssets']);
} }
/** /**
* @param ConfigureClientView $event * @param Rendering $event
*/ */
public function addAssets(ConfigureWebApp $event) public function addAssets(Rendering $event)
{ {
if ($event->isForum()) { if ($event->isForum()) {
$event->addAssets([ $event->addAssets([

View File

@@ -11,8 +11,8 @@
namespace Flarum\Subscriptions\Listener; namespace Flarum\Subscriptions\Listener;
use Flarum\Api\Event\Serializing;
use Flarum\Api\Serializer\DiscussionSerializer; use Flarum\Api\Serializer\DiscussionSerializer;
use Flarum\Event\PrepareApiAttributes;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
class AddDiscussionSubscriptionAttribute class AddDiscussionSubscriptionAttribute
@@ -22,13 +22,13 @@ class AddDiscussionSubscriptionAttribute
*/ */
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(PrepareApiAttributes::class, [$this, 'addAttributes']); $events->listen(Serializing::class, [$this, 'addAttributes']);
} }
/** /**
* @param PrepareApiAttributes $event * @param Serializing $event
*/ */
public function addAttributes(PrepareApiAttributes $event) public function addAttributes(Serializing $event)
{ {
if ($event->isSerializer(DiscussionSerializer::class) if ($event->isSerializer(DiscussionSerializer::class)
&& ($state = $event->model->state)) { && ($state = $event->model->state)) {

View File

@@ -11,8 +11,8 @@
namespace Flarum\Subscriptions\Listener; namespace Flarum\Subscriptions\Listener;
use Flarum\Discussion\Event\Searching;
use Flarum\Event\ConfigureDiscussionGambits; use Flarum\Event\ConfigureDiscussionGambits;
use Flarum\Event\ConfigureDiscussionSearch;
use Flarum\Event\ConfigureForumRoutes; use Flarum\Event\ConfigureForumRoutes;
use Flarum\Subscriptions\Gambit\SubscriptionGambit; use Flarum\Subscriptions\Gambit\SubscriptionGambit;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
@@ -26,7 +26,7 @@ class FilterDiscussionListBySubscription
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(ConfigureDiscussionGambits::class, [$this, 'addGambit']); $events->listen(ConfigureDiscussionGambits::class, [$this, 'addGambit']);
$events->listen(ConfigureDiscussionSearch::class, [$this, 'filterIgnored']); $events->listen(Searching::class, [$this, 'filterIgnored']);
$events->listen(ConfigureForumRoutes::class, [$this, 'addRoutes']); $events->listen(ConfigureForumRoutes::class, [$this, 'addRoutes']);
} }
@@ -39,9 +39,9 @@ class FilterDiscussionListBySubscription
} }
/** /**
* @param ConfigureDiscussionSearch $event * @param Searching $event
*/ */
public function filterIgnored(ConfigureDiscussionSearch $event) public function filterIgnored(Searching $event)
{ {
if (! $event->criteria->query) { if (! $event->criteria->query) {
// might be better as `id IN (subquery)`? // might be better as `id IN (subquery)`?

View File

@@ -11,9 +11,9 @@
namespace Flarum\Subscriptions\Listener; namespace Flarum\Subscriptions\Listener;
use Flarum\Core\Access\AssertPermissionTrait;
use Flarum\Event\ConfigureUserPreferences; use Flarum\Event\ConfigureUserPreferences;
use Flarum\Event\PostWasPosted; use Flarum\Post\Event\Posted;
use Flarum\User\AssertPermissionTrait;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
class FollowAfterReply class FollowAfterReply
@@ -26,7 +26,7 @@ class FollowAfterReply
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(ConfigureUserPreferences::class, [$this, 'addUserPreference']); $events->listen(ConfigureUserPreferences::class, [$this, 'addUserPreference']);
$events->listen(PostWasPosted::class, [$this, 'whenPostWasPosted']); $events->listen(Posted::class, [$this, 'whenPosted']);
} }
/** /**
@@ -38,9 +38,9 @@ class FollowAfterReply
} }
/** /**
* @param PostWasPosted $event * @param Posted $event
*/ */
public function whenPostWasPosted(PostWasPosted $event) public function whenPosted(Posted $event)
{ {
$actor = $event->actor; $actor = $event->actor;

View File

@@ -11,8 +11,8 @@
namespace Flarum\Subscriptions\Listener; namespace Flarum\Subscriptions\Listener;
use Flarum\Core\Access\AssertPermissionTrait; use Flarum\Discussion\Event\Saving;
use Flarum\Event\DiscussionWillBeSaved; use Flarum\User\AssertPermissionTrait;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
class SaveSubscriptionToDatabase class SaveSubscriptionToDatabase
@@ -24,13 +24,13 @@ class SaveSubscriptionToDatabase
*/ */
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(DiscussionWillBeSaved::class, [$this, 'whenDiscussionWillBeSaved']); $events->listen(Saving::class, [$this, 'whenSaving']);
} }
/** /**
* @param DiscussionWillBeSaved $event * @param Saving $event
*/ */
public function whenDiscussionWillBeSaved(DiscussionWillBeSaved $event) public function whenSaving(Saving $event)
{ {
$discussion = $event->discussion; $discussion = $event->discussion;
$data = $event->data; $data = $event->data;

View File

@@ -11,14 +11,14 @@
namespace Flarum\Subscriptions\Listener; namespace Flarum\Subscriptions\Listener;
use Flarum\Api\Serializer\DiscussionBasicSerializer; use Flarum\Api\Serializer\BasicDiscussionSerializer;
use Flarum\Core\Notification\NotificationSyncer; use Flarum\Core\Notification\NotificationSyncer;
use Flarum\Core\Post;
use Flarum\Event\ConfigureNotificationTypes; use Flarum\Event\ConfigureNotificationTypes;
use Flarum\Event\PostWasDeleted; use Flarum\Post\Event\Deleted;
use Flarum\Event\PostWasHidden; use Flarum\Post\Event\Hidden;
use Flarum\Event\PostWasPosted; use Flarum\Post\Event\Posted;
use Flarum\Event\PostWasRestored; use Flarum\Post\Event\Restored;
use Flarum\Post\Post;
use Flarum\Subscriptions\Notification\NewPostBlueprint; use Flarum\Subscriptions\Notification\NewPostBlueprint;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
@@ -47,10 +47,10 @@ class SendNotificationWhenReplyIsPosted
// Register with '1' as priority so this runs before discussion metadata // Register with '1' as priority so this runs before discussion metadata
// is updated, as we need to compare the user's last read number to that // is updated, as we need to compare the user's last read number to that
// of the previous post. // of the previous post.
$events->listen(PostWasPosted::class, [$this, 'whenPostWasPosted'], 1); $events->listen(Posted::class, [$this, 'whenPosted'], 1);
$events->listen(PostWasHidden::class, [$this, 'whenPostWasHidden']); $events->listen(Hidden::class, [$this, 'whenHidden']);
$events->listen(PostWasRestored::class, [$this, 'whenPostWasRestored']); $events->listen(Restored::class, [$this, 'whenRestored']);
$events->listen(PostWasDeleted::class, [$this, 'whenPostWasDeleted']); $events->listen(Deleted::class, [$this, 'whenDeleted']);
} }
/** /**
@@ -58,13 +58,13 @@ class SendNotificationWhenReplyIsPosted
*/ */
public function addNotificationType(ConfigureNotificationTypes $event) public function addNotificationType(ConfigureNotificationTypes $event)
{ {
$event->add(NewPostBlueprint::class, DiscussionBasicSerializer::class, ['alert', 'email']); $event->add(NewPostBlueprint::class, BasicDiscussionSerializer::class, ['alert', 'email']);
} }
/** /**
* @param PostWasPosted $event * @param Posted $event
*/ */
public function whenPostWasPosted(PostWasPosted $event) public function whenPosted(Posted $event)
{ {
$post = $event->post; $post = $event->post;
$discussion = $post->discussion; $discussion = $post->discussion;
@@ -82,25 +82,25 @@ class SendNotificationWhenReplyIsPosted
} }
/** /**
* @param PostWasHidden $event * @param Hidden $event
*/ */
public function whenPostWasHidden(PostWasHidden $event) public function whenHidden(Hidden $event)
{ {
$this->notifications->delete($this->getNotification($event->post)); $this->notifications->delete($this->getNotification($event->post));
} }
/** /**
* @param PostWasRestored $event * @param Restored $event
*/ */
public function whenPostWasRestored(PostWasRestored $event) public function whenRestored(Restored $event)
{ {
$this->notifications->restore($this->getNotification($event->post)); $this->notifications->restore($this->getNotification($event->post));
} }
/** /**
* @param PostWasDeleted $event * @param Deleted $event
*/ */
public function whenPostWasDeleted(PostWasDeleted $event) public function whenDeleted(Deleted $event)
{ {
$this->notifications->delete($this->getNotification($event->post)); $this->notifications->delete($this->getNotification($event->post));
} }

View File

@@ -11,10 +11,10 @@
namespace Flarum\Subscriptions\Notification; namespace Flarum\Subscriptions\Notification;
use Flarum\Core\Discussion;
use Flarum\Core\Notification\BlueprintInterface;
use Flarum\Core\Notification\MailableInterface; use Flarum\Core\Notification\MailableInterface;
use Flarum\Core\Post; use Flarum\Discussion\Discussion;
use Flarum\Notification\Blueprint\BlueprintInterface;
use Flarum\Post\Post;
class NewPostBlueprint implements BlueprintInterface, MailableInterface class NewPostBlueprint implements BlueprintInterface, MailableInterface
{ {