mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 13:36:10 +08:00
Move more event classes to appropriate namespaces
This commit is contained in:
parent
f33de84540
commit
cc118d4c29
|
@ -9,12 +9,12 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Event;
|
namespace Flarum\Discussion\Event;
|
||||||
|
|
||||||
use Flarum\Discussion\Search\DiscussionSearch;
|
use Flarum\Discussion\Search\DiscussionSearch;
|
||||||
use Flarum\Search\SearchCriteria;
|
use Flarum\Search\SearchCriteria;
|
||||||
|
|
||||||
class ConfigureDiscussionSearch
|
class Searching
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var DiscussionSearch
|
* @var DiscussionSearch
|
|
@ -13,7 +13,7 @@ namespace Flarum\Discussion\Search;
|
||||||
|
|
||||||
use Flarum\Discussion\Discussion;
|
use Flarum\Discussion\Discussion;
|
||||||
use Flarum\Discussion\DiscussionRepository;
|
use Flarum\Discussion\DiscussionRepository;
|
||||||
use Flarum\Event\ConfigureDiscussionSearch;
|
use Flarum\Discussion\Event\Searching;
|
||||||
use Flarum\Post\PostRepository;
|
use Flarum\Post\PostRepository;
|
||||||
use Flarum\Search\ApplySearchParametersTrait;
|
use Flarum\Search\ApplySearchParametersTrait;
|
||||||
use Flarum\Search\GambitManager;
|
use Flarum\Search\GambitManager;
|
||||||
|
@ -81,7 +81,7 @@ class DiscussionSearcher
|
||||||
$this->applyLimit($search, $limit + 1);
|
$this->applyLimit($search, $limit + 1);
|
||||||
|
|
||||||
// TODO: inject dispatcher
|
// TODO: inject dispatcher
|
||||||
event(new ConfigureDiscussionSearch($search, $criteria));
|
event(new Searching($search, $criteria));
|
||||||
|
|
||||||
// Execute the search query and retrieve the results. We get one more
|
// Execute the search query and retrieve the results. We get one more
|
||||||
// results than the user asked for, so that we can say if there are more
|
// results than the user asked for, so that we can say if there are more
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
namespace Flarum\User\Command;
|
namespace Flarum\User\Command;
|
||||||
|
|
||||||
use Flarum\Event\AvatarWillBeDeleted;
|
use Flarum\User\Event\AvatarDeleting;
|
||||||
use Flarum\Foundation\DispatchEventsTrait;
|
use Flarum\Foundation\DispatchEventsTrait;
|
||||||
use Flarum\User\AssertPermissionTrait;
|
use Flarum\User\AssertPermissionTrait;
|
||||||
use Flarum\User\UserRepository;
|
use Flarum\User\UserRepository;
|
||||||
|
@ -64,7 +64,7 @@ class DeleteAvatarHandler
|
||||||
$user->changeAvatarPath(null);
|
$user->changeAvatarPath(null);
|
||||||
|
|
||||||
$this->events->fire(
|
$this->events->fire(
|
||||||
new AvatarWillBeDeleted($user, $actor)
|
new AvatarDeleting($user, $actor)
|
||||||
);
|
);
|
||||||
|
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
namespace Flarum\User\Command;
|
namespace Flarum\User\Command;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Flarum\Event\AvatarWillBeSaved;
|
use Flarum\User\Event\AvatarSaving;
|
||||||
use Flarum\Foundation\Application;
|
use Flarum\Foundation\Application;
|
||||||
use Flarum\Foundation\DispatchEventsTrait;
|
use Flarum\Foundation\DispatchEventsTrait;
|
||||||
use Flarum\User\AssertPermissionTrait;
|
use Flarum\User\AssertPermissionTrait;
|
||||||
|
@ -110,7 +110,7 @@ class UploadAvatarHandler
|
||||||
file_put_contents($tmpFile, $encodedImage);
|
file_put_contents($tmpFile, $encodedImage);
|
||||||
|
|
||||||
$this->events->fire(
|
$this->events->fire(
|
||||||
new AvatarWillBeSaved($user, $actor, $tmpFile)
|
new AvatarSaving($user, $actor, $tmpFile)
|
||||||
);
|
);
|
||||||
|
|
||||||
$mount = new MountManager([
|
$mount = new MountManager([
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Event;
|
namespace Flarum\User\Event;
|
||||||
|
|
||||||
use Flarum\User\User;
|
use Flarum\User\User;
|
||||||
|
|
||||||
class AvatarWillBeDeleted
|
class AvatarDeleting
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The user whose avatar will be deleted.
|
* The user whose avatar will be deleted.
|
|
@ -9,11 +9,11 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Event;
|
namespace Flarum\User\Event;
|
||||||
|
|
||||||
use Flarum\User\User;
|
use Flarum\User\User;
|
||||||
|
|
||||||
class AvatarWillBeSaved
|
class AvatarSaving
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The user whose avatar will be saved.
|
* The user whose avatar will be saved.
|
|
@ -9,12 +9,12 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Flarum\Event;
|
namespace Flarum\User\Event;
|
||||||
|
|
||||||
use Flarum\Search\SearchCriteria;
|
use Flarum\Search\SearchCriteria;
|
||||||
use Flarum\User\Search\UserSearch;
|
use Flarum\User\Search\UserSearch;
|
||||||
|
|
||||||
class ConfigureUserSearch
|
class Searching
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var \Flarum\User\Search\UserSearch
|
* @var \Flarum\User\Search\UserSearch
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
namespace Flarum\User\Search;
|
namespace Flarum\User\Search;
|
||||||
|
|
||||||
use Flarum\Event\ConfigureUserSearch;
|
use Flarum\User\Event\Searching;
|
||||||
use Flarum\Search\ApplySearchParametersTrait;
|
use Flarum\Search\ApplySearchParametersTrait;
|
||||||
use Flarum\Search\GambitManager;
|
use Flarum\Search\GambitManager;
|
||||||
use Flarum\Search\SearchCriteria;
|
use Flarum\Search\SearchCriteria;
|
||||||
|
@ -69,7 +69,7 @@ class UserSearcher
|
||||||
$this->applyOffset($search, $offset);
|
$this->applyOffset($search, $offset);
|
||||||
$this->applyLimit($search, $limit + 1);
|
$this->applyLimit($search, $limit + 1);
|
||||||
|
|
||||||
event(new ConfigureUserSearch($search, $criteria));
|
event(new Searching($search, $criteria));
|
||||||
|
|
||||||
// Execute the search query and retrieve the results. We get one more
|
// Execute the search query and retrieve the results. We get one more
|
||||||
// results than the user asked for, so that we can say if there are more
|
// results than the user asked for, so that we can say if there are more
|
||||||
|
|
Loading…
Reference in New Issue
Block a user