Various code clean up.

Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
James Cole
2016-08-24 19:33:58 +02:00
parent 98c4ac955a
commit a2e14f8b8d
8 changed files with 175 additions and 85 deletions

View File

@@ -27,6 +27,7 @@ class UpdateJournalConnection
* Handle the event.
*
* @param TransactionJournalUpdated $event
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5.
*
* @return bool
*/
@@ -46,7 +47,7 @@ class UpdateJournalConnection
}
$piggyBank = $event->piggyBank()->first();
$repetition = null;
if ($piggyBank) {
if (!is_null($piggyBank)) {
/** @var PiggyBankRepetition $repetition */
$repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($journal->date)->first();
}