Code rearrange and optimise.

This commit is contained in:
James Cole
2015-03-29 21:27:51 +02:00
parent 210f84b6ea
commit bea321939e
34 changed files with 155 additions and 155 deletions

View File

@@ -38,7 +38,7 @@ class ConnectJournalToPiggyBank
/** @var TransactionJournal $journal */
$journal = $event->journal;
$piggyBankId = $event->piggyBankId;
if(intval($piggyBankId) < 1) {
if (intval($piggyBankId) < 1) {
return;
}
@@ -66,7 +66,8 @@ class ConnectJournalToPiggyBank
// update piggy bank rep for date of transaction journal.
$repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($journal->date)->first();
if (is_null($repetition)) {
Log::debug('Found no repetition for piggy bank for date '.$journal->date->format('Y M d'));
Log::debug('Found no repetition for piggy bank for date ' . $journal->date->format('Y M d'));
return;
}

View File

@@ -1,8 +1,8 @@
<?php namespace FireflyIII\Handlers\Events;
use App;
use FireflyIII\Events\JournalSaved;
use Log;
use App;
/**
* Class RescanJournal

View File

@@ -35,8 +35,8 @@ class UpdateJournalConnection
// get the event connected to this journal:
/** @var PiggyBankEvent $event */
$event = PiggyBankEvent::where('transaction_journal_id', $journal->id)->first();
if(is_null($event)) {
$event = PiggyBankEvent::where('transaction_journal_id', $journal->id)->first();
if (is_null($event)) {
return;
}
$piggyBank = $event->piggyBank()->first();