mirror of
https://github.com/flarum/core.git
synced 2025-07-16 06:16:23 +02:00
Remove deprecated post types event
This commit is contained in:
@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Flarum.
|
|
||||||
*
|
|
||||||
* For detailed copyright and license information, please view the
|
|
||||||
* LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Flarum\Event;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated in beta 15, remove in beta 16. Use the Post extender instead.
|
|
||||||
*/
|
|
||||||
class ConfigurePostTypes
|
|
||||||
{
|
|
||||||
private $models;
|
|
||||||
|
|
||||||
public function __construct(array &$models)
|
|
||||||
{
|
|
||||||
$this->models = &$models;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function add($class)
|
|
||||||
{
|
|
||||||
$this->models[] = $class;
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,7 +10,6 @@
|
|||||||
namespace Flarum\Post;
|
namespace Flarum\Post;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Flarum\Event\ConfigurePostTypes;
|
|
||||||
use Flarum\Foundation\AbstractServiceProvider;
|
use Flarum\Foundation\AbstractServiceProvider;
|
||||||
use Flarum\Post\Access\ScopePostVisibility;
|
use Flarum\Post\Access\ScopePostVisibility;
|
||||||
|
|
||||||
@ -61,11 +60,6 @@ class PostServiceProvider extends AbstractServiceProvider
|
|||||||
DiscussionRenamedPost::class
|
DiscussionRenamedPost::class
|
||||||
];
|
];
|
||||||
|
|
||||||
// Deprecated in beta 15, remove in beta 16.
|
|
||||||
$this->app->make('events')->dispatch(
|
|
||||||
new ConfigurePostTypes($models)
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($models as $model) {
|
foreach ($models as $model) {
|
||||||
Post::setModel($model::$type, $model);
|
Post::setModel($model::$type, $model);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user