mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-06 01:45:22 +00:00
Bug fixes in strict types.
This commit is contained in:
@@ -40,19 +40,12 @@ class CrudServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->bind(
|
||||
'FireflyIII\Crud\Split\JournalInterface',
|
||||
function (Application $app, array $arguments) {
|
||||
if (!isset($arguments[0]) && $app->auth->check()) {
|
||||
return app('FireflyIII\Crud\Split\Journal', [$app->auth->user()]);
|
||||
}
|
||||
if (!isset($arguments[0]) && !$app->auth->check()) {
|
||||
throw new FireflyException('There is no user present.');
|
||||
}
|
||||
$this->registerJournal();
|
||||
$this->registerAccount();
|
||||
}
|
||||
|
||||
return app('FireflyIII\Crud\Split\Journal', $arguments);
|
||||
}
|
||||
);
|
||||
private function registerAccount()
|
||||
{
|
||||
|
||||
$this->app->bind(
|
||||
'FireflyIII\Crud\Account\AccountCrudInterface',
|
||||
@@ -68,4 +61,22 @@ class CrudServiceProvider extends ServiceProvider
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private function registerJournal()
|
||||
{
|
||||
$this->app->bind(
|
||||
'FireflyIII\Crud\Split\JournalInterface',
|
||||
function (Application $app, array $arguments) {
|
||||
if (!isset($arguments[0]) && $app->auth->check()) {
|
||||
return app('FireflyIII\Crud\Split\Journal', [$app->auth->user()]);
|
||||
}
|
||||
if (!isset($arguments[0]) && !$app->auth->check()) {
|
||||
throw new FireflyException('There is no user present.');
|
||||
}
|
||||
|
||||
return app('FireflyIII\Crud\Split\Journal', $arguments);
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user