mirror of
https://github.com/flarum/core.git
synced 2025-08-07 08:56:38 +02:00
Apply namespace changes for beta 8 (#7)
* Update for beta 8 * Remove docblock * StyleCI is a stickler
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace Flarum\Akismet\Listener;
|
namespace Flarum\Akismet\Listener;
|
||||||
|
|
||||||
use Flarum\Event\ConfigureWebApp;
|
use Flarum\Frontend\Event\Rendering;
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
|
|
||||||
class AddClientAssets
|
class AddClientAssets
|
||||||
@@ -21,13 +21,11 @@ class AddClientAssets
|
|||||||
*/
|
*/
|
||||||
public function subscribe(Dispatcher $events)
|
public function subscribe(Dispatcher $events)
|
||||||
{
|
{
|
||||||
$events->listen(ConfigureWebApp::class, [$this, 'addAssets']);
|
$events->listen(Rendering::class, [$this, 'addAssets']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function addAssets(Rendering $event)
|
||||||
* @param ConfigureClientView $event
|
|
||||||
*/
|
|
||||||
public function addAssets(ConfigureWebApp $event)
|
|
||||||
{
|
{
|
||||||
if ($event->isForum()) {
|
if ($event->isForum()) {
|
||||||
$event->addAssets([
|
$event->addAssets([
|
||||||
|
@@ -12,10 +12,10 @@
|
|||||||
namespace Flarum\Akismet\Listener;
|
namespace Flarum\Akismet\Listener;
|
||||||
|
|
||||||
use Flarum\Approval\Event\PostWasApproved;
|
use Flarum\Approval\Event\PostWasApproved;
|
||||||
use Flarum\Event\PostWasHidden;
|
|
||||||
use Flarum\Event\PostWillBeSaved;
|
|
||||||
use Flarum\Flags\Flag;
|
use Flarum\Flags\Flag;
|
||||||
use Flarum\Foundation\Application;
|
use Flarum\Foundation\Application;
|
||||||
|
use Flarum\Post\Event\Hidden;
|
||||||
|
use Flarum\Post\Event\Saving;
|
||||||
use Flarum\Settings\SettingsRepositoryInterface;
|
use Flarum\Settings\SettingsRepositoryInterface;
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
use TijsVerkoyen\Akismet\Akismet;
|
use TijsVerkoyen\Akismet\Akismet;
|
||||||
@@ -47,15 +47,15 @@ class FilterNewPosts
|
|||||||
*/
|
*/
|
||||||
public function subscribe(Dispatcher $events)
|
public function subscribe(Dispatcher $events)
|
||||||
{
|
{
|
||||||
$events->listen(PostWillBeSaved::class, [$this, 'validatePost']);
|
$events->listen(Saving::class, [$this, 'validatePost']);
|
||||||
$events->listen(PostWasApproved::class, [$this, 'submitHam']);
|
$events->listen(PostWasApproved::class, [$this, 'submitHam']);
|
||||||
$events->listen(PostWasHidden::class, [$this, 'submitSpam']);
|
$events->listen(Hidden::class, [$this, 'submitSpam']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param PostWillBeSaved $event
|
* @param Saving $event
|
||||||
*/
|
*/
|
||||||
public function validatePost(PostWillBeSaved $event)
|
public function validatePost(Saving $event)
|
||||||
{
|
{
|
||||||
$post = $event->post;
|
$post = $event->post;
|
||||||
|
|
||||||
@@ -111,9 +111,9 @@ class FilterNewPosts
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param PostWasHidden $event
|
* @param Hidden $event
|
||||||
*/
|
*/
|
||||||
public function submitSpam(PostWasHidden $event)
|
public function submitSpam(Hidden $event)
|
||||||
{
|
{
|
||||||
$post = $event->post;
|
$post = $event->post;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user