Remove unused methods.

This commit is contained in:
James Cole 2018-03-11 15:55:36 +01:00
parent 24715c72a2
commit 5a7b1ba292
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -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']]
);
}
}