Big refactor to remove the deprecated transaction collector.

This commit is contained in:
James Cole
2019-05-30 12:31:19 +02:00
parent 10a6ff9bf8
commit 8b7e87ae57
117 changed files with 1314 additions and 1208 deletions

View File

@@ -63,7 +63,7 @@ class GetAccountsHandler
$request->call();
$config['accounts'] = $request->accounts;
$this->repository->setConfiguration($this->importJob, $config);
if (0 === \count($config['accounts'])) {
if (0 === count($config['accounts'])) {
throw new FireflyException('This budget contains zero accounts.');
}
}

View File

@@ -78,7 +78,7 @@ class ImportDataHandler
}
$totalSet = array_merge(...$total);
Log::debug(sprintf('Found %d transactions in total.', \count($totalSet)));
Log::debug(sprintf('Found %d transactions in total.', count($totalSet)));
$this->repository->setTransactions($this->importJob, $totalSet);
// assuming this works, store today's date as a preference
@@ -114,9 +114,9 @@ class ImportDataHandler
{
$config = $this->repository->getConfiguration($this->importJob);
$array = [];
$total = \count($transactions);
$total = count($transactions);
$budget = $this->getSelectedBudget();
Log::debug(sprintf('Now in StageImportDataHandler::convertToArray() with count %d', \count($transactions)));
Log::debug(sprintf('Now in StageImportDataHandler::convertToArray() with count %d', count($transactions)));
/** @var array $transaction */
foreach ($transactions as $index => $transaction) {
$description = $transaction['memo'] ?? '(empty)';

View File

@@ -57,8 +57,8 @@ class StageGetBudgetsHandler
// store budgets in users preferences.
$configuration['budgets'] = $request->budgets;
$this->repository->setConfiguration($this->importJob, $configuration);
Log::debug(sprintf('Found %d budgets', \count($request->budgets)));
if (0 === \count($request->budgets)) {
Log::debug(sprintf('Found %d budgets', count($request->budgets)));
if (0 === count($request->budgets)) {
throw new FireflyException('It seems this user has zero budgets or an error prevented Firefly III from reading them.');
}
}