diff --git a/src/Api/Controller/ListDiscussionsController.php b/src/Api/Controller/ListDiscussionsController.php index a1acdb651..d69e07de6 100644 --- a/src/Api/Controller/ListDiscussionsController.php +++ b/src/Api/Controller/ListDiscussionsController.php @@ -13,7 +13,7 @@ namespace Flarum\Api\Controller; use Flarum\Api\UrlGenerator; use Flarum\Discussion\Search\DiscussionSearcher; -use Flarum\Core\Search\SearchCriteria; +use Flarum\Search\SearchCriteria; use Psr\Http\Message\ServerRequestInterface; use Tobscure\JsonApi\Document; diff --git a/src/Api/Controller/ListUsersController.php b/src/Api/Controller/ListUsersController.php index 7d1f6526f..1dadbb103 100644 --- a/src/Api/Controller/ListUsersController.php +++ b/src/Api/Controller/ListUsersController.php @@ -13,7 +13,7 @@ namespace Flarum\Api\Controller; use Flarum\Api\UrlGenerator; use Flarum\User\Exception\PermissionDeniedException; -use Flarum\Core\Search\SearchCriteria; +use Flarum\Search\SearchCriteria; use Flarum\Core\User\Search\UserSearcher; use Psr\Http\Message\ServerRequestInterface; use Tobscure\JsonApi\Document; diff --git a/src/Core/CoreServiceProvider.php b/src/Core/CoreServiceProvider.php index 106201d86..088733ce8 100644 --- a/src/Core/CoreServiceProvider.php +++ b/src/Core/CoreServiceProvider.php @@ -41,7 +41,7 @@ class CoreServiceProvider extends AbstractServiceProvider $this->registerAvatarsFilesystem(); $this->app->register('Flarum\Core\Notification\NotificationServiceProvider'); - $this->app->register('Flarum\Core\Search\SearchServiceProvider'); + $this->app->register('Flarum\Search\SearchServiceProvider'); $this->app->register('Flarum\Formatter\FormatterServiceProvider'); } diff --git a/src/Discussion/Search/DiscussionSearch.php b/src/Discussion/Search/DiscussionSearch.php index bde618ef1..8cb886e29 100644 --- a/src/Discussion/Search/DiscussionSearch.php +++ b/src/Discussion/Search/DiscussionSearch.php @@ -11,7 +11,7 @@ namespace Flarum\Discussion\Search; -use Flarum\Core\Search\AbstractSearch; +use Flarum\Search\AbstractSearch; /** * An object which represents the internal state of a search for discussions: diff --git a/src/Discussion/Search/DiscussionSearcher.php b/src/Discussion/Search/DiscussionSearcher.php index aacce651d..81ac2803a 100644 --- a/src/Discussion/Search/DiscussionSearcher.php +++ b/src/Discussion/Search/DiscussionSearcher.php @@ -15,10 +15,10 @@ use Flarum\Discussion\Discussion; use Flarum\Discussion\DiscussionRepository; use Flarum\Discussion\Search\DiscussionSearch; use Flarum\Post\PostRepository; -use Flarum\Core\Search\ApplySearchParametersTrait; -use Flarum\Core\Search\GambitManager; -use Flarum\Core\Search\SearchCriteria; -use Flarum\Core\Search\SearchResults; +use Flarum\Search\ApplySearchParametersTrait; +use Flarum\Search\GambitManager; +use Flarum\Search\SearchCriteria; +use Flarum\Search\SearchResults; use Flarum\Event\ConfigureDiscussionSearch; use Illuminate\Database\Eloquent\Collection; @@ -31,7 +31,7 @@ class DiscussionSearcher use ApplySearchParametersTrait; /** - * @var GambitManager + * @var \Flarum\Search\GambitManager */ protected $gambits; @@ -46,7 +46,7 @@ class DiscussionSearcher protected $posts; /** - * @param GambitManager $gambits + * @param \Flarum\Search\GambitManager $gambits * @param DiscussionRepository $discussions * @param PostRepository $posts */ @@ -61,13 +61,13 @@ class DiscussionSearcher } /** - * @param SearchCriteria $criteria + * @param \Flarum\Search\SearchCriteria $criteria * @param int|null $limit * @param int $offset * @param array $load An array of relationships to load on the results. - * @return SearchResults + * @return \Flarum\Search\SearchResults */ - public function search(SearchCriteria $criteria, $limit = null, $offset = 0, array $load = []) + public function search(\Flarum\Search\SearchCriteria $criteria, $limit = null, $offset = 0, array $load = []) { $actor = $criteria->actor; @@ -110,7 +110,7 @@ class DiscussionSearcher Discussion::setStateUser($actor); $discussions->load($load); - return new SearchResults($discussions, $areMoreResults); + return new \Flarum\Search\SearchResults($discussions, $areMoreResults); } /** diff --git a/src/Discussion/Search/Gambit/AuthorGambit.php b/src/Discussion/Search/Gambit/AuthorGambit.php index 10492e981..15e425512 100644 --- a/src/Discussion/Search/Gambit/AuthorGambit.php +++ b/src/Discussion/Search/Gambit/AuthorGambit.php @@ -12,8 +12,8 @@ namespace Flarum\Discussion\Search\Gambit; use Flarum\User\UserRepository; -use Flarum\Core\Search\AbstractRegexGambit; -use Flarum\Core\Search\AbstractSearch; +use Flarum\Search\AbstractRegexGambit; +use Flarum\Search\AbstractSearch; use Flarum\Discussion\Search\DiscussionSearch; use LogicException; diff --git a/src/Discussion/Search/Gambit/CreatedGambit.php b/src/Discussion/Search/Gambit/CreatedGambit.php index 244930d45..0b38fec35 100644 --- a/src/Discussion/Search/Gambit/CreatedGambit.php +++ b/src/Discussion/Search/Gambit/CreatedGambit.php @@ -11,8 +11,8 @@ namespace Flarum\Discussion\Search\Gambit; -use Flarum\Core\Search\AbstractRegexGambit; -use Flarum\Core\Search\AbstractSearch; +use Flarum\Search\AbstractRegexGambit; +use Flarum\Search\AbstractSearch; use Flarum\Discussion\Search\DiscussionSearch; use LogicException; diff --git a/src/Discussion/Search/Gambit/FulltextGambit.php b/src/Discussion/Search/Gambit/FulltextGambit.php index f28ccf412..da54f358f 100644 --- a/src/Discussion/Search/Gambit/FulltextGambit.php +++ b/src/Discussion/Search/Gambit/FulltextGambit.php @@ -11,10 +11,10 @@ namespace Flarum\Discussion\Search\Gambit; -use Flarum\Core\Search\AbstractSearch; +use Flarum\Search\AbstractSearch; use Flarum\Discussion\Search\DiscussionSearch; use Flarum\Discussion\Search\Fulltext\DriverInterface; -use Flarum\Core\Search\GambitInterface; +use Flarum\Search\GambitInterface; use LogicException; class FulltextGambit implements GambitInterface diff --git a/src/Discussion/Search/Gambit/HiddenGambit.php b/src/Discussion/Search/Gambit/HiddenGambit.php index 99c544741..9bd1c7b24 100644 --- a/src/Discussion/Search/Gambit/HiddenGambit.php +++ b/src/Discussion/Search/Gambit/HiddenGambit.php @@ -11,8 +11,8 @@ namespace Flarum\Discussion\Search\Gambit; -use Flarum\Core\Search\AbstractRegexGambit; -use Flarum\Core\Search\AbstractSearch; +use Flarum\Search\AbstractRegexGambit; +use Flarum\Search\AbstractSearch; use Flarum\Discussion\Search\DiscussionSearch; use LogicException; diff --git a/src/Discussion/Search/Gambit/UnreadGambit.php b/src/Discussion/Search/Gambit/UnreadGambit.php index 29f3b2f10..87eb7cfe2 100644 --- a/src/Discussion/Search/Gambit/UnreadGambit.php +++ b/src/Discussion/Search/Gambit/UnreadGambit.php @@ -12,8 +12,8 @@ namespace Flarum\Discussion\Search\Gambit; use Flarum\Discussion\DiscussionRepository; -use Flarum\Core\Search\AbstractRegexGambit; -use Flarum\Core\Search\AbstractSearch; +use Flarum\Search\AbstractRegexGambit; +use Flarum\Search\AbstractSearch; use Flarum\Discussion\Search\DiscussionSearch; use LogicException; diff --git a/src/Event/AbstractConfigureGambits.php b/src/Event/AbstractConfigureGambits.php index 1889ea861..0513eba48 100644 --- a/src/Event/AbstractConfigureGambits.php +++ b/src/Event/AbstractConfigureGambits.php @@ -11,7 +11,7 @@ namespace Flarum\Event; -use Flarum\Core\Search\GambitManager; +use Flarum\Search\GambitManager; abstract class AbstractConfigureGambits { @@ -21,7 +21,7 @@ abstract class AbstractConfigureGambits public $gambits; /** - * @param GambitManager $gambits + * @param \Flarum\Search\GambitManager $gambits */ public function __construct(GambitManager $gambits) { diff --git a/src/Event/ConfigureDiscussionSearch.php b/src/Event/ConfigureDiscussionSearch.php index f86d29fea..2b126046e 100644 --- a/src/Event/ConfigureDiscussionSearch.php +++ b/src/Event/ConfigureDiscussionSearch.php @@ -12,7 +12,7 @@ namespace Flarum\Event; use Flarum\Discussion\Search\DiscussionSearch; -use Flarum\Core\Search\SearchCriteria; +use Flarum\Search\SearchCriteria; class ConfigureDiscussionSearch { @@ -22,13 +22,13 @@ class ConfigureDiscussionSearch public $search; /** - * @var SearchCriteria + * @var \Flarum\Search\SearchCriteria */ public $criteria; /** * @param DiscussionSearch $search - * @param SearchCriteria $criteria + * @param \Flarum\Search\SearchCriteria $criteria */ public function __construct(DiscussionSearch $search, SearchCriteria $criteria) { diff --git a/src/Event/ConfigureUserSearch.php b/src/Event/ConfigureUserSearch.php index d32670705..309f60c10 100644 --- a/src/Event/ConfigureUserSearch.php +++ b/src/Event/ConfigureUserSearch.php @@ -11,7 +11,7 @@ namespace Flarum\Event; -use Flarum\Core\Search\SearchCriteria; +use Flarum\Search\SearchCriteria; use Flarum\Core\User\Search\UserSearch; class ConfigureUserSearch diff --git a/src/Core/Search/AbstractRegexGambit.php b/src/Search/AbstractRegexGambit.php similarity index 97% rename from src/Core/Search/AbstractRegexGambit.php rename to src/Search/AbstractRegexGambit.php index b15a83ddf..4771783a6 100644 --- a/src/Core/Search/AbstractRegexGambit.php +++ b/src/Search/AbstractRegexGambit.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Flarum\Core\Search; +namespace Flarum\Search; abstract class AbstractRegexGambit implements GambitInterface { diff --git a/src/Core/Search/AbstractSearch.php b/src/Search/AbstractSearch.php similarity index 98% rename from src/Core/Search/AbstractSearch.php rename to src/Search/AbstractSearch.php index c4f54250d..23e7c4b78 100644 --- a/src/Core/Search/AbstractSearch.php +++ b/src/Search/AbstractSearch.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Flarum\Core\Search; +namespace Flarum\Search; use Flarum\User\User; use Illuminate\Database\Query\Builder; diff --git a/src/Core/Search/ApplySearchParametersTrait.php b/src/Search/ApplySearchParametersTrait.php similarity index 97% rename from src/Core/Search/ApplySearchParametersTrait.php rename to src/Search/ApplySearchParametersTrait.php index 4854eefb5..58691946c 100644 --- a/src/Core/Search/ApplySearchParametersTrait.php +++ b/src/Search/ApplySearchParametersTrait.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Flarum\Core\Search; +namespace Flarum\Search; trait ApplySearchParametersTrait { diff --git a/src/Core/Search/GambitInterface.php b/src/Search/GambitInterface.php similarity index 95% rename from src/Core/Search/GambitInterface.php rename to src/Search/GambitInterface.php index 7ecb13fda..bcc9f4c9f 100644 --- a/src/Core/Search/GambitInterface.php +++ b/src/Search/GambitInterface.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Flarum\Core\Search; +namespace Flarum\Search; interface GambitInterface { diff --git a/src/Core/Search/GambitManager.php b/src/Search/GambitManager.php similarity index 99% rename from src/Core/Search/GambitManager.php rename to src/Search/GambitManager.php index 6a912f14f..391b42f0c 100644 --- a/src/Core/Search/GambitManager.php +++ b/src/Search/GambitManager.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Flarum\Core\Search; +namespace Flarum\Search; use Illuminate\Contracts\Container\Container; use LogicException; diff --git a/src/Core/Search/SearchCriteria.php b/src/Search/SearchCriteria.php similarity index 97% rename from src/Core/Search/SearchCriteria.php rename to src/Search/SearchCriteria.php index 567155d8b..be5d598b0 100644 --- a/src/Core/Search/SearchCriteria.php +++ b/src/Search/SearchCriteria.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Flarum\Core\Search; +namespace Flarum\Search; use Flarum\User\User; diff --git a/src/Core/Search/SearchResults.php b/src/Search/SearchResults.php similarity index 96% rename from src/Core/Search/SearchResults.php rename to src/Search/SearchResults.php index 1d85b67e3..d7841320b 100644 --- a/src/Core/Search/SearchResults.php +++ b/src/Search/SearchResults.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Flarum\Core\Search; +namespace Flarum\Search; use Illuminate\Database\Eloquent\Collection; diff --git a/src/Core/Search/SearchServiceProvider.php b/src/Search/SearchServiceProvider.php similarity index 94% rename from src/Core/Search/SearchServiceProvider.php rename to src/Search/SearchServiceProvider.php index 554a6bd7b..9b2ded54b 100644 --- a/src/Core/Search/SearchServiceProvider.php +++ b/src/Search/SearchServiceProvider.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Flarum\Core\Search; +namespace Flarum\Search; use Flarum\Event\ConfigureDiscussionGambits; use Flarum\Event\ConfigureUserGambits; @@ -38,7 +38,7 @@ class SearchServiceProvider extends AbstractServiceProvider public function registerUserGambits() { $this->app->when('Flarum\Core\User\Search\UserSearcher') - ->needs('Flarum\Core\Search\GambitManager') + ->needs('Flarum\Search\GambitManager') ->give(function (Container $app) { $gambits = new GambitManager($app); @@ -57,7 +57,7 @@ class SearchServiceProvider extends AbstractServiceProvider public function registerDiscussionGambits() { $this->app->when('Flarum\Discussion\Search\DiscussionSearcher') - ->needs('Flarum\Core\Search\GambitManager') + ->needs('Flarum\Search\GambitManager') ->give(function (Container $app) { $gambits = new GambitManager($app); diff --git a/src/User/Search/Gambit/EmailGambit.php b/src/User/Search/Gambit/EmailGambit.php index 11b0b793a..3d12c02ed 100644 --- a/src/User/Search/Gambit/EmailGambit.php +++ b/src/User/Search/Gambit/EmailGambit.php @@ -12,8 +12,8 @@ namespace Flarum\Core\User\Search\Gambit; use Flarum\User\UserRepository; -use Flarum\Core\Search\AbstractRegexGambit; -use Flarum\Core\Search\AbstractSearch; +use Flarum\Search\AbstractRegexGambit; +use Flarum\Search\AbstractSearch; use Flarum\Core\User\Search\UserSearch; use LogicException; diff --git a/src/User/Search/Gambit/FulltextGambit.php b/src/User/Search/Gambit/FulltextGambit.php index c8349d740..0d2c02baa 100644 --- a/src/User/Search/Gambit/FulltextGambit.php +++ b/src/User/Search/Gambit/FulltextGambit.php @@ -12,8 +12,8 @@ namespace Flarum\Core\User\Search\Gambit; use Flarum\User\UserRepository; -use Flarum\Core\Search\AbstractSearch; -use Flarum\Core\Search\GambitInterface; +use Flarum\Search\AbstractSearch; +use Flarum\Search\GambitInterface; class FulltextGambit implements GambitInterface { diff --git a/src/User/Search/Gambit/GroupGambit.php b/src/User/Search/Gambit/GroupGambit.php index abe1ad984..b8c627bde 100644 --- a/src/User/Search/Gambit/GroupGambit.php +++ b/src/User/Search/Gambit/GroupGambit.php @@ -12,8 +12,8 @@ namespace Flarum\Core\User\Search\Gambit; use Flarum\Core\Repository\GroupRepository; -use Flarum\Core\Search\AbstractRegexGambit; -use Flarum\Core\Search\AbstractSearch; +use Flarum\Search\AbstractRegexGambit; +use Flarum\Search\AbstractSearch; use Flarum\Core\User\Search\UserSearch; use LogicException; diff --git a/src/User/Search/UserSearch.php b/src/User/Search/UserSearch.php index 9223dbd04..d26620f5e 100644 --- a/src/User/Search/UserSearch.php +++ b/src/User/Search/UserSearch.php @@ -11,7 +11,7 @@ namespace Flarum\Core\User\Search; -use Flarum\Core\Search\AbstractSearch; +use Flarum\Search\AbstractSearch; class UserSearch extends AbstractSearch { diff --git a/src/User/Search/UserSearcher.php b/src/User/Search/UserSearcher.php index 0043deb1d..13b0838aa 100644 --- a/src/User/Search/UserSearcher.php +++ b/src/User/Search/UserSearcher.php @@ -13,10 +13,10 @@ namespace Flarum\Core\User\Search; use Flarum\Core\User\Search\UserSearch; use Flarum\User\UserRepository; -use Flarum\Core\Search\ApplySearchParametersTrait; -use Flarum\Core\Search\GambitManager; -use Flarum\Core\Search\SearchCriteria; -use Flarum\Core\Search\SearchResults; +use Flarum\Search\ApplySearchParametersTrait; +use Flarum\Search\GambitManager; +use Flarum\Search\SearchCriteria; +use Flarum\Search\SearchResults; use Flarum\Event\ConfigureUserSearch; /** @@ -28,7 +28,7 @@ class UserSearcher use ApplySearchParametersTrait; /** - * @var GambitManager + * @var \Flarum\Search\GambitManager */ protected $gambits; @@ -38,10 +38,10 @@ class UserSearcher protected $users; /** - * @param GambitManager $gambits + * @param \Flarum\Search\GambitManager $gambits * @param \Flarum\User\UserRepository $users */ - public function __construct(GambitManager $gambits, UserRepository $users) + public function __construct(\Flarum\Search\GambitManager $gambits, UserRepository $users) { $this->gambits = $gambits; $this->users = $users; @@ -52,9 +52,9 @@ class UserSearcher * @param int|null $limit * @param int $offset * @param array $load An array of relationships to load on the results. - * @return SearchResults + * @return \Flarum\Search\SearchResults */ - public function search(SearchCriteria $criteria, $limit = null, $offset = 0, array $load = []) + public function search(\Flarum\Search\SearchCriteria $criteria, $limit = null, $offset = 0, array $load = []) { $actor = $criteria->actor; @@ -83,6 +83,6 @@ class UserSearcher $users->load($load); - return new SearchResults($users, $areMoreResults); + return new \Flarum\Search\SearchResults($users, $areMoreResults); } }