mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Clean up code.
This commit is contained in:
@@ -171,7 +171,7 @@ trait ConvertsExchangeRates
|
||||
private function convertAmount(string $amount, TransactionCurrency $from, TransactionCurrency $to, ?Carbon $date = null): string
|
||||
{
|
||||
app('log')->debug(sprintf('Converting %s from %s to %s', $amount, $from->code, $to->code));
|
||||
$date = $date ?? today(config('app.timezone'));
|
||||
$date ??= today(config('app.timezone'));
|
||||
$rate = $this->getRate($from, $to, $date);
|
||||
|
||||
return bcmul($amount, $rate);
|
||||
|
@@ -263,7 +263,7 @@ trait AugumentData
|
||||
$name = $journal['source_account_name'];
|
||||
}
|
||||
|
||||
$grouped[$name] = $grouped[$name] ?? '0';
|
||||
$grouped[$name] ??= '0';
|
||||
$grouped[$name] = bcadd($journal['amount'], $grouped[$name]);
|
||||
}
|
||||
|
||||
|
@@ -168,7 +168,7 @@ trait RequestInformation
|
||||
*/
|
||||
final protected function parseAttributes(array $attributes): array // parse input + return result
|
||||
{
|
||||
$attributes['location'] = $attributes['location'] ?? '';
|
||||
$attributes['location'] ??= '';
|
||||
$attributes['accounts'] = AccountList::routeBinder($attributes['accounts'] ?? '', new Route('get', '', []));
|
||||
$date = Carbon::createFromFormat('Ymd', $attributes['startDate']);
|
||||
if (false === $date) {
|
||||
|
@@ -139,7 +139,7 @@ trait RuleManagement
|
||||
$index = 0;
|
||||
foreach ($submittedOperators as $operator) {
|
||||
$rootOperator = OperatorQuerySearch::getRootOperator($operator['type']);
|
||||
$needsContext = (bool) config(sprintf('search.operators.%s.needs_context',$rootOperator));
|
||||
$needsContext = (bool) config(sprintf('search.operators.%s.needs_context', $rootOperator));
|
||||
try {
|
||||
$renderedEntries[] = view(
|
||||
'rules.partials.trigger',
|
||||
|
Reference in New Issue
Block a user