Moved a method around.

This commit is contained in:
James Cole
2016-10-08 16:04:05 +02:00
parent d0c92a2244
commit a1f797c4d1
6 changed files with 96 additions and 133 deletions

View File

@@ -55,5 +55,19 @@ class AccountServiceProvider extends ServiceProvider
return app('FireflyIII\Repositories\Account\AccountRepository', $arguments);
}
);
$this->app->bind(
'FireflyIII\Repositories\Account\AccountTaskerInterface',
function (Application $app, array $arguments) {
if (!isset($arguments[0]) && $app->auth->check()) {
return app('FireflyIII\Repositories\Account\AccountTasker', [auth()->user()]);
}
if (!isset($arguments[0]) && !$app->auth->check()) {
throw new FireflyException('There is no user present.');
}
return app('FireflyIII\Repositories\Account\AccountTasker', $arguments);
}
);
}
}