-
-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove ExtenderInterface[] as a conditional option, only suppo…
…rt callable or ::class invoke
- Loading branch information
Showing
4 changed files
with
265 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Flarum\Mentions; | ||
|
||
use Flarum\Api\Controller; | ||
use Flarum\Api\Serializer\BasicPostSerializer; | ||
use Flarum\Extend; | ||
use Flarum\Tags\Api\Serializer\TagSerializer; | ||
|
||
class TagExtender | ||
{ | ||
public function __invoke(): array | ||
{ | ||
return [ | ||
(new Extend\Formatter) | ||
->render(Formatter\FormatTagMentions::class) | ||
->unparse(Formatter\UnparseTagMentions::class), | ||
|
||
(new Extend\ApiSerializer(BasicPostSerializer::class)) | ||
->hasMany('mentionsTags', TagSerializer::class), | ||
|
||
(new Extend\ApiController(Controller\ShowDiscussionController::class)) | ||
->load(['posts.mentionsTags']), | ||
|
||
(new Extend\ApiController(Controller\ListDiscussionsController::class)) | ||
->load([ | ||
'firstPost.mentionsTags', 'lastPost.mentionsTags', | ||
]), | ||
|
||
(new Extend\ApiController(Controller\ListPostsController::class)) | ||
->load(['mentionsTags']), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.