Code clean up

This commit is contained in:
James Cole
2017-06-24 13:04:41 +02:00
parent 8a175d147b
commit 04a8a0e6a1
17 changed files with 29 additions and 398 deletions

View File

@@ -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']):

View File

@@ -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();

View File

@@ -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));

View File

@@ -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)) {

View File

@@ -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;

View File

@@ -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));