mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Remove unused methods.
This commit is contained in:
@@ -52,10 +52,6 @@ class AmountFormat extends Twig_Extension
|
|||||||
return [
|
return [
|
||||||
$this->formatAmountByAccount(),
|
$this->formatAmountByAccount(),
|
||||||
$this->formatAmountBySymbol(),
|
$this->formatAmountBySymbol(),
|
||||||
$this->formatDestinationAfter(),
|
|
||||||
$this->formatDestinationBefore(),
|
|
||||||
$this->formatSourceAfter(),
|
|
||||||
$this->formatSourceBefore(),
|
|
||||||
$this->formatAmountByCurrency(),
|
$this->formatAmountByCurrency(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -162,100 +158,4 @@ class AmountFormat extends Twig_Extension
|
|||||||
['is_safe' => ['html']]
|
['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']]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user