mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Big refactor to remove the deprecated transaction collector.
This commit is contained in:
@@ -100,8 +100,8 @@ class FakeJobConfiguration implements JobConfigurationInterface
|
||||
$this->repository->setConfiguration($this->importJob, $configuration);
|
||||
$messages = new MessageBag();
|
||||
|
||||
if (3 !== \count($configuration)) {
|
||||
$messages->add('some_key', 'Ignore this error: ' . \count($configuration));
|
||||
if (3 !== count($configuration)) {
|
||||
$messages->add('some_key', 'Ignore this error: ' . count($configuration));
|
||||
}
|
||||
|
||||
return $messages;
|
||||
|
||||
@@ -83,14 +83,14 @@ class YnabRoutine implements RoutineInterface
|
||||
$budgets = $configuration['budgets'] ?? [];
|
||||
|
||||
// if more than 1 budget, select budget first.
|
||||
if (\count($budgets) > 1) {
|
||||
if (count($budgets) > 1) {
|
||||
$this->repository->setStage($this->importJob, 'select_budgets');
|
||||
$this->repository->setStatus($this->importJob, 'need_job_config');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (1 === \count($budgets)) {
|
||||
if (1 === count($budgets)) {
|
||||
$this->repository->setStatus($this->importJob, 'ready_to_run');
|
||||
$this->repository->setStage($this->importJob, 'get_accounts');
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class IngDescription implements SpecificInterface
|
||||
public function run(array $row): array
|
||||
{
|
||||
$this->row = array_values($row);
|
||||
if (\count($this->row) >= 8) { // check if the array is correct
|
||||
if (count($this->row) >= 8) { // check if the array is correct
|
||||
switch ($this->row[4]) { // Get value for the mutation type
|
||||
case 'GT': // InternetBankieren
|
||||
case 'OV': // Overschrijving
|
||||
|
||||
@@ -424,7 +424,7 @@ class ImportArrayStorage
|
||||
{
|
||||
/** @var array $array */
|
||||
$array = $this->repository->getTransactions($this->importJob);
|
||||
$count = \count($array);
|
||||
$count = count($array);
|
||||
$toStore = [];
|
||||
|
||||
Log::notice(sprintf('Will now store the transactions. Count of items is %d.', $count));
|
||||
@@ -441,7 +441,7 @@ class ImportArrayStorage
|
||||
$transaction['import_hash_v2'] = $this->getHash($transaction);
|
||||
$toStore[] = $transaction;
|
||||
}
|
||||
$count = \count($toStore);
|
||||
$count = count($toStore);
|
||||
if (0 === $count) {
|
||||
Log::info('No transactions to store left!');
|
||||
|
||||
@@ -509,13 +509,13 @@ class ImportArrayStorage
|
||||
return false;
|
||||
}
|
||||
// how many hits do we need?
|
||||
Log::debug(sprintf('Array has %d transactions.', \count($transaction['transactions'])));
|
||||
Log::debug(sprintf('System has %d existing transfers', \count($this->transfers)));
|
||||
Log::debug(sprintf('Array has %d transactions.', count($transaction['transactions'])));
|
||||
Log::debug(sprintf('System has %d existing transfers', count($this->transfers)));
|
||||
// loop over each split:
|
||||
Log::debug(sprintf('This transfer has %d split(s)', \count($transaction['transactions'])));
|
||||
Log::debug(sprintf('This transfer has %d split(s)', count($transaction['transactions'])));
|
||||
foreach ($transaction['transactions'] as $index => $current) {
|
||||
Log::debug(sprintf('Required hits for transfer comparison is %d', self::REQUIRED_HITS));
|
||||
Log::debug(sprintf('Now at transfer split %d of %d', $index + 1, \count($transaction['transactions'])));
|
||||
Log::debug(sprintf('Now at transfer split %d of %d', $index + 1, count($transaction['transactions'])));
|
||||
|
||||
// get the amount:
|
||||
/** @noinspection UnnecessaryCastingInspection */
|
||||
|
||||
Reference in New Issue
Block a user