Bug fixes in strict types.

This commit is contained in:
James Cole
2016-05-20 11:53:34 +02:00
parent 7dd858be39
commit 74a9edaaf7
4 changed files with 28 additions and 18 deletions

View File

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