Code cleanup for scrutinizer.

This commit is contained in:
James Cole
2017-11-25 08:54:52 +01:00
parent f2cf0ed446
commit f7b1168e7c
36 changed files with 53 additions and 179 deletions

View File

@@ -168,8 +168,8 @@ class JournalCollector implements JournalCollectorInterface
$q1->where(
function (EloquentBuilder $q2) use ($amount) {
// amount < 0 and .amount > -$amount
$amount = bcmul($amount, '-1');
$q2->where('transactions.amount', '<', 0)->where('transactions.amount', '>', $amount);
$invertedAmount = bcmul($amount, '-1');
$q2->where('transactions.amount', '<', 0)->where('transactions.amount', '>', $invertedAmount);
}
)
->orWhere(
@@ -196,8 +196,8 @@ class JournalCollector implements JournalCollectorInterface
$q1->where(
function (EloquentBuilder $q2) use ($amount) {
// amount < 0 and .amount < -$amount
$amount = bcmul($amount, '-1');
$q2->where('transactions.amount', '<', 0)->where('transactions.amount', '<', $amount);
$invertedAmount = bcmul($amount, '-1');
$q2->where('transactions.amount', '<', 0)->where('transactions.amount', '<', $invertedAmount);
}
)
->orWhere(