From 5a7b1ba292b79d47d9fe8609c0d12d5f38f0e963 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 11 Mar 2018 15:55:36 +0100 Subject: [PATCH] Remove unused methods. --- app/Support/Twig/AmountFormat.php | 100 ------------------------------ 1 file changed, 100 deletions(-) diff --git a/app/Support/Twig/AmountFormat.php b/app/Support/Twig/AmountFormat.php index a65587b9f0..6c1afc897e 100644 --- a/app/Support/Twig/AmountFormat.php +++ b/app/Support/Twig/AmountFormat.php @@ -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']] - ); - } }