mirror of
https://github.com/flarum/core.git
synced 2025-10-17 01:36:09 +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:
@@ -3,7 +3,6 @@
|
||||
use Flarum\Core\Commands\DeleteDiscussionCommand;
|
||||
use Flarum\Api\Actions\DeleteAction as BaseDeleteAction;
|
||||
use Flarum\Api\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
|
||||
class DeleteAction extends BaseDeleteAction
|
||||
@@ -29,10 +28,9 @@ class DeleteAction extends BaseDeleteAction
|
||||
* Delete a discussion.
|
||||
*
|
||||
* @param \Flarum\Api\Request $request
|
||||
* @param \Illuminate\Http\Response $response
|
||||
* @return void
|
||||
*/
|
||||
protected function delete(Request $request, Response $response)
|
||||
protected function delete(Request $request)
|
||||
{
|
||||
$this->bus->dispatch(
|
||||
new DeleteDiscussionCommand($request->get('id'), $request->actor->getUser())
|
||||
|
Reference in New Issue
Block a user