From 3fc150cd235f0f7057a110634f2f2e847aebea6a Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sun, 1 Oct 2017 19:55:28 +0200 Subject: [PATCH] Update namespaces for beta 8 Refs flarum/core#1235. --- .../mentions/src/Listener/AddClientAssets.php | 8 +-- .../AddPostMentionedByRelationship.php | 36 ++++++------- .../src/Listener/FormatPostMentions.php | 18 +++---- .../src/Listener/FormatUserMentions.php | 26 +++++----- .../Listener/UpdatePostMentionsMetadata.php | 48 +++++++++--------- .../Listener/UpdateUserMentionsMetadata.php | 50 +++++++++---------- .../Notification/PostMentionedBlueprint.php | 4 +- .../Notification/UserMentionedBlueprint.php | 4 +- 8 files changed, 97 insertions(+), 97 deletions(-) diff --git a/extensions/mentions/src/Listener/AddClientAssets.php b/extensions/mentions/src/Listener/AddClientAssets.php index a19f74641..ea57fc5ff 100755 --- a/extensions/mentions/src/Listener/AddClientAssets.php +++ b/extensions/mentions/src/Listener/AddClientAssets.php @@ -11,7 +11,7 @@ namespace Flarum\Mentions\Listener; -use Flarum\Event\ConfigureWebApp; +use Flarum\Frontend\Event\Rendering; use Illuminate\Contracts\Events\Dispatcher; class AddClientAssets @@ -21,13 +21,13 @@ class AddClientAssets */ 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()) { $event->addAssets([ diff --git a/extensions/mentions/src/Listener/AddPostMentionedByRelationship.php b/extensions/mentions/src/Listener/AddPostMentionedByRelationship.php index d0d359639..07abd682e 100755 --- a/extensions/mentions/src/Listener/AddPostMentionedByRelationship.php +++ b/extensions/mentions/src/Listener/AddPostMentionedByRelationship.php @@ -15,14 +15,14 @@ use Flarum\Api\Controller\CreatePostController; use Flarum\Api\Controller\ListPostsController; use Flarum\Api\Controller\ShowDiscussionController; use Flarum\Api\Controller\ShowPostController; -use Flarum\Api\Serializer\PostBasicSerializer; -use Flarum\Core\Post; -use Flarum\Core\Repository\PostRepository; -use Flarum\Core\User; -use Flarum\Event\ConfigureApiController; +use Flarum\Api\Event\WillGetData; +use Flarum\Api\Event\WillSerializeData; +use Flarum\Api\Serializer\BasicPostSerializer; use Flarum\Event\GetApiRelationship; use Flarum\Event\GetModelRelationship; -use Flarum\Event\PrepareApiData; +use Flarum\Post\Post; +use Flarum\Post\PostRepository; +use Flarum\User\User; use Illuminate\Contracts\Events\Dispatcher; class AddPostMentionedByRelationship @@ -47,8 +47,8 @@ class AddPostMentionedByRelationship { $events->listen(GetModelRelationship::class, [$this, 'getModelRelationship']); $events->listen(GetApiRelationship::class, [$this, 'getApiRelationship']); - $events->listen(ConfigureApiController::class, [$this, 'includeRelationships']); - $events->listen(PrepareApiData::class, [$this, 'filterVisiblePosts']); + $events->listen(WillGetData::class, [$this, 'includeRelationships']); + $events->listen(WillSerializeData::class, [$this, 'filterVisiblePosts']); } /** @@ -76,23 +76,23 @@ class AddPostMentionedByRelationship */ public function getApiRelationship(GetApiRelationship $event) { - if ($event->isRelationship(PostBasicSerializer::class, 'mentionedBy')) { - return $event->serializer->hasMany($event->model, PostBasicSerializer::class, 'mentionedBy'); + if ($event->isRelationship(BasicPostSerializer::class, 'mentionedBy')) { + return $event->serializer->hasMany($event->model, BasicPostSerializer::class, 'mentionedBy'); } - if ($event->isRelationship(PostBasicSerializer::class, 'mentionsPosts')) { - return $event->serializer->hasMany($event->model, PostBasicSerializer::class, 'mentionsPosts'); + if ($event->isRelationship(BasicPostSerializer::class, 'mentionsPosts')) { + return $event->serializer->hasMany($event->model, BasicPostSerializer::class, 'mentionsPosts'); } - if ($event->isRelationship(PostBasicSerializer::class, 'mentionsUsers')) { - return $event->serializer->hasMany($event->model, PostBasicSerializer::class, 'mentionsUsers'); + if ($event->isRelationship(BasicPostSerializer::class, 'mentionsUsers')) { + return $event->serializer->hasMany($event->model, BasicPostSerializer::class, 'mentionsUsers'); } } /** - * @param ConfigureApiController $event + * @param WillGetData $event */ - public function includeRelationships(ConfigureApiController $event) + public function includeRelationships(WillGetData $event) { if ($event->isController(ShowDiscussionController::class)) { $event->addInclude([ @@ -127,9 +127,9 @@ class AddPostMentionedByRelationship * additional posts so that the user can't see any posts which they don't * have access to. * - * @param PrepareApiData $event + * @param WillSerializeData $event */ - public function filterVisiblePosts(PrepareApiData $event) + public function filterVisiblePosts(WillSerializeData $event) { // Firstly we gather a list of posts contained within the API document. // This will vary according to the API endpoint that is being accessed. diff --git a/extensions/mentions/src/Listener/FormatPostMentions.php b/extensions/mentions/src/Listener/FormatPostMentions.php index 888da12ae..e7e9f0368 100755 --- a/extensions/mentions/src/Listener/FormatPostMentions.php +++ b/extensions/mentions/src/Listener/FormatPostMentions.php @@ -11,10 +11,10 @@ namespace Flarum\Mentions\Listener; -use Flarum\Core\Post\CommentPost; -use Flarum\Event\ConfigureFormatter; -use Flarum\Event\ConfigureFormatterRenderer; +use Flarum\Formatter\Event\Configuring; +use Flarum\Formatter\Event\ConfiguringRenderer; use Flarum\Forum\UrlGenerator; +use Flarum\Post\Post\CommentPost; use Illuminate\Contracts\Events\Dispatcher; class FormatPostMentions @@ -37,14 +37,14 @@ class FormatPostMentions */ public function subscribe(Dispatcher $events) { - $events->listen(ConfigureFormatter::class, [$this, 'configure']); - $events->listen(ConfigureFormatterRenderer::class, [$this, 'render']); + $events->listen(Configuring::class, [$this, 'configure']); + $events->listen(ConfiguringRenderer::class, [$this, 'render']); } /** - * @param ConfigureFormatter $event + * @param Configuring $event */ - public function configure(ConfigureFormatter $event) + public function configure(Configuring $event) { $configurator = $event->configurator; @@ -69,9 +69,9 @@ class FormatPostMentions } /** - * @param ConfigureFormatterRenderer $event + * @param ConfiguringRenderer $event */ - public function render(ConfigureFormatterRenderer $event) + public function render(ConfiguringRenderer $event) { $event->renderer->setParameter('DISCUSSION_URL', $this->url->toRoute('discussion', ['id' => ''])); } diff --git a/extensions/mentions/src/Listener/FormatUserMentions.php b/extensions/mentions/src/Listener/FormatUserMentions.php index 28b279a95..809478eea 100755 --- a/extensions/mentions/src/Listener/FormatUserMentions.php +++ b/extensions/mentions/src/Listener/FormatUserMentions.php @@ -11,11 +11,11 @@ namespace Flarum\Mentions\Listener; -use Flarum\Core\Repository\UserRepository; -use Flarum\Event\ConfigureFormatter; -use Flarum\Event\ConfigureFormatterParser; -use Flarum\Event\ConfigureFormatterRenderer; +use Flarum\Formatter\Event\Configuring; +use Flarum\Formatter\Event\ConfiguringParser; +use Flarum\Formatter\Event\ConfiguringRenderer; use Flarum\Forum\UrlGenerator; +use Flarum\User\UserRepository; use Illuminate\Contracts\Events\Dispatcher; class FormatUserMentions @@ -45,15 +45,15 @@ class FormatUserMentions */ public function subscribe(Dispatcher $events) { - $events->listen(ConfigureFormatter::class, [$this, 'configure']); - $events->listen(ConfigureFormatterParser::class, [$this, 'parse']); - $events->listen(ConfigureFormatterRenderer::class, [$this, 'render']); + $events->listen(Configuring::class, [$this, 'configure']); + $events->listen(ConfiguringParser::class, [$this, 'parse']); + $events->listen(ConfiguringRenderer::class, [$this, 'render']); } /** - * @param ConfigureFormatter $event + * @param Configuring $event */ - public function configure(ConfigureFormatter $event) + public function configure(Configuring $event) { $configurator = $event->configurator; @@ -73,17 +73,17 @@ class FormatUserMentions } /** - * @param ConfigureFormatterParser $event + * @param ConfiguringParser $event */ - public function parse(ConfigureFormatterParser $event) + public function parse(ConfiguringParser $event) { $event->parser->registeredVars['userRepository'] = $this->users; } /** - * @param ConfigureFormatterRenderer $event + * @param ConfiguringRenderer $event */ - public function render(ConfigureFormatterRenderer $event) + public function render(ConfiguringRenderer $event) { $event->renderer->setParameter('PROFILE_URL', $this->url->toRoute('user', ['username' => ''])); } diff --git a/extensions/mentions/src/Listener/UpdatePostMentionsMetadata.php b/extensions/mentions/src/Listener/UpdatePostMentionsMetadata.php index e835ab92a..cb5b644de 100755 --- a/extensions/mentions/src/Listener/UpdatePostMentionsMetadata.php +++ b/extensions/mentions/src/Listener/UpdatePostMentionsMetadata.php @@ -11,16 +11,16 @@ namespace Flarum\Mentions\Listener; -use Flarum\Api\Serializer\PostBasicSerializer; -use Flarum\Core\Notification\NotificationSyncer; -use Flarum\Core\Post; +use Flarum\Api\Serializer\BasicPostSerializer; use Flarum\Event\ConfigureNotificationTypes; -use Flarum\Event\PostWasDeleted; -use Flarum\Event\PostWasHidden; -use Flarum\Event\PostWasPosted; -use Flarum\Event\PostWasRestored; -use Flarum\Event\PostWasRevised; use Flarum\Mentions\Notification\PostMentionedBlueprint; +use Flarum\Notification\NotificationSyncer; +use Flarum\Post\Event\Deleted; +use Flarum\Post\Event\Hidden; +use Flarum\Post\Event\Posted; +use Flarum\Post\Event\Restored; +use Flarum\Post\Event\Revised; +use Flarum\Post\Post; use Illuminate\Contracts\Events\Dispatcher; use s9e\TextFormatter\Utils; @@ -45,11 +45,11 @@ class UpdatePostMentionsMetadata public function subscribe(Dispatcher $events) { $events->listen(ConfigureNotificationTypes::class, [$this, 'addNotificationType']); - $events->listen(PostWasPosted::class, [$this, 'whenPostWasPosted']); - $events->listen(PostWasRevised::class, [$this, 'whenPostWasRevised']); - $events->listen(PostWasHidden::class, [$this, 'whenPostWasHidden']); - $events->listen(PostWasRestored::class, [$this, 'whenPostWasRestored']); - $events->listen(PostWasDeleted::class, [$this, 'whenPostWasDeleted']); + $events->listen(Posted::class, [$this, 'whenPosted']); + $events->listen(Revised::class, [$this, 'whenRevised']); + $events->listen(Hidden::class, [$this, 'whenHidden']); + $events->listen(Restored::class, [$this, 'whenRestored']); + $events->listen(Deleted::class, [$this, 'whenDeleted']); } /** @@ -57,45 +57,45 @@ class UpdatePostMentionsMetadata */ public function addNotificationType(ConfigureNotificationTypes $event) { - $event->add(PostMentionedBlueprint::class, PostBasicSerializer::class, ['alert']); + $event->add(PostMentionedBlueprint::class, BasicPostSerializer::class, ['alert']); } /** - * @param PostWasPosted $event + * @param Posted $event */ - public function whenPostWasPosted(PostWasPosted $event) + public function whenPosted(Posted $event) { $this->replyBecameVisible($event->post); } /** - * @param PostWasRevised $event + * @param Revised $event */ - public function whenPostWasRevised(PostWasRevised $event) + public function whenRevised(Revised $event) { $this->replyBecameVisible($event->post); } /** - * @param PostWasHidden $event + * @param Hidden $event */ - public function whenPostWasHidden(PostWasHidden $event) + public function whenHidden(Hidden $event) { $this->replyBecameInvisible($event->post); } /** - * @param PostWasRestored $event + * @param Restored $event */ - public function whenPostWasRestored(PostWasRestored $event) + public function whenRestored(Restored $event) { $this->replyBecameVisible($event->post); } /** - * @param PostWasDeleted $event + * @param Deleted $event */ - public function whenPostWasDeleted(PostWasDeleted $event) + public function whenDeleted(Deleted $event) { $this->replyBecameInvisible($event->post); } diff --git a/extensions/mentions/src/Listener/UpdateUserMentionsMetadata.php b/extensions/mentions/src/Listener/UpdateUserMentionsMetadata.php index d14e6ab68..4ba23b82e 100755 --- a/extensions/mentions/src/Listener/UpdateUserMentionsMetadata.php +++ b/extensions/mentions/src/Listener/UpdateUserMentionsMetadata.php @@ -11,17 +11,17 @@ namespace Flarum\Mentions\Listener; -use Flarum\Api\Serializer\PostBasicSerializer; -use Flarum\Core\Notification\NotificationSyncer; -use Flarum\Core\Post; -use Flarum\Core\User; +use Flarum\Api\Serializer\BasicPostSerializer; use Flarum\Event\ConfigureNotificationTypes; -use Flarum\Event\PostWasDeleted; -use Flarum\Event\PostWasHidden; -use Flarum\Event\PostWasPosted; -use Flarum\Event\PostWasRestored; -use Flarum\Event\PostWasRevised; use Flarum\Mentions\Notification\UserMentionedBlueprint; +use Flarum\Notification\NotificationSyncer; +use Flarum\Post\Event\Deleted; +use Flarum\Post\Event\Hidden; +use Flarum\Post\Event\Posted; +use Flarum\Post\Event\Restored; +use Flarum\Post\Event\Revised; +use Flarum\Post\Post; +use Flarum\User\User; use Illuminate\Contracts\Events\Dispatcher; use s9e\TextFormatter\Utils; @@ -46,11 +46,11 @@ class UpdateUserMentionsMetadata public function subscribe(Dispatcher $events) { $events->listen(ConfigureNotificationTypes::class, [$this, 'addNotificationType']); - $events->listen(PostWasPosted::class, [$this, 'whenPostWasPosted']); - $events->listen(PostWasRevised::class, [$this, 'whenPostWasRevised']); - $events->listen(PostWasHidden::class, [$this, 'whenPostWasHidden']); - $events->listen(PostWasRestored::class, [$this, 'whenPostWasRestored']); - $events->listen(PostWasDeleted::class, [$this, 'whenPostWasDeleted']); + $events->listen(Posted::class, [$this, 'whenPosted']); + $events->listen(Revised::class, [$this, 'whenRevised']); + $events->listen(Hidden::class, [$this, 'whenHidden']); + $events->listen(Restored::class, [$this, 'whenRestored']); + $events->listen(Deleted::class, [$this, 'whenDeleted']); } /** @@ -58,45 +58,45 @@ class UpdateUserMentionsMetadata */ public function addNotificationType(ConfigureNotificationTypes $event) { - $event->add(UserMentionedBlueprint::class, PostBasicSerializer::class, ['alert']); + $event->add(UserMentionedBlueprint::class, BasicPostSerializer::class, ['alert']); } /** - * @param PostWasPosted $event + * @param Posted $event */ - public function whenPostWasPosted(PostWasPosted $event) + public function whenPosted(Posted $event) { $this->postBecameVisible($event->post); } /** - * @param PostWasRevised $event + * @param Revised $event */ - public function whenPostWasRevised(PostWasRevised $event) + public function whenRevised(Revised $event) { $this->postBecameVisible($event->post); } /** - * @param PostWasHidden $event + * @param Hidden $event */ - public function whenPostWasHidden(PostWasHidden $event) + public function whenHidden(Hidden $event) { $this->postBecameInvisible($event->post); } /** - * @param PostWasRestored $event + * @param Restored $event */ - public function whenPostWasRestored(PostWasRestored $event) + public function whenRestored(Restored $event) { $this->postBecameVisible($event->post); } /** - * @param PostWasDeleted $event + * @param Deleted $event */ - public function whenPostWasDeleted(PostWasDeleted $event) + public function whenDeleted(Deleted $event) { $this->postBecameInvisible($event->post); } diff --git a/extensions/mentions/src/Notification/PostMentionedBlueprint.php b/extensions/mentions/src/Notification/PostMentionedBlueprint.php index 1a9b8cd22..563a41380 100644 --- a/extensions/mentions/src/Notification/PostMentionedBlueprint.php +++ b/extensions/mentions/src/Notification/PostMentionedBlueprint.php @@ -11,9 +11,9 @@ namespace Flarum\Mentions\Notification; -use Flarum\Core\Notification\BlueprintInterface; use Flarum\Core\Notification\MailableInterface; -use Flarum\Core\Post; +use Flarum\Notification\Blueprint\BlueprintInterface; +use Flarum\Post\Post; class PostMentionedBlueprint implements BlueprintInterface, MailableInterface { diff --git a/extensions/mentions/src/Notification/UserMentionedBlueprint.php b/extensions/mentions/src/Notification/UserMentionedBlueprint.php index 2f194f669..b18a7c04f 100644 --- a/extensions/mentions/src/Notification/UserMentionedBlueprint.php +++ b/extensions/mentions/src/Notification/UserMentionedBlueprint.php @@ -11,9 +11,9 @@ namespace Flarum\Mentions\Notification; -use Flarum\Core\Notification\BlueprintInterface; use Flarum\Core\Notification\MailableInterface; -use Flarum\Core\Post; +use Flarum\Notification\Blueprint\BlueprintInterface; +use Flarum\Post\Post; class UserMentionedBlueprint implements BlueprintInterface, MailableInterface {