mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 10:53:37 +00:00
Refactor references to static facades. Improve budget controller code.
This commit is contained in:
@@ -31,7 +31,6 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Log;
|
||||
use Preferences;
|
||||
|
||||
/**
|
||||
* Class JavascriptController.
|
||||
@@ -47,7 +46,7 @@ class JavascriptController extends Controller
|
||||
public function accounts(AccountRepositoryInterface $repository, CurrencyRepositoryInterface $currencyRepository): Response
|
||||
{
|
||||
$accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
|
||||
$preference = Preferences::get('currencyPreference', config('firefly.default_currency', 'EUR'));
|
||||
$preference = app('preferences')->get('currencyPreference', config('firefly.default_currency', 'EUR'));
|
||||
/** @noinspection NullPointerExceptionInspection */
|
||||
$default = $currencyRepository->findByCodeNull($preference->data);
|
||||
|
||||
@@ -114,7 +113,7 @@ class JavascriptController extends Controller
|
||||
$accounting = app('amount')->getJsConfig($localeconv);
|
||||
$localeconv = localeconv();
|
||||
$localeconv['frac_digits'] = $currency->decimal_places;
|
||||
$pref = Preferences::get('language', config('firefly.default_language', 'en_US'));
|
||||
$pref = app('preferences')->get('language', config('firefly.default_language', 'en_US'));
|
||||
/** @noinspection NullPointerExceptionInspection */
|
||||
$lang = $pref->data;
|
||||
$dateRange = $this->getDateRangeConfig();
|
||||
@@ -140,7 +139,7 @@ class JavascriptController extends Controller
|
||||
*/
|
||||
private function getDateRangeConfig(): array
|
||||
{
|
||||
$viewRange = Preferences::get('viewRange', '1M')->data;
|
||||
$viewRange = app('preferences')->get('viewRange', '1M')->data;
|
||||
$start = session('start');
|
||||
$end = session('end');
|
||||
$first = session('first');
|
||||
|
Reference in New Issue
Block a user