mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-25 18:30:55 -06:00
Remove unused methods.
This commit is contained in:
parent
24715c72a2
commit
5a7b1ba292
@ -52,10 +52,6 @@ class AmountFormat extends Twig_Extension
|
||||
return [
|
||||
$this->formatAmountByAccount(),
|
||||
$this->formatAmountBySymbol(),
|
||||
$this->formatDestinationAfter(),
|
||||
$this->formatDestinationBefore(),
|
||||
$this->formatSourceAfter(),
|
||||
$this->formatSourceBefore(),
|
||||
$this->formatAmountByCurrency(),
|
||||
];
|
||||
}
|
||||
@ -162,100 +158,4 @@ class AmountFormat extends Twig_Extension
|
||||
['is_safe' => ['html']]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Twig_SimpleFunction
|
||||
*/
|
||||
protected function formatDestinationAfter(): Twig_SimpleFunction
|
||||
{
|
||||
return new Twig_SimpleFunction(
|
||||
'formatDestinationAfter',
|
||||
function (array $transaction): string {
|
||||
// build fake currency for main amount.
|
||||
$format = new TransactionCurrency;
|
||||
$format->decimal_places = $transaction['transaction_currency_dp'];
|
||||
$format->symbol = $transaction['transaction_currency_symbol'];
|
||||
$string = app('amount')->formatAnything($format, $transaction['destination_account_after'], true);
|
||||
|
||||
// also append foreign amount for clarity:
|
||||
if (null !== $transaction['foreign_destination_amount']) {
|
||||
// build fake currency for foreign amount
|
||||
$format = new TransactionCurrency;
|
||||
$format->decimal_places = $transaction['foreign_currency_dp'];
|
||||
$format->symbol = $transaction['foreign_currency_symbol'];
|
||||
$string .= ' (' . app('amount')->formatAnything($format, $transaction['foreign_destination_amount'], true) . ')';
|
||||
}
|
||||
|
||||
return $string;
|
||||
},
|
||||
['is_safe' => ['html']]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Twig_SimpleFunction
|
||||
*/
|
||||
protected function formatDestinationBefore(): Twig_SimpleFunction
|
||||
{
|
||||
return new Twig_SimpleFunction(
|
||||
'formatDestinationBefore',
|
||||
function (array $transaction): string {
|
||||
// build fake currency for main amount.
|
||||
$format = new TransactionCurrency;
|
||||
$format->decimal_places = $transaction['transaction_currency_dp'];
|
||||
$format->symbol = $transaction['transaction_currency_symbol'];
|
||||
|
||||
return app('amount')->formatAnything($format, $transaction['destination_account_before'], true);
|
||||
},
|
||||
['is_safe' => ['html']]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Twig_SimpleFunction
|
||||
*/
|
||||
protected function formatSourceAfter(): Twig_SimpleFunction
|
||||
{
|
||||
return new Twig_SimpleFunction(
|
||||
'formatSourceAfter',
|
||||
function (array $transaction): string {
|
||||
// build fake currency for main amount.
|
||||
$format = new TransactionCurrency;
|
||||
$format->decimal_places = $transaction['transaction_currency_dp'];
|
||||
$format->symbol = $transaction['transaction_currency_symbol'];
|
||||
$string = app('amount')->formatAnything($format, $transaction['source_account_after'], true);
|
||||
|
||||
// also append foreign amount for clarity:
|
||||
if (null !== $transaction['foreign_source_amount']) {
|
||||
// build fake currency for foreign amount
|
||||
$format = new TransactionCurrency;
|
||||
$format->decimal_places = $transaction['foreign_currency_dp'];
|
||||
$format->symbol = $transaction['foreign_currency_symbol'];
|
||||
$string .= ' (' . app('amount')->formatAnything($format, $transaction['foreign_source_amount'], true) . ')';
|
||||
}
|
||||
|
||||
return $string;
|
||||
},
|
||||
['is_safe' => ['html']]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Twig_SimpleFunction
|
||||
*/
|
||||
protected function formatSourceBefore(): Twig_SimpleFunction
|
||||
{
|
||||
return new Twig_SimpleFunction(
|
||||
'formatSourceBefore',
|
||||
function (array $transaction): string {
|
||||
// build fake currency for main amount.
|
||||
$format = new TransactionCurrency;
|
||||
$format->decimal_places = $transaction['transaction_currency_dp'];
|
||||
$format->symbol = $transaction['transaction_currency_symbol'];
|
||||
|
||||
return app('amount')->formatAnything($format, $transaction['source_account_before'], true);
|
||||
},
|
||||
['is_safe' => ['html']]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user