Code reordering and reformatting. I should really start employing style CI.

This commit is contained in:
James Cole
2021-09-18 10:26:12 +02:00
parent 9b9d52e99f
commit 4003cea759
344 changed files with 2776 additions and 2605 deletions

View File

@@ -23,10 +23,12 @@ declare(strict_types=1);
namespace FireflyIII\Support;
use Crypt;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\User;
use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Support\Collection;
use JsonException;
use NumberFormatter;
/**
@@ -109,15 +111,15 @@ class Amount
/**
* @return string
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \JsonException
* @throws FireflyException
* @throws JsonException
*/
public function getCurrencyCode(): string
{
$cache = new CacheProperties;
$cache->addProperty('getCurrencyCode');
if ($cache->has()) {
return $cache->get();
return $cache->get();
}
$currencyPreference = app('preferences')->get('currencyPreference', config('firefly.default_currency', 'EUR'));
@@ -147,8 +149,8 @@ class Amount
* @param User $user
*
* @return TransactionCurrency
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \JsonException
* @throws FireflyException
* @throws JsonException
*/
public function getDefaultCurrencyByUser(User $user): TransactionCurrency
{
@@ -156,7 +158,7 @@ class Amount
$cache->addProperty('getDefaultCurrency');
$cache->addProperty($user->id);
if ($cache->has()) {
return $cache->get();
return $cache->get();
}
$currencyPreference = app('preferences')->getForUser($user, 'currencyPreference', config('firefly.default_currency', 'EUR'));
$currencyPrefStr = $currencyPreference ? $currencyPreference->data : 'EUR';