1
0
mirror of https://github.com/flarum/core.git synced 2025-10-18 18:26:07 +02:00

Remove deprecated API events

This commit is contained in:
Alexander Skvortsov
2021-01-20 16:08:22 -05:00
parent cbcf83ed3b
commit 40b918e139
8 changed files with 8 additions and 443 deletions

View File

@@ -9,11 +9,8 @@
namespace Flarum\Api\Controller;
use Flarum\Api\Event\WillGetData;
use Flarum\Api\Event\WillSerializeData;
use Flarum\Api\JsonApiResponse;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
@@ -77,11 +74,6 @@ abstract class AbstractSerializeController implements RequestHandlerInterface
*/
protected static $container;
/**
* @var Dispatcher
*/
protected static $events;
/**
* @var array
*/
@@ -107,11 +99,6 @@ abstract class AbstractSerializeController implements RequestHandlerInterface
}
}
// Deprected in beta 15, removed in beta 16
static::$events->dispatch(
new WillGetData($this)
);
$data = $this->data($request, $document);
foreach (array_reverse(array_merge([static::class], class_parents($this))) as $class) {
@@ -122,11 +109,6 @@ abstract class AbstractSerializeController implements RequestHandlerInterface
}
}
// Deprecated in beta 15, removed in beta 16
static::$events->dispatch(
new WillSerializeData($this, $data, $request, $document)
);
$serializer = static::$container->make($this->serializer);
$serializer->setRequest($request);
@@ -325,22 +307,6 @@ abstract class AbstractSerializeController implements RequestHandlerInterface
$this->sort = $sort;
}
/**
* @return Dispatcher
*/
public static function getEventDispatcher()
{
return static::$events;
}
/**
* @param Dispatcher $events
*/
public static function setEventDispatcher(Dispatcher $events)
{
static::$events = $events;
}
/**
* @return Container
*/