1
0
mirror of https://github.com/flarum/core.git synced 2025-10-14 08:24:28 +02:00

Move events to Flarum\Extension\Event namespace

This commit is contained in:
Franz Liedke
2017-06-24 13:31:13 +02:00
parent 6cd6a7d260
commit 9abc63aaac
10 changed files with 60 additions and 60 deletions

View File

@@ -0,0 +1,30 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Extension\Event;
use Flarum\Extension\Extension;
class Disabled
{
/**
* @var Extension
*/
public $extension;
/**
* @param Extension $extension
*/
public function __construct(Extension $extension)
{
$this->extension = $extension;
}
}

View File

@@ -0,0 +1,30 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Extension\Event;
use Flarum\Extension\Extension;
class Disabling
{
/**
* @var Extension
*/
public $extension;
/**
* @param Extension $extension
*/
public function __construct(Extension $extension)
{
$this->extension = $extension;
}
}

View File

@@ -0,0 +1,30 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Extension\Event;
use Flarum\Extension\Extension;
class Enabled
{
/**
* @var Extension
*/
public $extension;
/**
* @param Extension $extension
*/
public function __construct(Extension $extension)
{
$this->extension = $extension;
}
}

View File

@@ -0,0 +1,30 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Extension\Event;
use Flarum\Extension\Extension;
class Enabling
{
/**
* @var Extension
*/
public $extension;
/**
* @param Extension $extension
*/
public function __construct(Extension $extension)
{
$this->extension = $extension;
}
}

View File

@@ -0,0 +1,30 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Extension\Event;
use Flarum\Extension\Extension;
class Uninstalled
{
/**
* @var Extension
*/
public $extension;
/**
* @param Extension $extension
*/
public function __construct(Extension $extension)
{
$this->extension = $extension;
}
}

View File

@@ -12,11 +12,11 @@
namespace Flarum\Extension;
use Flarum\Database\Migrator;
use Flarum\Event\ExtensionWasDisabled;
use Flarum\Event\ExtensionWasEnabled;
use Flarum\Event\ExtensionWasUninstalled;
use Flarum\Event\ExtensionWillBeDisabled;
use Flarum\Event\ExtensionWillBeEnabled;
use Flarum\Extension\Event\Disabled;
use Flarum\Extension\Event\Enabled;
use Flarum\Extension\Event\Uninstalled;
use Flarum\Extension\Event\Disabling;
use Flarum\Extension\Event\Enabling;
use Flarum\Foundation\Application;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Events\Dispatcher;
@@ -115,7 +115,7 @@ class ExtensionManager
if (! $this->isEnabled($name)) {
$extension = $this->getExtension($name);
$this->dispatcher->fire(new ExtensionWillBeEnabled($extension));
$this->dispatcher->fire(new Enabling($extension));
$enabled = $this->getEnabled();
@@ -129,7 +129,7 @@ class ExtensionManager
$extension->setEnabled(true);
$this->dispatcher->fire(new ExtensionWasEnabled($extension));
$this->dispatcher->fire(new Enabled($extension));
}
}
@@ -145,7 +145,7 @@ class ExtensionManager
if (($k = array_search($name, $enabled)) !== false) {
$extension = $this->getExtension($name);
$this->dispatcher->fire(new ExtensionWillBeDisabled($extension));
$this->dispatcher->fire(new Disabling($extension));
unset($enabled[$k]);
@@ -153,7 +153,7 @@ class ExtensionManager
$extension->setEnabled(false);
$this->dispatcher->fire(new ExtensionWasDisabled($extension));
$this->dispatcher->fire(new Disabled($extension));
}
}
@@ -174,7 +174,7 @@ class ExtensionManager
$extension->setInstalled(false);
$this->dispatcher->fire(new ExtensionWasUninstalled($extension));
$this->dispatcher->fire(new Uninstalled($extension));
}
/**