mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 03:32:49 +08:00
Use ::class instead of some hardcoded class names
This gives us better refactoring functionality in IDEs like PhpStorm, and also more quickly surfaces typos through errors about undefined classes. :)
This commit is contained in:
parent
3f7e7520b0
commit
936f67e953
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\DiscussionSerializer;
|
||||
use Flarum\Discussion\Command\ReadDiscussion;
|
||||
use Flarum\Discussion\Command\StartDiscussion;
|
||||
use Flarum\Post\Floodgate;
|
||||
|
@ -23,7 +24,7 @@ class CreateDiscussionController extends AbstractCreateController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\DiscussionSerializer';
|
||||
public $serializer = DiscussionSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\GroupSerializer;
|
||||
use Flarum\Group\Command\CreateGroup;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
@ -21,7 +22,7 @@ class CreateGroupController extends AbstractCreateController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\GroupSerializer';
|
||||
public $serializer = GroupSerializer::class;
|
||||
|
||||
/**
|
||||
* @var Dispatcher
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\PostSerializer;
|
||||
use Flarum\Discussion\Command\ReadDiscussion;
|
||||
use Flarum\Post\Command\PostReply;
|
||||
use Flarum\Post\Floodgate;
|
||||
|
@ -23,7 +24,7 @@ class CreatePostController extends AbstractCreateController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\PostSerializer';
|
||||
public $serializer = PostSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\CurrentUserSerializer;
|
||||
use Flarum\User\Command\RegisterUser;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
@ -21,7 +22,7 @@ class CreateUserController extends AbstractCreateController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\CurrentUserSerializer';
|
||||
public $serializer = CurrentUserSerializer::class;
|
||||
|
||||
/**
|
||||
* @var Dispatcher
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\UserSerializer;
|
||||
use Flarum\User\Command\DeleteAvatar;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
@ -21,7 +22,7 @@ class DeleteAvatarController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\UserSerializer';
|
||||
public $serializer = UserSerializer::class;
|
||||
|
||||
/**
|
||||
* @var Dispatcher
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\DiscussionSerializer;
|
||||
use Flarum\Discussion\Search\DiscussionSearcher;
|
||||
use Flarum\Http\UrlGenerator;
|
||||
use Flarum\Search\SearchCriteria;
|
||||
|
@ -22,7 +23,7 @@ class ListDiscussionsController extends AbstractListController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\DiscussionSerializer';
|
||||
public $serializer = DiscussionSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\GroupSerializer;
|
||||
use Flarum\Group\Group;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Tobscure\JsonApi\Document;
|
||||
|
@ -20,7 +21,7 @@ class ListGroupsController extends AbstractListController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\GroupSerializer';
|
||||
public $serializer = GroupSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\NotificationSerializer;
|
||||
use Flarum\Discussion\Discussion;
|
||||
use Flarum\Http\UrlGenerator;
|
||||
use Flarum\Notification\NotificationRepository;
|
||||
|
@ -23,7 +24,7 @@ class ListNotificationsController extends AbstractListController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\NotificationSerializer';
|
||||
public $serializer = NotificationSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\PostSerializer;
|
||||
use Flarum\Event\ConfigurePostsQuery;
|
||||
use Flarum\Post\PostRepository;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
@ -23,7 +24,7 @@ class ListPostsController extends AbstractListController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\PostSerializer';
|
||||
public $serializer = PostSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\UserSerializer;
|
||||
use Flarum\Http\UrlGenerator;
|
||||
use Flarum\Search\SearchCriteria;
|
||||
use Flarum\User\Exception\PermissionDeniedException;
|
||||
|
@ -23,7 +24,7 @@ class ListUsersController extends AbstractListController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\UserSerializer';
|
||||
public $serializer = UserSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\DiscussionSerializer;
|
||||
use Flarum\Discussion\Discussion;
|
||||
use Flarum\Discussion\DiscussionRepository;
|
||||
use Flarum\Post\PostRepository;
|
||||
|
@ -33,7 +34,7 @@ class ShowDiscussionController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\DiscussionSerializer';
|
||||
public $serializer = DiscussionSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\ForumSerializer;
|
||||
use Flarum\Group\Group;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Tobscure\JsonApi\Document;
|
||||
|
@ -20,7 +21,7 @@ class ShowForumController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\ForumSerializer';
|
||||
public $serializer = ForumSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\PostSerializer;
|
||||
use Flarum\Post\PostRepository;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Tobscure\JsonApi\Document;
|
||||
|
@ -20,7 +21,7 @@ class ShowPostController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\PostSerializer';
|
||||
public $serializer = PostSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\UserSerializer;
|
||||
use Flarum\User\UserRepository;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Tobscure\JsonApi\Document;
|
||||
|
@ -20,7 +21,7 @@ class ShowUserController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\UserSerializer';
|
||||
public $serializer = UserSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\DiscussionSerializer;
|
||||
use Flarum\Discussion\Command\EditDiscussion;
|
||||
use Flarum\Discussion\Command\ReadDiscussion;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
|
@ -23,7 +24,7 @@ class UpdateDiscussionController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\DiscussionSerializer';
|
||||
public $serializer = DiscussionSerializer::class;
|
||||
|
||||
/**
|
||||
* @var Dispatcher
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\GroupSerializer;
|
||||
use Flarum\Group\Command\EditGroup;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
@ -21,7 +22,7 @@ class UpdateGroupController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\GroupSerializer';
|
||||
public $serializer = GroupSerializer::class;
|
||||
|
||||
/**
|
||||
* @var Dispatcher
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\NotificationSerializer;
|
||||
use Flarum\Notification\Command\ReadNotification;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
@ -21,7 +22,7 @@ class UpdateNotificationController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\NotificationSerializer';
|
||||
public $serializer = NotificationSerializer::class;
|
||||
|
||||
/**
|
||||
* @var Dispatcher
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\PostSerializer;
|
||||
use Flarum\Post\Command\EditPost;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
@ -21,7 +22,7 @@ class UpdatePostController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\PostSerializer';
|
||||
public $serializer = PostSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\CurrentUserSerializer;
|
||||
use Flarum\User\Command\EditUser;
|
||||
use Flarum\User\Exception\PermissionDeniedException;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
|
@ -22,7 +23,7 @@ class UpdateUserController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\CurrentUserSerializer';
|
||||
public $serializer = CurrentUserSerializer::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Flarum\Api\Controller;
|
||||
|
||||
use Flarum\Api\Serializer\UserSerializer;
|
||||
use Flarum\User\Command\UploadAvatar;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
@ -21,7 +22,7 @@ class UploadAvatarController extends AbstractShowController
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $serializer = 'Flarum\Api\Serializer\UserSerializer';
|
||||
public $serializer = UserSerializer::class;
|
||||
|
||||
/**
|
||||
* @var Dispatcher
|
||||
|
|
Loading…
Reference in New Issue
Block a user