mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Yoda style and dump unused method.
This commit is contained in:
parent
6881d4479e
commit
0bb59f5505
@ -143,27 +143,6 @@ class Amount
|
|||||||
return (string)config('firefly.default_currency', 'EUR');
|
return (string)config('firefly.default_currency', 'EUR');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getCurrencySymbol(): string
|
|
||||||
{
|
|
||||||
if ('testing' === config('app.env')) {
|
|
||||||
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
|
|
||||||
}
|
|
||||||
$cache = new CacheProperties;
|
|
||||||
$cache->addProperty('getCurrencySymbol');
|
|
||||||
if ($cache->has()) {
|
|
||||||
return $cache->get(); // @codeCoverageIgnore
|
|
||||||
}
|
|
||||||
$currencyPreference = app('preferences')->get('currencyPreference', config('firefly.default_currency', 'EUR'));
|
|
||||||
$currency = TransactionCurrency::where('code', $currencyPreference->data)->first();
|
|
||||||
|
|
||||||
$cache->store($currency->symbol);
|
|
||||||
|
|
||||||
return $currency->symbol;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \FireflyIII\Models\TransactionCurrency
|
* @return \FireflyIII\Models\TransactionCurrency
|
||||||
*/
|
*/
|
||||||
@ -237,8 +216,8 @@ class Amount
|
|||||||
|
|
||||||
$fmt = new NumberFormatter( $locale, NumberFormatter::CURRENCY );
|
$fmt = new NumberFormatter( $locale, NumberFormatter::CURRENCY );
|
||||||
|
|
||||||
$positivePrefixed = $fmt->getAttribute(NumberFormatter::POSITIVE_PREFIX) !== '';
|
$positivePrefixed = '' !== $fmt->getAttribute(NumberFormatter::POSITIVE_PREFIX);
|
||||||
$negativePrefixed = $fmt->getAttribute(NumberFormatter::NEGATIVE_PREFIX) !== '';
|
$negativePrefixed = '' !== $fmt->getAttribute(NumberFormatter::NEGATIVE_PREFIX);
|
||||||
|
|
||||||
$positive = ($positivePrefixed) ? '%s %v' : '%v %s';
|
$positive = ($positivePrefixed) ? '%s %v' : '%v %s';
|
||||||
$negative = ($negativePrefixed) ? '%s %v' : '%v %s';
|
$negative = ($negativePrefixed) ? '%s %v' : '%v %s';
|
||||||
|
Loading…
Reference in New Issue
Block a user