Remove old files

This commit is contained in:
Toby Zerner 2015-08-13 12:56:26 +09:30
parent 0a19ca5e19
commit 7040ad1344
3 changed files with 0 additions and 72 deletions

View File

@ -1,17 +0,0 @@
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M
modules:
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/_data/dump.sql

View File

@ -43,29 +43,9 @@ class ApiServiceProvider extends ServiceProvider
{
$this->routes();
$this->registerActivitySerializers();
$this->registerNotificationSerializers();
}
/**
* Register activity serializers.
*/
protected function registerActivitySerializers()
{
$blueprints = [];
$serializers = [
'posted' => 'Flarum\Api\Serializers\PostBasicSerializer',
'startedDiscussion' => 'Flarum\Api\Serializers\PostBasicSerializer',
'joined' => 'Flarum\Api\Serializers\UserSerializer'
];
event(new RegisterActivityTypes($blueprints, $serializers));
foreach ($serializers as $type => $serializer) {
ActivitySerializer::setSubjectSerializer($type, $serializer);
}
}
/**
* Register notification serializers.
*/

View File

@ -1,35 +0,0 @@
<?php namespace Flarum\Events;
use InvalidArgumentException;
use ReflectionClass;
class RegisterActivityTypes
{
/**
* @var array
*/
protected $blueprints;
/**
* @var array
*/
protected $serializers;
public function __construct(array &$blueprints, array &$serializers = [])
{
$this->blueprints = &$blueprints;
$this->serializers = &$serializers;
}
public function register($blueprint, $serializer)
{
if (! (new ReflectionClass($blueprint))->implementsInterface('Flarum\Core\Activity\Blueprint')) {
throw new InvalidArgumentException('Activity blueprint ' . $blueprint
. ' must implement Flarum\Core\Activity\Blueprint');
}
$this->blueprints[] = $blueprint;
$this->serializers[$blueprint::getType()] = $serializer;
}
}