1
0
mirror of https://github.com/flarum/core.git synced 2025-08-07 17:07:19 +02:00

Apply fixes from StyleCI

[ci skip] [skip ci]
This commit is contained in:
Franz Liedke
2020-03-06 13:55:39 +00:00
committed by StyleCI Bot
parent 9212330ac2
commit 4413848c11
16 changed files with 69 additions and 31 deletions

View File

@@ -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
);
}
}

View File

@@ -25,7 +25,8 @@ class DiscussionServiceProvider extends AbstractServiceProvider
$events->subscribe(DiscussionPolicy::class);
$events->listen(
Renamed::class, DiscussionRenamedLogger::class
Renamed::class,
DiscussionRenamedLogger::class
);
}
}

View File

@@ -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) {

View File

@@ -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'])
);
}

View File

@@ -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

View File

@@ -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));
}

View File

@@ -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')

View File

@@ -89,7 +89,9 @@ class UninstalledSite implements SiteInterface
$dispatcher = $app->make(Dispatcher::class);
return new \Illuminate\View\Factory(
$engines, $finder, $dispatcher
$engines,
$finder,
$dispatcher
);
});

View File

@@ -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

View File

@@ -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()
);
});

View File

@@ -49,7 +49,8 @@ class RunMigrations implements Step
private function getMigrator()
{
$repository = new DatabaseMigrationRepository(
$this->database, 'migrations'
$this->database,
'migrations'
);
$files = new Filesystem;

View File

@@ -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')) {

View File

@@ -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)
);
}
}