mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 16:13:54 +00:00
Code clean up
This commit is contained in:
@@ -134,7 +134,7 @@ class CsvConfigurator implements ConfiguratorInterface
|
||||
{
|
||||
$class = false;
|
||||
switch (true) {
|
||||
case(!$this->job->configuration['initial-config-complete']):
|
||||
case (!$this->job->configuration['initial-config-complete']):
|
||||
$class = Initial::class;
|
||||
break;
|
||||
case (!$this->job->configuration['column-roles-complete']):
|
||||
|
@@ -192,8 +192,7 @@ class CsvProcessor implements FileProcessorInterface
|
||||
$string = json_encode($array);
|
||||
$hash = hash('sha256', json_encode($string));
|
||||
$json = json_encode($hash);
|
||||
$entry = TransactionJournalMeta::
|
||||
leftJoin('transaction_journals', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id')
|
||||
$entry = TransactionJournalMeta::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id')
|
||||
->where('data', $json)
|
||||
->where('name', 'importHash')
|
||||
->first();
|
||||
|
@@ -140,7 +140,7 @@ class ImportAccount
|
||||
}
|
||||
/** @var Collection $accounts */
|
||||
$accounts = $this->repository->getAccountsByType([$accountType->type]);
|
||||
// 2: find by IBAN (and type):
|
||||
// Two: find by IBAN (and type):
|
||||
if (count($this->accountIban) === 3) {
|
||||
$iban = $this->accountIban['value'];
|
||||
Log::debug(sprintf('Finding account of type %d and IBAN %s', $accountType->id, $iban));
|
||||
@@ -163,7 +163,7 @@ class ImportAccount
|
||||
Log::debug('Found nothing.');
|
||||
}
|
||||
|
||||
// 3: find by name (and type):
|
||||
// Three: find by name (and type):
|
||||
if (count($this->accountName) === 3) {
|
||||
$name = $this->accountName['value'];
|
||||
Log::debug(sprintf('Finding account of type %d and name %s', $accountType->id, $name));
|
||||
|
@@ -54,7 +54,6 @@ class ImportCurrency
|
||||
Log::debug('In createCurrency()');
|
||||
// check if any of them is mapped:
|
||||
$mapped = $this->findMappedObject();
|
||||
$searched = null;
|
||||
|
||||
if (!is_null($mapped->id)) {
|
||||
|
||||
|
@@ -251,7 +251,6 @@ class ImportJournal
|
||||
case 'tags-space':
|
||||
$this->tags[] = $array;
|
||||
break;
|
||||
// 'interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date',
|
||||
case 'date-interest':
|
||||
$this->metaDates['interest_date'] = $array['value'];
|
||||
break;
|
||||
|
@@ -155,7 +155,7 @@ class ImportStorage
|
||||
$transaction->amount = $amount;
|
||||
$transaction->save();
|
||||
if (is_null($transaction->id)) {
|
||||
$errorText = join(', ', $one->getErrors()->all());
|
||||
$errorText = join(', ', $transaction->getErrors()->all());
|
||||
throw new FireflyException($errorText);
|
||||
}
|
||||
Log::debug(sprintf('Created transaction with ID #%d and account #%d', $transaction->id, $accountId));
|
||||
|
Reference in New Issue
Block a user