1
0
mirror of https://github.com/flarum/core.git synced 2025-07-28 20:20:34 +02:00

Update namespaces for beta 8

Refs flarum/core#1235.
This commit is contained in:
Franz Liedke
2017-10-01 19:55:28 +02:00
parent 86496f3e06
commit 3fc150cd23
8 changed files with 97 additions and 97 deletions

View File

@@ -11,7 +11,7 @@
namespace Flarum\Mentions\Listener; namespace Flarum\Mentions\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

@@ -15,14 +15,14 @@ use Flarum\Api\Controller\CreatePostController;
use Flarum\Api\Controller\ListPostsController; use Flarum\Api\Controller\ListPostsController;
use Flarum\Api\Controller\ShowDiscussionController; use Flarum\Api\Controller\ShowDiscussionController;
use Flarum\Api\Controller\ShowPostController; use Flarum\Api\Controller\ShowPostController;
use Flarum\Api\Serializer\PostBasicSerializer; use Flarum\Api\Event\WillGetData;
use Flarum\Core\Post; use Flarum\Api\Event\WillSerializeData;
use Flarum\Core\Repository\PostRepository; use Flarum\Api\Serializer\BasicPostSerializer;
use Flarum\Core\User;
use Flarum\Event\ConfigureApiController;
use Flarum\Event\GetApiRelationship; use Flarum\Event\GetApiRelationship;
use Flarum\Event\GetModelRelationship; 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; use Illuminate\Contracts\Events\Dispatcher;
class AddPostMentionedByRelationship class AddPostMentionedByRelationship
@@ -47,8 +47,8 @@ class AddPostMentionedByRelationship
{ {
$events->listen(GetModelRelationship::class, [$this, 'getModelRelationship']); $events->listen(GetModelRelationship::class, [$this, 'getModelRelationship']);
$events->listen(GetApiRelationship::class, [$this, 'getApiRelationship']); $events->listen(GetApiRelationship::class, [$this, 'getApiRelationship']);
$events->listen(ConfigureApiController::class, [$this, 'includeRelationships']); $events->listen(WillGetData::class, [$this, 'includeRelationships']);
$events->listen(PrepareApiData::class, [$this, 'filterVisiblePosts']); $events->listen(WillSerializeData::class, [$this, 'filterVisiblePosts']);
} }
/** /**
@@ -76,23 +76,23 @@ class AddPostMentionedByRelationship
*/ */
public function getApiRelationship(GetApiRelationship $event) public function getApiRelationship(GetApiRelationship $event)
{ {
if ($event->isRelationship(PostBasicSerializer::class, 'mentionedBy')) { if ($event->isRelationship(BasicPostSerializer::class, 'mentionedBy')) {
return $event->serializer->hasMany($event->model, PostBasicSerializer::class, 'mentionedBy'); return $event->serializer->hasMany($event->model, BasicPostSerializer::class, 'mentionedBy');
} }
if ($event->isRelationship(PostBasicSerializer::class, 'mentionsPosts')) { if ($event->isRelationship(BasicPostSerializer::class, 'mentionsPosts')) {
return $event->serializer->hasMany($event->model, PostBasicSerializer::class, 'mentionsPosts'); return $event->serializer->hasMany($event->model, BasicPostSerializer::class, 'mentionsPosts');
} }
if ($event->isRelationship(PostBasicSerializer::class, 'mentionsUsers')) { if ($event->isRelationship(BasicPostSerializer::class, 'mentionsUsers')) {
return $event->serializer->hasMany($event->model, PostBasicSerializer::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)) { if ($event->isController(ShowDiscussionController::class)) {
$event->addInclude([ $event->addInclude([
@@ -127,9 +127,9 @@ class AddPostMentionedByRelationship
* additional posts so that the user can't see any posts which they don't * additional posts so that the user can't see any posts which they don't
* have access to. * 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. // Firstly we gather a list of posts contained within the API document.
// This will vary according to the API endpoint that is being accessed. // This will vary according to the API endpoint that is being accessed.

View File

@@ -11,10 +11,10 @@
namespace Flarum\Mentions\Listener; namespace Flarum\Mentions\Listener;
use Flarum\Core\Post\CommentPost; use Flarum\Formatter\Event\Configuring;
use Flarum\Event\ConfigureFormatter; use Flarum\Formatter\Event\ConfiguringRenderer;
use Flarum\Event\ConfigureFormatterRenderer;
use Flarum\Forum\UrlGenerator; use Flarum\Forum\UrlGenerator;
use Flarum\Post\Post\CommentPost;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
class FormatPostMentions class FormatPostMentions
@@ -37,14 +37,14 @@ class FormatPostMentions
*/ */
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(ConfigureFormatter::class, [$this, 'configure']); $events->listen(Configuring::class, [$this, 'configure']);
$events->listen(ConfigureFormatterRenderer::class, [$this, 'render']); $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; $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' => ''])); $event->renderer->setParameter('DISCUSSION_URL', $this->url->toRoute('discussion', ['id' => '']));
} }

View File

@@ -11,11 +11,11 @@
namespace Flarum\Mentions\Listener; namespace Flarum\Mentions\Listener;
use Flarum\Core\Repository\UserRepository; use Flarum\Formatter\Event\Configuring;
use Flarum\Event\ConfigureFormatter; use Flarum\Formatter\Event\ConfiguringParser;
use Flarum\Event\ConfigureFormatterParser; use Flarum\Formatter\Event\ConfiguringRenderer;
use Flarum\Event\ConfigureFormatterRenderer;
use Flarum\Forum\UrlGenerator; use Flarum\Forum\UrlGenerator;
use Flarum\User\UserRepository;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
class FormatUserMentions class FormatUserMentions
@@ -45,15 +45,15 @@ class FormatUserMentions
*/ */
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(ConfigureFormatter::class, [$this, 'configure']); $events->listen(Configuring::class, [$this, 'configure']);
$events->listen(ConfigureFormatterParser::class, [$this, 'parse']); $events->listen(ConfiguringParser::class, [$this, 'parse']);
$events->listen(ConfigureFormatterRenderer::class, [$this, 'render']); $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; $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; $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' => ''])); $event->renderer->setParameter('PROFILE_URL', $this->url->toRoute('user', ['username' => '']));
} }

View File

@@ -11,16 +11,16 @@
namespace Flarum\Mentions\Listener; namespace Flarum\Mentions\Listener;
use Flarum\Api\Serializer\PostBasicSerializer; use Flarum\Api\Serializer\BasicPostSerializer;
use Flarum\Core\Notification\NotificationSyncer;
use Flarum\Core\Post;
use Flarum\Event\ConfigureNotificationTypes; 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\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 Illuminate\Contracts\Events\Dispatcher;
use s9e\TextFormatter\Utils; use s9e\TextFormatter\Utils;
@@ -45,11 +45,11 @@ class UpdatePostMentionsMetadata
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(ConfigureNotificationTypes::class, [$this, 'addNotificationType']); $events->listen(ConfigureNotificationTypes::class, [$this, 'addNotificationType']);
$events->listen(PostWasPosted::class, [$this, 'whenPostWasPosted']); $events->listen(Posted::class, [$this, 'whenPosted']);
$events->listen(PostWasRevised::class, [$this, 'whenPostWasRevised']); $events->listen(Revised::class, [$this, 'whenRevised']);
$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']);
} }
/** /**
@@ -57,45 +57,45 @@ class UpdatePostMentionsMetadata
*/ */
public function addNotificationType(ConfigureNotificationTypes $event) 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); $this->replyBecameVisible($event->post);
} }
/** /**
* @param PostWasRevised $event * @param Revised $event
*/ */
public function whenPostWasRevised(PostWasRevised $event) public function whenRevised(Revised $event)
{ {
$this->replyBecameVisible($event->post); $this->replyBecameVisible($event->post);
} }
/** /**
* @param PostWasHidden $event * @param Hidden $event
*/ */
public function whenPostWasHidden(PostWasHidden $event) public function whenHidden(Hidden $event)
{ {
$this->replyBecameInvisible($event->post); $this->replyBecameInvisible($event->post);
} }
/** /**
* @param PostWasRestored $event * @param Restored $event
*/ */
public function whenPostWasRestored(PostWasRestored $event) public function whenRestored(Restored $event)
{ {
$this->replyBecameVisible($event->post); $this->replyBecameVisible($event->post);
} }
/** /**
* @param PostWasDeleted $event * @param Deleted $event
*/ */
public function whenPostWasDeleted(PostWasDeleted $event) public function whenDeleted(Deleted $event)
{ {
$this->replyBecameInvisible($event->post); $this->replyBecameInvisible($event->post);
} }

View File

@@ -11,17 +11,17 @@
namespace Flarum\Mentions\Listener; namespace Flarum\Mentions\Listener;
use Flarum\Api\Serializer\PostBasicSerializer; use Flarum\Api\Serializer\BasicPostSerializer;
use Flarum\Core\Notification\NotificationSyncer;
use Flarum\Core\Post;
use Flarum\Core\User;
use Flarum\Event\ConfigureNotificationTypes; 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\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 Illuminate\Contracts\Events\Dispatcher;
use s9e\TextFormatter\Utils; use s9e\TextFormatter\Utils;
@@ -46,11 +46,11 @@ class UpdateUserMentionsMetadata
public function subscribe(Dispatcher $events) public function subscribe(Dispatcher $events)
{ {
$events->listen(ConfigureNotificationTypes::class, [$this, 'addNotificationType']); $events->listen(ConfigureNotificationTypes::class, [$this, 'addNotificationType']);
$events->listen(PostWasPosted::class, [$this, 'whenPostWasPosted']); $events->listen(Posted::class, [$this, 'whenPosted']);
$events->listen(PostWasRevised::class, [$this, 'whenPostWasRevised']); $events->listen(Revised::class, [$this, 'whenRevised']);
$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,45 +58,45 @@ class UpdateUserMentionsMetadata
*/ */
public function addNotificationType(ConfigureNotificationTypes $event) 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); $this->postBecameVisible($event->post);
} }
/** /**
* @param PostWasRevised $event * @param Revised $event
*/ */
public function whenPostWasRevised(PostWasRevised $event) public function whenRevised(Revised $event)
{ {
$this->postBecameVisible($event->post); $this->postBecameVisible($event->post);
} }
/** /**
* @param PostWasHidden $event * @param Hidden $event
*/ */
public function whenPostWasHidden(PostWasHidden $event) public function whenHidden(Hidden $event)
{ {
$this->postBecameInvisible($event->post); $this->postBecameInvisible($event->post);
} }
/** /**
* @param PostWasRestored $event * @param Restored $event
*/ */
public function whenPostWasRestored(PostWasRestored $event) public function whenRestored(Restored $event)
{ {
$this->postBecameVisible($event->post); $this->postBecameVisible($event->post);
} }
/** /**
* @param PostWasDeleted $event * @param Deleted $event
*/ */
public function whenPostWasDeleted(PostWasDeleted $event) public function whenDeleted(Deleted $event)
{ {
$this->postBecameInvisible($event->post); $this->postBecameInvisible($event->post);
} }

View File

@@ -11,9 +11,9 @@
namespace Flarum\Mentions\Notification; namespace Flarum\Mentions\Notification;
use Flarum\Core\Notification\BlueprintInterface;
use Flarum\Core\Notification\MailableInterface; use Flarum\Core\Notification\MailableInterface;
use Flarum\Core\Post; use Flarum\Notification\Blueprint\BlueprintInterface;
use Flarum\Post\Post;
class PostMentionedBlueprint implements BlueprintInterface, MailableInterface class PostMentionedBlueprint implements BlueprintInterface, MailableInterface
{ {

View File

@@ -11,9 +11,9 @@
namespace Flarum\Mentions\Notification; namespace Flarum\Mentions\Notification;
use Flarum\Core\Notification\BlueprintInterface;
use Flarum\Core\Notification\MailableInterface; use Flarum\Core\Notification\MailableInterface;
use Flarum\Core\Post; use Flarum\Notification\Blueprint\BlueprintInterface;
use Flarum\Post\Post;
class UserMentionedBlueprint implements BlueprintInterface, MailableInterface class UserMentionedBlueprint implements BlueprintInterface, MailableInterface
{ {