mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:33:47 +08:00
Apply fixes from StyleCI
[ci skip] [skip ci]
This commit is contained in:
parent
9212330ac2
commit
4413848c11
|
@ -26,11 +26,13 @@ class BusServiceProvider extends AbstractServiceProvider
|
|||
});
|
||||
|
||||
$this->app->alias(
|
||||
BaseDispatcher::class, DispatcherContract::class
|
||||
BaseDispatcher::class,
|
||||
DispatcherContract::class
|
||||
);
|
||||
|
||||
$this->app->alias(
|
||||
BaseDispatcher::class, QueueingDispatcherContract::class
|
||||
BaseDispatcher::class,
|
||||
QueueingDispatcherContract::class
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,8 @@ class DiscussionServiceProvider extends AbstractServiceProvider
|
|||
$events->subscribe(DiscussionPolicy::class);
|
||||
|
||||
$events->listen(
|
||||
Renamed::class, DiscussionRenamedLogger::class
|
||||
Renamed::class,
|
||||
DiscussionRenamedLogger::class
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,9 @@ class FulltextGambit implements GambitInterface
|
|||
->addSelect('posts_ft.most_relevant_post_id')
|
||||
->join(
|
||||
new Expression('('.$subquery->toSql().') '.$grammar->wrapTable('posts_ft')),
|
||||
'posts_ft.discussion_id', '=', 'discussions.id'
|
||||
'posts_ft.discussion_id',
|
||||
'=',
|
||||
'discussions.id'
|
||||
)
|
||||
->addBinding($subquery->getBindings(), 'join')
|
||||
->where(function ($query) use ($grammar, $bit) {
|
||||
|
|
|
@ -152,7 +152,8 @@ class Frontend implements ExtenderInterface
|
|||
|
||||
foreach ($this->routes as $route) {
|
||||
$collection->get(
|
||||
$route['path'], $route['name'],
|
||||
$route['path'],
|
||||
$route['name'],
|
||||
$factory->toFrontend($this->frontend, $route['content'])
|
||||
);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,8 @@ class Middleware implements ExtenderInterface
|
|||
}
|
||||
|
||||
foreach ($this->replaceMiddlewares as $originalMiddleware => $newMiddleware) {
|
||||
$existingMiddleware = array_replace($existingMiddleware,
|
||||
$existingMiddleware = array_replace(
|
||||
$existingMiddleware,
|
||||
array_fill_keys(
|
||||
array_keys($existingMiddleware, $originalMiddleware),
|
||||
$newMiddleware
|
||||
|
@ -78,7 +79,8 @@ class Middleware implements ExtenderInterface
|
|||
}
|
||||
|
||||
foreach ($this->insertBeforeMiddlewares as $originalMiddleware => $newMiddleware) {
|
||||
array_splice($existingMiddleware,
|
||||
array_splice(
|
||||
$existingMiddleware,
|
||||
array_search($originalMiddleware, $existingMiddleware),
|
||||
0,
|
||||
$newMiddleware
|
||||
|
@ -86,7 +88,8 @@ class Middleware implements ExtenderInterface
|
|||
}
|
||||
|
||||
foreach ($this->insertAfterMiddlewares as $originalMiddleware => $newMiddleware) {
|
||||
array_splice($existingMiddleware,
|
||||
array_splice(
|
||||
$existingMiddleware,
|
||||
array_search($originalMiddleware, $existingMiddleware) + 1,
|
||||
0,
|
||||
$newMiddleware
|
||||
|
|
|
@ -17,7 +17,9 @@ class IlluminateValidationExceptionHandler
|
|||
public function handle(ValidationException $e): HandledError
|
||||
{
|
||||
return (new HandledError(
|
||||
$e, 'validation_error', 422
|
||||
$e,
|
||||
'validation_error',
|
||||
422
|
||||
))->withDetails($this->errorDetails($e));
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,9 @@ class ValidationExceptionHandler
|
|||
public function handle(ValidationException $e)
|
||||
{
|
||||
return (new HandledError(
|
||||
$e, 'validation_error', 422
|
||||
$e,
|
||||
'validation_error',
|
||||
422
|
||||
))->withDetails(array_merge(
|
||||
$this->buildDetails($e->getAttributes(), '/data/attributes'),
|
||||
$this->buildDetails($e->getRelationships(), '/data/relationships')
|
||||
|
|
|
@ -89,7 +89,9 @@ class UninstalledSite implements SiteInterface
|
|||
$dispatcher = $app->make(Dispatcher::class);
|
||||
|
||||
return new \Illuminate\View\Factory(
|
||||
$engines, $finder, $dispatcher
|
||||
$engines,
|
||||
$finder,
|
||||
$dispatcher
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -44,7 +44,8 @@ class ShareErrorsFromSession implements Middleware
|
|||
// its value with all view instances so the views can easily access errors
|
||||
// without having to bind. An empty bag is set when there aren't errors.
|
||||
$this->view->share(
|
||||
'errors', $session->get('errors', new ViewErrorBag)
|
||||
'errors',
|
||||
$session->get('errors', new ViewErrorBag)
|
||||
);
|
||||
|
||||
// Putting the errors in the view for every view allows the developer to just
|
||||
|
|
|
@ -120,7 +120,10 @@ class Installation
|
|||
|
||||
$pipeline->pipe(function () {
|
||||
return new Steps\StoreConfig(
|
||||
$this->debug, $this->dbConfig, $this->baseUrl, $this->getConfigPath()
|
||||
$this->debug,
|
||||
$this->dbConfig,
|
||||
$this->baseUrl,
|
||||
$this->getConfigPath()
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -49,7 +49,8 @@ class RunMigrations implements Step
|
|||
private function getMigrator()
|
||||
{
|
||||
$repository = new DatabaseMigrationRepository(
|
||||
$this->database, 'migrations'
|
||||
$this->database,
|
||||
'migrations'
|
||||
);
|
||||
$files = new Filesystem;
|
||||
|
||||
|
|
|
@ -64,7 +64,9 @@ class MailServiceProvider extends AbstractServiceProvider
|
|||
|
||||
$this->app->singleton('mailer', function ($app) {
|
||||
$mailer = new Mailer(
|
||||
$app['view'], $app['swift.mailer'], $app['events']
|
||||
$app['view'],
|
||||
$app['swift.mailer'],
|
||||
$app['events']
|
||||
);
|
||||
|
||||
if ($app->bound('queue')) {
|
||||
|
|
|
@ -46,7 +46,9 @@ class FulltextGambit implements GambitInterface
|
|||
public function apply(AbstractSearch $search, $searchValue)
|
||||
{
|
||||
$search->getQuery()
|
||||
->whereIn('id',
|
||||
$this->getUserSearchSubQuery($searchValue));
|
||||
->whereIn(
|
||||
'id',
|
||||
$this->getUserSearchSubQuery($searchValue)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@ class WithTokenTest extends TestCase
|
|||
{
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/token',
|
||||
'POST',
|
||||
'/api/token',
|
||||
[
|
||||
'json' => [
|
||||
'identification' => 'normal',
|
||||
|
@ -66,7 +67,8 @@ class WithTokenTest extends TestCase
|
|||
{
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/token',
|
||||
'POST',
|
||||
'/api/token',
|
||||
[
|
||||
'json' => [
|
||||
'identification' => 'normal',
|
||||
|
|
|
@ -49,7 +49,8 @@ class RequireCsrfTokenTest extends TestCase
|
|||
{
|
||||
$auth = $this->send(
|
||||
$this->request(
|
||||
'POST', '/login',
|
||||
'POST',
|
||||
'/login',
|
||||
[
|
||||
'json' => ['identification' => 'admin', 'password' => 'password'],
|
||||
]
|
||||
|
@ -58,7 +59,8 @@ class RequireCsrfTokenTest extends TestCase
|
|||
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/settings',
|
||||
'POST',
|
||||
'/api/settings',
|
||||
[
|
||||
'cookiesFrom' => $auth,
|
||||
'json' => ['csrf_test' => 2],
|
||||
|
@ -92,7 +94,8 @@ class RequireCsrfTokenTest extends TestCase
|
|||
|
||||
$auth = $this->send(
|
||||
$this->request(
|
||||
'POST', '/login',
|
||||
'POST',
|
||||
'/login',
|
||||
[
|
||||
'cookiesFrom' => $initial,
|
||||
'json' => ['identification' => 'admin', 'password' => 'password'],
|
||||
|
@ -104,7 +107,8 @@ class RequireCsrfTokenTest extends TestCase
|
|||
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/settings',
|
||||
'POST',
|
||||
'/api/settings',
|
||||
[
|
||||
'cookiesFrom' => $auth,
|
||||
'json' => ['csrf_test' => 2],
|
||||
|
@ -135,7 +139,8 @@ class RequireCsrfTokenTest extends TestCase
|
|||
|
||||
$auth = $this->send(
|
||||
$this->request(
|
||||
'POST', '/login',
|
||||
'POST',
|
||||
'/login',
|
||||
[
|
||||
'cookiesFrom' => $initial,
|
||||
'json' => ['identification' => 'admin', 'password' => 'password', 'csrfToken' => $token],
|
||||
|
@ -147,7 +152,8 @@ class RequireCsrfTokenTest extends TestCase
|
|||
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/settings',
|
||||
'POST',
|
||||
'/api/settings',
|
||||
[
|
||||
'cookiesFrom' => $auth,
|
||||
'json' => ['csrf_test' => 2, 'csrfToken' => $token],
|
||||
|
@ -172,7 +178,8 @@ class RequireCsrfTokenTest extends TestCase
|
|||
{
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/settings',
|
||||
'POST',
|
||||
'/api/settings',
|
||||
[
|
||||
'json' => ['csrf_test' => 2],
|
||||
]
|
||||
|
@ -200,7 +207,8 @@ class RequireCsrfTokenTest extends TestCase
|
|||
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/settings',
|
||||
'POST',
|
||||
'/api/settings',
|
||||
[
|
||||
'json' => ['csrf_test' => 2],
|
||||
]
|
||||
|
|
|
@ -48,7 +48,8 @@ class CreationTest extends TestCase
|
|||
{
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/users',
|
||||
'POST',
|
||||
'/api/users',
|
||||
[
|
||||
'json' => ['data' => ['attributes' => []]],
|
||||
]
|
||||
|
@ -91,7 +92,8 @@ class CreationTest extends TestCase
|
|||
{
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/users',
|
||||
'POST',
|
||||
'/api/users',
|
||||
[
|
||||
'json' => [
|
||||
'data' => [
|
||||
|
@ -123,7 +125,8 @@ class CreationTest extends TestCase
|
|||
{
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/users',
|
||||
'POST',
|
||||
'/api/users',
|
||||
[
|
||||
'json' => [
|
||||
'data' => [
|
||||
|
@ -158,7 +161,8 @@ class CreationTest extends TestCase
|
|||
|
||||
$response = $this->send(
|
||||
$this->request(
|
||||
'POST', '/api/users',
|
||||
'POST',
|
||||
'/api/users',
|
||||
[
|
||||
'json' => [
|
||||
'data' => [
|
||||
|
|
Loading…
Reference in New Issue
Block a user