Update app() calls

This commit is contained in:
James Cole
2017-02-05 16:16:15 +01:00
parent 77e52f42a6
commit 8a98204a69
51 changed files with 174 additions and 99 deletions

View File

@@ -177,7 +177,8 @@ class ImportValidator
// find it first by new type:
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class, [$this->user]);
$repository = app(AccountRepositoryInterface::class);
$repository->setUser($this->user);
$result = $repository->findByName($account->name, [$type]);
if (is_null($result->id)) {
@@ -214,7 +215,8 @@ class ImportValidator
{
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class, [$this->user]);
$repository = app(AccountRepositoryInterface::class);
$repository->setUser($this->user);
$name = 'Unknown expense account';
$result = $repository->findByName($name, [AccountType::EXPENSE]);
@@ -235,7 +237,8 @@ class ImportValidator
{
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class, [$this->user]);
$repository = app(AccountRepositoryInterface::class);
$repository->setUser($this->user);
$name = 'Unknown revenue account';
$result = $repository->findByName($name, [AccountType::REVENUE]);
@@ -382,7 +385,8 @@ class ImportValidator
{
if (is_null($entry->fields['currency'])) {
/** @var CurrencyRepositoryInterface $repository */
$repository = app(CurrencyRepositoryInterface::class, [$this->user]);
$repository = app(CurrencyRepositoryInterface::class);
$repository->setUser($this->user);
// is the default currency for the user or the system
$defaultCode = Preferences::getForUser($this->user, 'currencyPreference', config('firefly.default_currency', 'EUR'))->data;