mirror of
https://github.com/flarum/core.git
synced 2025-10-09 22:16:51 +02:00
Change API to use PSR-7 style requests and responses
This required some interface changes (mostly changing Laravel's or Symfony's request and response classes to those of Zend's Diactoros. Some smaller changes to the execution flow in a few of the abstract action base classes, but nothing substantial. Note: The request and response classes are immutable, so we usually need to return new instances after modifying the old ones.
This commit is contained in:
@@ -5,7 +5,6 @@ use Flarum\Core\Commands\ReadDiscussionCommand;
|
||||
use Flarum\Core\Models\Forum;
|
||||
use Flarum\Api\Actions\CreateAction as BaseCreateAction;
|
||||
use Flarum\Api\JsonApiRequest;
|
||||
use Flarum\Api\JsonApiResponse;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
|
||||
class CreateAction extends BaseCreateAction
|
||||
@@ -60,11 +59,10 @@ class CreateAction extends BaseCreateAction
|
||||
/**
|
||||
* Create a discussion according to input from the API request.
|
||||
*
|
||||
* @param \Flarum\Api\JsonApiRequest $request
|
||||
* @param \Flarum\Api\JsonApiResponse $response
|
||||
* @return \Flarum\Core\Models\Discussion
|
||||
* @param JsonApiRequest $request
|
||||
* @return \Flarum\Core\Models\Model
|
||||
*/
|
||||
protected function create(JsonApiRequest $request, JsonApiResponse $response)
|
||||
protected function create(JsonApiRequest $request)
|
||||
{
|
||||
$user = $request->actor->getUser();
|
||||
|
||||
|
Reference in New Issue
Block a user