mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Big refactor to remove the deprecated transaction collector.
This commit is contained in:
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
@@ -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)';
|
||||
|
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user