Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Learned that I should not refer to env vars directly so I removed all references.
James Colec54541b83971
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.phpindex 72caac1261..fb88b39a63 100644--- a/app/Exceptions/Handler.php+++ b/app/Exceptions/Handler.php@@ -38,6 +38,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;/*** Class Handler+ ** @codeCoverageIgnore*/class Handler extends ExceptionHandler@@ -92,7 +93,7 @@ class Handler extends ExceptionHandler}if ($exception instanceof FireflyException || $exception instanceof ErrorException || $exception instanceof OAuthServerException) {- $isDebug = env('APP_DEBUG', false);+ $isDebug = config('app.debug');return response()->view('errors.FireflyException', ['exception' => $exception, 'debug' => $isDebug], 500);}@@ -116,7 +117,7 @@ class Handler extends ExceptionHandlerpublic function report(Exception $exception){- $doMailError = env('SEND_ERROR_MESSAGE', true);+ $doMailError = config('firefly.send_error_message');// if the user wants us to mail:if (true === $doMailError// and if is one of these error instances@@ -145,7 +146,7 @@ class Handler extends ExceptionHandler// create job that will mail.$ipAddress = Request::ip() ?? '0.0.0.0';- $job = new MailError($userData, env('SITE_OWNER', ''), $ipAddress, $data);+ $job = new MailError($userData, (string)config('firefly.site_owner'), $ipAddress, $data);dispatch($job);}diff --git a/app/Factory/AccountFactory.php b/app/Factory/AccountFactory.phpindex b634671dd2..5a57dddae1 100644--- a/app/Factory/AccountFactory.php+++ b/app/Factory/AccountFactory.php@@ -51,7 +51,7 @@ class AccountFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/AccountMetaFactory.php b/app/Factory/AccountMetaFactory.phpindex f07b3c37e9..0435efe7b9 100644--- a/app/Factory/AccountMetaFactory.php+++ b/app/Factory/AccountMetaFactory.php@@ -39,7 +39,7 @@ class AccountMetaFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/AttachmentFactory.php b/app/Factory/AttachmentFactory.phpindex cfe5e97dcc..f8caf4e580 100644--- a/app/Factory/AttachmentFactory.php+++ b/app/Factory/AttachmentFactory.php@@ -38,7 +38,7 @@ class AttachmentFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/BillFactory.php b/app/Factory/BillFactory.phpindex a01d37647a..85168bc9b0 100644--- a/app/Factory/BillFactory.php+++ b/app/Factory/BillFactory.php@@ -41,7 +41,7 @@ class BillFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/BudgetFactory.php b/app/Factory/BudgetFactory.phpindex 5be0326937..d102245c81 100644--- a/app/Factory/BudgetFactory.php+++ b/app/Factory/BudgetFactory.php@@ -39,7 +39,7 @@ class BudgetFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/CategoryFactory.php b/app/Factory/CategoryFactory.phpindex 1df98e446a..c5f5abcf43 100644--- a/app/Factory/CategoryFactory.php+++ b/app/Factory/CategoryFactory.php@@ -39,7 +39,7 @@ class CategoryFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/PiggyBankEventFactory.php b/app/Factory/PiggyBankEventFactory.phpindex 9aee6bfb92..0c6d19e86f 100644--- a/app/Factory/PiggyBankEventFactory.php+++ b/app/Factory/PiggyBankEventFactory.php@@ -42,7 +42,7 @@ class PiggyBankEventFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.phpindex e22444d210..f24bbda978 100644--- a/app/Factory/PiggyBankFactory.php+++ b/app/Factory/PiggyBankFactory.php@@ -38,7 +38,7 @@ class PiggyBankFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/RecurrenceFactory.php b/app/Factory/RecurrenceFactory.phpindex a88f19d44d..cc0b290ce9 100644--- a/app/Factory/RecurrenceFactory.php+++ b/app/Factory/RecurrenceFactory.php@@ -44,7 +44,7 @@ class RecurrenceFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/TagFactory.php b/app/Factory/TagFactory.phpindex 821dc92a40..142b503612 100644--- a/app/Factory/TagFactory.php+++ b/app/Factory/TagFactory.php@@ -44,7 +44,7 @@ class TagFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/TransactionCurrencyFactory.php b/app/Factory/TransactionCurrencyFactory.phpindex 0fef3edba3..8e1de1d3be 100644--- a/app/Factory/TransactionCurrencyFactory.php+++ b/app/Factory/TransactionCurrencyFactory.php@@ -41,7 +41,7 @@ class TransactionCurrencyFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/TransactionFactory.php b/app/Factory/TransactionFactory.phpindex f6ad6563af..dfaea6e8ec 100644--- a/app/Factory/TransactionFactory.php+++ b/app/Factory/TransactionFactory.php@@ -50,7 +50,7 @@ class TransactionFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.phpindex a0c06923b0..6c022a0271 100644--- a/app/Factory/TransactionJournalFactory.php+++ b/app/Factory/TransactionJournalFactory.php@@ -46,7 +46,7 @@ class TransactionJournalFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/TransactionJournalMetaFactory.php b/app/Factory/TransactionJournalMetaFactory.phpindex 04f5310b21..30948ef5fa 100644--- a/app/Factory/TransactionJournalMetaFactory.php+++ b/app/Factory/TransactionJournalMetaFactory.php@@ -39,7 +39,7 @@ class TransactionJournalMetaFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Factory/TransactionTypeFactory.php b/app/Factory/TransactionTypeFactory.phpindex ff4865d890..e70cef27cb 100644--- a/app/Factory/TransactionTypeFactory.php+++ b/app/Factory/TransactionTypeFactory.php@@ -37,7 +37,7 @@ class TransactionTypeFactory*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Generator/Chart/Basic/ChartJsGenerator.php b/app/Generator/Chart/Basic/ChartJsGenerator.phpindex e14cfb608e..8885c6c37d 100644--- a/app/Generator/Chart/Basic/ChartJsGenerator.php+++ b/app/Generator/Chart/Basic/ChartJsGenerator.php@@ -34,7 +34,7 @@ class ChartJsGenerator implements GeneratorInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Handlers/Events/AutomationHandler.php b/app/Handlers/Events/AutomationHandler.phpindex 9aa5765589..a86d1d24cf 100644--- a/app/Handlers/Events/AutomationHandler.php+++ b/app/Handlers/Events/AutomationHandler.php@@ -45,7 +45,7 @@ class AutomationHandler*/public function reportJournals(RequestedReportOnJournals $event): bool{- $sendReport = envNonEmpty('SEND_REPORT_JOURNALS', true);+ $sendReport = config('firefly.send_report_journals');if (false === $sendReport) {return true; // @codeCoverageIgnorediff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.phpindex 52ef3c34e0..0e1f5f0ce2 100644--- a/app/Handlers/Events/UserEventHandler.php+++ b/app/Handlers/Events/UserEventHandler.php@@ -214,7 +214,7 @@ class UserEventHandler*/public function sendRegistrationMail(RegisteredUser $event): bool{- $sendMail = env('SEND_REGISTRATION_MAIL', true);+ $sendMail = config('firefly.send_registration_mail');if ($sendMail) {// get the email address$email = $event->user->email;diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.phpindex 34a15813a5..955f689773 100644--- a/app/Helpers/Attachments/AttachmentHelper.php+++ b/app/Helpers/Attachments/AttachmentHelper.php@@ -65,7 +65,7 @@ class AttachmentHelper implements AttachmentHelperInterface$this->attachments = new Collection;$this->uploadDisk = Storage::disk('upload');- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Helpers/Chart/MetaPieChart.php b/app/Helpers/Chart/MetaPieChart.phpindex 7c1ce502c6..63eb17c81c 100644--- a/app/Helpers/Chart/MetaPieChart.php+++ b/app/Helpers/Chart/MetaPieChart.php@@ -90,7 +90,7 @@ class MetaPieChart implements MetaPieChartInterface$this->categories = new Collection;$this->tags = new Collection;- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}diff --git a/app/Helpers/Collector/TransactionCollector.php b/app/Helpers/Collector/TransactionCollector.phpindex 1476ee8365..4951acef85 100644--- a/app/Helpers/Collector/TransactionCollector.php+++ b/app/Helpers/Collector/TransactionCollector.php@@ -134,7 +134,7 @@ class TransactionCollector implements TransactionCollectorInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Helpers/FiscalHelper.php b/app/Helpers/FiscalHelper.phpindex 1b51cb021a..dbc1435db8 100644--- a/app/Helpers/FiscalHelper.php+++ b/app/Helpers/FiscalHelper.php@@ -40,7 +40,7 @@ class FiscalHelper implements FiscalHelperInterface{$this->useCustomFiscalYear = app('preferences')->get('customFiscalYear', false)->data;- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.phpindex d50720049b..c1de07fe15 100644--- a/app/Helpers/Help/Help.php+++ b/app/Helpers/Help/Help.php@@ -45,7 +45,7 @@ class Help implements HelpInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Helpers/Report/BalanceReportHelper.php b/app/Helpers/Report/BalanceReportHelper.phpindex 80825a2ffd..181e5532bc 100644--- a/app/Helpers/Report/BalanceReportHelper.php+++ b/app/Helpers/Report/BalanceReportHelper.php@@ -52,7 +52,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface{$this->budgetRepository = $budgetRepository;- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}diff --git a/app/Helpers/Report/BudgetReportHelper.php b/app/Helpers/Report/BudgetReportHelper.phpindex 357dc01040..6f64024634 100644--- a/app/Helpers/Report/BudgetReportHelper.php+++ b/app/Helpers/Report/BudgetReportHelper.php@@ -48,7 +48,7 @@ class BudgetReportHelper implements BudgetReportHelperInterface{$this->repository = $repository;- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}diff --git a/app/Helpers/Report/NetWorth.php b/app/Helpers/Report/NetWorth.phpindex ad20cc3bb0..0a2a01c46e 100644--- a/app/Helpers/Report/NetWorth.php+++ b/app/Helpers/Report/NetWorth.php@@ -53,7 +53,7 @@ class NetWorth implements NetWorthInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Helpers/Report/PopupReport.php b/app/Helpers/Report/PopupReport.phpindex a5fe92a31f..200a822847 100644--- a/app/Helpers/Report/PopupReport.php+++ b/app/Helpers/Report/PopupReport.php@@ -43,7 +43,7 @@ class PopupReport implements PopupReportInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.phpindex ef1b771c9c..1435630984 100644--- a/app/Helpers/Report/ReportHelper.php+++ b/app/Helpers/Report/ReportHelper.php@@ -53,7 +53,7 @@ class ReportHelper implements ReportHelperInterface{$this->budgetRepository = $budgetRepository;- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}diff --git a/app/Http/Controllers/Admin/ConfigurationController.php b/app/Http/Controllers/Admin/ConfigurationController.phpindex c2668ec2af..9292f8c387 100644--- a/app/Http/Controllers/Admin/ConfigurationController.php+++ b/app/Http/Controllers/Admin/ConfigurationController.php@@ -68,7 +68,7 @@ class ConfigurationController extends Controller// they don't exist yet.$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;$isDemoSite = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;- $siteOwner = env('SITE_OWNER');+ $siteOwner = config('firefly.site_owner');return view('admin.configuration.index',diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.phpindex f950b0a99b..877e01d6f4 100644--- a/app/Http/Controllers/Auth/ForgotPasswordController.php+++ b/app/Http/Controllers/Auth/ForgotPasswordController.php@@ -59,7 +59,8 @@ class ForgotPasswordController extends Controller*/public function sendResetLinkEmail(Request $request, UserRepositoryInterface $repository){- $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent');+ Log::info('Start of sendResetLinkEmail()');+ $loginProvider = config('firefly.login_provider');if ('eloquent' !== $loginProvider) {$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);Log::error($message);@@ -98,7 +99,7 @@ class ForgotPasswordController extends Controller*/public function showLinkRequestForm(){- $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent');+ $loginProvider = config('firefly.login_provider');if ('eloquent' !== $loginProvider) {$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.phpindex 3ca42b8fcc..113488efca 100644--- a/app/Http/Controllers/Auth/LoginController.php+++ b/app/Http/Controllers/Auth/LoginController.php@@ -130,7 +130,7 @@ class LoginController extends Controllerpublic function showLoginForm(Request $request){$count = DB::table('users')->count();- $loginProvider = envNonEmpty('LOGIN_PROVIDER', 'eloquent');+ $loginProvider = config('firefly.login_provider');$pageTitle = (string)trans('firefly.login_page_title');if (0 === $count && 'eloquent' === $loginProvider) {return redirect(route('register')); // @codeCoverageIgnorediff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.phpindex fec1f10e5a..312fc6931a 100644--- a/app/Http/Controllers/Auth/RegisterController.php+++ b/app/Http/Controllers/Auth/RegisterController.php@@ -72,7 +72,7 @@ class RegisterController extends Controller{// is allowed to?$allowRegistration = true;- $loginProvider = envNonEmpty('LOGIN_PROVIDER', 'eloquent');+ $loginProvider = config('firefly.login_provider');$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;$userCount = User::count();if (true === $singleUserMode && $userCount > 0 && 'eloquent' === $loginProvider) {@@ -113,7 +113,7 @@ class RegisterController extends Controllerpublic function showRegistrationForm(Request $request){$allowRegistration = true;- $loginProvider = envNonEmpty('LOGIN_PROVIDER', 'eloquent');+ $loginProvider = config('firefly.login_provider');$isDemoSite = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;$userCount = User::count();diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.phpindex fc420866e5..ae69e9a77f 100644--- a/app/Http/Controllers/Auth/ResetPasswordController.php+++ b/app/Http/Controllers/Auth/ResetPasswordController.php@@ -71,7 +71,7 @@ class ResetPasswordController extends Controller*/public function showResetForm(Request $request, $token = null){- $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent');+ $loginProvider = config('firefly.login_provider');if ('eloquent' !== $loginProvider) {$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);@@ -103,7 +103,7 @@ class ResetPasswordController extends Controller*/public function reset(Request $request){- $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent');+ $loginProvider = config('firefly.login_provider');if ('eloquent' !== $loginProvider) {$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.phpindex 79cf7ec63b..d6db6d5e34 100644--- a/app/Http/Controllers/Auth/TwoFactorController.php+++ b/app/Http/Controllers/Auth/TwoFactorController.php@@ -77,7 +77,7 @@ class TwoFactorController extends Controller{/** @var User $user */$user = auth()->user();- $siteOwner = env('SITE_OWNER', '');+ $siteOwner = config('firefly.site_owner');$title = (string)trans('firefly.two_factor_forgot_title');Log::info(diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.phpindex 9c8ee4fb29..4df71b4219 100644--- a/app/Http/Controllers/Controller.php+++ b/app/Http/Controllers/Controller.php@@ -63,8 +63,8 @@ class Controller extends BaseController// is site a demo site?$isDemoSite = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;app('view')->share('IS_DEMO_SITE', $isDemoSite);- app('view')->share('DEMO_USERNAME', env('DEMO_USERNAME', ''));- app('view')->share('DEMO_PASSWORD', env('DEMO_PASSWORD', ''));+ app('view')->share('DEMO_USERNAME', config('firefly.demo_username'));+ app('view')->share('DEMO_PASSWORD', config('firefly.demo_password'));app('view')->share('FF_VERSION', config('firefly.version'));$this->middleware(diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.phpindex c62e75d86e..4c72b09e3e 100644--- a/app/Http/Controllers/CurrencyController.php+++ b/app/Http/Controllers/CurrencyController.php@@ -77,7 +77,7 @@ class CurrencyController extends Controller/** @var User $user */$user = auth()->user();if (!$this->userRepository->hasRole($user, 'owner')) {- $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => env('SITE_OWNER')]));+ $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => config('firefly.site_owner')]));return redirect(route('currencies.index'));}@@ -127,7 +127,7 @@ class CurrencyController extends Controller$user = auth()->user();if (!$this->userRepository->hasRole($user, 'owner')) {// @codeCoverageIgnoreStart- $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => env('SITE_OWNER')]));+ $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => config('firefly.site_owner')]));return redirect(route('currencies.index'));// @codeCoverageIgnoreEnd@@ -160,7 +160,7 @@ class CurrencyController extends Controller$user = auth()->user();if (!$this->userRepository->hasRole($user, 'owner')) {// @codeCoverageIgnoreStart- $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => env('SITE_OWNER')]));+ $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => config('firefly.site_owner')]));return redirect(route('currencies.index'));// @codeCoverageIgnoreEnd@@ -192,7 +192,7 @@ class CurrencyController extends Controller$user = auth()->user();if (!$this->userRepository->hasRole($user, 'owner')) {// @codeCoverageIgnoreStart- $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => env('SITE_OWNER')]));+ $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => config('firefly.site_owner')]));return redirect(route('currencies.index'));// @codeCoverageIgnoreEnd@@ -236,7 +236,7 @@ class CurrencyController extends Controller$user = auth()->user();if (!$this->userRepository->hasRole($user, 'owner')) {// @codeCoverageIgnoreStart- $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => env('SITE_OWNER')]));+ $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => config('firefly.site_owner')]));return redirect(route('currencies.index'));// @codeCoverageIgnoreEnd@@ -308,7 +308,7 @@ class CurrencyController extends Controller$defaultCurrency = $this->repository->getCurrencyByPreference(app('preferences')->get('currencyPreference', config('firefly.default_currency', 'EUR')));$isOwner = true;if (!$this->userRepository->hasRole($user, 'owner')) {- $request->session()->flash('info', (string)trans('firefly.ask_site_owner', ['owner' => env('SITE_OWNER')]));+ $request->session()->flash('info', (string)trans('firefly.ask_site_owner', ['owner' => config('firefly.site_owner')]));$isOwner = false;}@@ -374,7 +374,7 @@ class CurrencyController extends Controller$user = auth()->user();if (!$this->userRepository->hasRole($user, 'owner')) {// @codeCoverageIgnoreStart- $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => env('SITE_OWNER')]));+ $request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => config('firefly.site_owner')]));return redirect(route('currencies.index'));// @codeCoverageIgnoreEnddiff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.phpindex f8d1452594..4557973b66 100644--- a/app/Http/Controllers/DebugController.php+++ b/app/Http/Controllers/DebugController.php@@ -128,19 +128,19 @@ class DebugController extends Controller$drivers = implode(', ', DB::availableDrivers());$currentDriver = DB::getDriverName();$userAgent = $request->header('user-agent');- $isSandstorm = var_export(env('IS_SANDSTORM', 'unknown'), true);- $isDocker = var_export(env('IS_DOCKER', 'unknown'), true);- $toSandbox = var_export(env('BUNQ_USE_SANDBOX', 'unknown'), true);- $trustedProxies = env('TRUSTED_PROXIES', '(none)');+ $isSandstorm = var_export(config('firefly.is_sandstorm'), true);+ $isDocker = var_export(config('firefly.is_docker'), true);+ $toSandbox = var_export(config('firefly.bunq_use_sandbox'), true);+ $trustedProxies = config('firefly.trusted_proxies');$displayErrors = ini_get('display_errors');- $storageDisks = implode(', ', config('filesystems.disks.upload.disks'));+ $storageDisks = implode(', ', config('filesystems.disks.upload.disks'));$errorReporting = $this->errorReporting((int)ini_get('error_reporting'));- $appEnv = env('APP_ENV', '');- $appDebug = var_export(env('APP_DEBUG', false), true);- $logChannel = env('LOG_CHANNEL', '');- $appLogLevel = env('APP_LOG_LEVEL', 'info');- $cacheDriver = env('CACHE_DRIVER', 'unknown');- $loginProvider = env('LOGIN_PROVIDER', 'unknown');+ $appEnv = config('app.env');+ $appDebug = var_export(config('app.debug'), true);+ $logChannel = config('logging.default');+ $appLogLevel = config('logging.level');+ $cacheDriver = config('cache.default');+ $loginProvider = config('auth.driver');// set languages, see what happens:$original = setlocale(LC_ALL, 0);@@ -179,7 +179,7 @@ class DebugController extends Controllerreturn view('debug', compact('phpVersion', 'extensions', 'localeAttempts', 'appEnv', 'appDebug', 'logChannel', 'appLogLevel', 'now', 'drivers',- 'currentDriver', 'loginProvider','storageDisks',+ 'currentDriver', 'loginProvider', 'storageDisks','userAgent', 'displayErrors', 'errorReporting', 'phpOs', 'interface', 'logContent', 'cacheDriver', 'isDocker', 'isSandstorm','trustedProxies','toSandbox'diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.phpindex 3799299e90..e82a6c9d35 100644--- a/app/Http/Controllers/SearchController.php+++ b/app/Http/Controllers/SearchController.php@@ -96,7 +96,7 @@ class SearchController extends Controllerif (!$cache->has()) {// parse search terms:$searcher->parseQuery($fullQuery);- $searcher->setLimit((int)env('SEARCH_RESULT_LIMIT', 50));+ $searcher->setLimit((int)config('firefly.search_result_limit'));$transactions = $searcher->searchTransactions();$cache->store($transactions);}diff --git a/app/Http/Middleware/Installer.php b/app/Http/Middleware/Installer.phpindex e34473b446..f7f96d5300 100644--- a/app/Http/Middleware/Installer.php+++ b/app/Http/Middleware/Installer.php@@ -54,7 +54,7 @@ class Installer*/public function handle($request, Closure $next){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {return $next($request);}$url = $request->url();diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.phpindex ad88b040d1..b8c4bed70d 100644--- a/app/Http/Middleware/Range.php+++ b/app/Http/Middleware/Range.php@@ -107,7 +107,7 @@ class Range*/private function loseItAll(Request $request): void{- if ('sqlite' === getenv('DB_CONNECTION') && true === getenv('IS_DOCKER')) {+ if ('sqlite' === config('database.default') && true === config('firefly.is_docker')) {// @codeCoverageIgnoreStart$request->session()->flash('error', 'You seem to be using SQLite in a Docker container. Don\'t do this. If the container restarts all your data will be gone.'diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.phpindex f25d417b12..82c7698769 100644--- a/app/Http/Middleware/SecureHeaders.php+++ b/app/Http/Middleware/SecureHeaders.php@@ -44,7 +44,7 @@ class SecureHeaders{$response = $next($request);$google = '';- $analyticsId = env('ANALYTICS_ID', '');+ $analyticsId = config('firefly.analytics_id');if ('' !== $analyticsId) {$google = 'www.googletagmanager.com/gtag/js'; // @codeCoverageIgnore}@@ -76,7 +76,7 @@ class SecureHeaders"payment 'none'",];- $disableFrameHeader = env('DISABLE_FRAME_HEADER');+ $disableFrameHeader = config('firefly.disable_frame_header');if (false === $disableFrameHeader || null === $disableFrameHeader) {$response->header('X-Frame-Options', 'deny');}diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.phpindex 59900edc22..9da1ef8336 100644--- a/app/Http/Middleware/TrustProxies.php+++ b/app/Http/Middleware/TrustProxies.php@@ -43,7 +43,7 @@ class TrustProxies extends Middleware*/public function __construct(Repository $config){- $trustedProxies = (string)env('TRUSTED_PROXIES', null);+ $trustedProxies = (string)config('firefly.trusted_proxies');$this->proxies = explode(',', $trustedProxies);if ('**' === $trustedProxies) {$this->proxies = '**';diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.phpindex 19adba7873..d778c3af8e 100644--- a/app/Http/Requests/TagFormRequest.php+++ b/app/Http/Requests/TagFormRequest.php@@ -63,7 +63,7 @@ class TagFormRequest extends Request'description' => $this->string('description'),'latitude' => $latitude,'longitude' => $longitude,- 'zoomLevel' => $zoomLevel,+ 'zoom_level' => $zoomLevel,];return $data;@@ -93,7 +93,7 @@ class TagFormRequest extends Request'date' => 'date|nullable','latitude' => 'numeric|min:-90|max:90|nullable','longitude' => 'numeric|min:-90|max:90|nullable',- 'zoomLevel' => 'numeric|min:0|max:80|nullable',+ 'zoom_level' => 'numeric|min:0|max:80|nullable',];}}diff --git a/app/Import/Prerequisites/BunqPrerequisites.php b/app/Import/Prerequisites/BunqPrerequisites.phpindex 55f07df71d..3da4d085a4 100644--- a/app/Import/Prerequisites/BunqPrerequisites.php+++ b/app/Import/Prerequisites/BunqPrerequisites.php@@ -156,7 +156,7 @@ class BunqPrerequisites implements PrerequisitesInterface*/private function getBunqEnvironment(): BunqEnumApiEnvironmentType{- $env = env('BUNQ_USE_SANDBOX');+ $env = config('firefly.bunq_use_sandbox');if (null === $env) {return BunqEnumApiEnvironmentType::PRODUCTION();}diff --git a/app/Import/Storage/ImportArrayStorage.php b/app/Import/Storage/ImportArrayStorage.phpindex 6f7601a78d..6da281f269 100644--- a/app/Import/Storage/ImportArrayStorage.php+++ b/app/Import/Storage/ImportArrayStorage.php@@ -337,7 +337,7 @@ class ImportArrayStorage'description' => null,'latitude' => null,'longitude' => null,- 'zoomLevel' => null,+ 'zoom_level' => null,'tagMode' => 'nothing',];$tag = $repository->store($data);diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.phpindex 09b43883c5..33d40834b6 100644--- a/app/Jobs/MailError.php+++ b/app/Jobs/MailError.php@@ -70,7 +70,7 @@ class MailError extends Job implements ShouldQueue*/public function handle(){- $email = env('SITE_OWNER');+ $email = config('firefly.site_owner');$args = $this->exception;$args['loggedIn'] = $this->userData['id'] > 0;$args['user'] = $this->userData;diff --git a/app/Models/Account.php b/app/Models/Account.phpindex c4a25daf2f..c5e01d1346 100644--- a/app/Models/Account.php+++ b/app/Models/Account.php@@ -58,6 +58,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;* @property string $interest* @property string $interestPeriod* @property string accountTypeString+ * @property Carbon created_at+ * @property Carbon updated_at** @SuppressWarnings(PHPMD.CouplingBetweenObjects)*/diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.phpindex f426485c0f..2d64950f07 100644--- a/app/Providers/AppServiceProvider.php+++ b/app/Providers/AppServiceProvider.php@@ -39,7 +39,7 @@ class AppServiceProvider extends ServiceProviderpublic function boot(): void{Schema::defaultStringLength(191);- if ('heroku' === env('APP_ENV')) {+ if ('heroku' === config('app.env')) {URL::forceScheme('https');}}diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.phpindex 3c0ef13f07..cbd0b9509f 100644--- a/app/Repositories/Account/AccountTasker.php+++ b/app/Repositories/Account/AccountTasker.php@@ -45,7 +45,7 @@ class AccountTasker implements AccountTaskerInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.phpindex c3b9987639..65edf00f02 100644--- a/app/Repositories/Attachment/AttachmentRepository.php+++ b/app/Repositories/Attachment/AttachmentRepository.php@@ -50,7 +50,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.phpindex 62d6acfd63..5b2d78cf74 100644--- a/app/Repositories/Bill/BillRepository.php+++ b/app/Repositories/Bill/BillRepository.php@@ -53,7 +53,7 @@ class BillRepository implements BillRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.phpindex 2d49847090..4437bb2875 100644--- a/app/Repositories/Budget/BudgetRepository.php+++ b/app/Repositories/Budget/BudgetRepository.php@@ -61,7 +61,7 @@ class BudgetRepository implements BudgetRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.phpindex 317c936f7b..70b63ca744 100644--- a/app/Repositories/Category/CategoryRepository.php+++ b/app/Repositories/Category/CategoryRepository.php@@ -52,7 +52,7 @@ class CategoryRepository implements CategoryRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.phpindex b921f7ba18..8a6575f39d 100644--- a/app/Repositories/Currency/CurrencyRepository.php+++ b/app/Repositories/Currency/CurrencyRepository.php@@ -50,7 +50,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.phpindex 0f2743c515..869585ea90 100644--- a/app/Repositories/ExportJob/ExportJobRepository.php+++ b/app/Repositories/ExportJob/ExportJobRepository.php@@ -44,7 +44,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.phpindex 81dc62f07b..18983bc8e1 100644--- a/app/Repositories/ImportJob/ImportJobRepository.php+++ b/app/Repositories/ImportJob/ImportJobRepository.php@@ -54,7 +54,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface$this->maxUploadSize = (int)config('firefly.maxUploadSize');$this->uploadDisk = Storage::disk('upload');- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.phpindex 938c6ea2f2..37c2769833 100644--- a/app/Repositories/Journal/JournalRepository.php+++ b/app/Repositories/Journal/JournalRepository.php@@ -61,7 +61,7 @@ class JournalRepository implements JournalRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/LinkType/LinkTypeRepository.php b/app/Repositories/LinkType/LinkTypeRepository.phpindex dc3cc71deb..4f0c0dbbde 100644--- a/app/Repositories/LinkType/LinkTypeRepository.php+++ b/app/Repositories/LinkType/LinkTypeRepository.php@@ -45,7 +45,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.phpindex 7e45411a99..97cda48d08 100644--- a/app/Repositories/PiggyBank/PiggyBankRepository.php+++ b/app/Repositories/PiggyBank/PiggyBankRepository.php@@ -49,7 +49,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.phpindex 803a34cb31..7c83d0064d 100644--- a/app/Repositories/Recurring/RecurringRepository.php+++ b/app/Repositories/Recurring/RecurringRepository.php@@ -61,7 +61,7 @@ class RecurringRepository implements RecurringRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.phpindex e8ad4e58c3..67120f56a0 100644--- a/app/Repositories/Rule/RuleRepository.php+++ b/app/Repositories/Rule/RuleRepository.php@@ -46,7 +46,7 @@ class RuleRepository implements RuleRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.phpindex cecfff130b..1cb3b47905 100644--- a/app/Repositories/RuleGroup/RuleGroupRepository.php+++ b/app/Repositories/RuleGroup/RuleGroupRepository.php@@ -42,7 +42,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.phpindex 10e807f748..f6db933e0a 100644--- a/app/Repositories/Tag/TagRepository.php+++ b/app/Repositories/Tag/TagRepository.php@@ -49,7 +49,7 @@ class TagRepository implements TagRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}@@ -373,7 +373,7 @@ class TagRepository implements TagRepositoryInterface$tag->description = $data['description'];$tag->latitude = $data['latitude'];$tag->longitude = $data['longitude'];- $tag->zoomLevel = $data['zoomLevel'];+ $tag->zoomLevel = $data['zoom_level'];$tag->save();return $tag;diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.phpindex 646bd248c9..cb7dd37c73 100644--- a/app/Repositories/User/UserRepository.php+++ b/app/Repositories/User/UserRepository.php@@ -41,7 +41,7 @@ class UserRepository implements UserRepositoryInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Currency/FixerIOv2.php b/app/Services/Currency/FixerIOv2.phpindex 90d5a6c33a..47bfa4c71a 100644--- a/app/Services/Currency/FixerIOv2.php+++ b/app/Services/Currency/FixerIOv2.php@@ -44,7 +44,7 @@ class FixerIOv2 implements ExchangeRateInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}@@ -70,7 +70,7 @@ class FixerIOv2 implements ExchangeRateInterface$exchangeRate->created_at = new Carbon;// get API key- $apiKey = env('FIXER_API_KEY', '');+ $apiKey = config('firefly.fixer_api_key');// if no API key, return unsaved exchange rate.if ('' === $apiKey) {diff --git a/app/Services/IP/IpifyOrg.php b/app/Services/IP/IpifyOrg.phpindex 8f1a7d7697..c1adfc490d 100644--- a/app/Services/IP/IpifyOrg.php+++ b/app/Services/IP/IpifyOrg.php@@ -39,7 +39,7 @@ class IpifyOrg implements IPRetrievalInterface*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Destroy/AccountDestroyService.php b/app/Services/Internal/Destroy/AccountDestroyService.phpindex a747cbd7fc..5fc61f8557 100644--- a/app/Services/Internal/Destroy/AccountDestroyService.php+++ b/app/Services/Internal/Destroy/AccountDestroyService.php@@ -43,7 +43,7 @@ class AccountDestroyService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Destroy/CategoryDestroyService.php b/app/Services/Internal/Destroy/CategoryDestroyService.phpindex 22a2fc8dd3..7a00e06942 100644--- a/app/Services/Internal/Destroy/CategoryDestroyService.php+++ b/app/Services/Internal/Destroy/CategoryDestroyService.php@@ -37,7 +37,7 @@ class CategoryDestroyService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Destroy/CurrencyDestroyService.php b/app/Services/Internal/Destroy/CurrencyDestroyService.phpindex 05869c4a54..3940fcb548 100644--- a/app/Services/Internal/Destroy/CurrencyDestroyService.php+++ b/app/Services/Internal/Destroy/CurrencyDestroyService.php@@ -37,7 +37,7 @@ class CurrencyDestroyService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Destroy/JournalDestroyService.php b/app/Services/Internal/Destroy/JournalDestroyService.phpindex c00e86aed7..ee67a9665e 100644--- a/app/Services/Internal/Destroy/JournalDestroyService.php+++ b/app/Services/Internal/Destroy/JournalDestroyService.php@@ -40,7 +40,7 @@ class JournalDestroyService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Destroy/RecurrenceDestroyService.php b/app/Services/Internal/Destroy/RecurrenceDestroyService.phpindex a0af5df8f3..68da18cc6f 100644--- a/app/Services/Internal/Destroy/RecurrenceDestroyService.php+++ b/app/Services/Internal/Destroy/RecurrenceDestroyService.php@@ -39,7 +39,7 @@ class RecurrenceDestroyService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/File/EncryptService.php b/app/Services/Internal/File/EncryptService.phpindex 50558c8586..97d93a44c8 100644--- a/app/Services/Internal/File/EncryptService.php+++ b/app/Services/Internal/File/EncryptService.php@@ -39,7 +39,7 @@ class EncryptService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Update/AccountUpdateService.php b/app/Services/Internal/Update/AccountUpdateService.phpindex 619d643129..86fedcf9a2 100644--- a/app/Services/Internal/Update/AccountUpdateService.php+++ b/app/Services/Internal/Update/AccountUpdateService.php@@ -38,7 +38,7 @@ class AccountUpdateService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Update/BillUpdateService.php b/app/Services/Internal/Update/BillUpdateService.phpindex fa6d2d98b6..6a504e5879 100644--- a/app/Services/Internal/Update/BillUpdateService.php+++ b/app/Services/Internal/Update/BillUpdateService.php@@ -39,7 +39,7 @@ class BillUpdateService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Update/CategoryUpdateService.php b/app/Services/Internal/Update/CategoryUpdateService.phpindex 0064a034c2..fdd10cbd60 100644--- a/app/Services/Internal/Update/CategoryUpdateService.php+++ b/app/Services/Internal/Update/CategoryUpdateService.php@@ -36,7 +36,7 @@ class CategoryUpdateService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Update/CurrencyUpdateService.php b/app/Services/Internal/Update/CurrencyUpdateService.phpindex 4d661a4e15..38149b77fe 100644--- a/app/Services/Internal/Update/CurrencyUpdateService.php+++ b/app/Services/Internal/Update/CurrencyUpdateService.php@@ -36,7 +36,7 @@ class CurrencyUpdateService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Update/JournalUpdateService.php b/app/Services/Internal/Update/JournalUpdateService.phpindex 483218200f..47027fe87c 100644--- a/app/Services/Internal/Update/JournalUpdateService.php+++ b/app/Services/Internal/Update/JournalUpdateService.php@@ -43,7 +43,7 @@ class JournalUpdateService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Internal/Update/TransactionUpdateService.php b/app/Services/Internal/Update/TransactionUpdateService.phpindex cae572b9e5..18b3359a5b 100644--- a/app/Services/Internal/Update/TransactionUpdateService.php+++ b/app/Services/Internal/Update/TransactionUpdateService.php@@ -39,7 +39,7 @@ class TransactionUpdateService*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Services/Password/PwndVerifierV2.php b/app/Services/Password/PwndVerifierV2.phpindex a5727ca004..e46498f75f 100644--- a/app/Services/Password/PwndVerifierV2.php+++ b/app/Services/Password/PwndVerifierV2.php@@ -38,7 +38,7 @@ class PwndVerifierV2 implements Verifier*/public function __construct(){- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}}diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.phpindex 52d7e7d22f..c2fb3a179a 100644--- a/app/Support/CacheProperties.php+++ b/app/Support/CacheProperties.php@@ -76,7 +76,7 @@ class CacheProperties*/public function has(): bool{- if ('testing' === getenv('APP_ENV')) {+ if ('testing' === config('app.env')) {return false;}$this->hash();diff --git a/app/Support/Search/Search.php b/app/Support/Search/Search.phpindex 86bed8decb..5a73e649ec 100644--- a/app/Support/Search/Search.php+++ b/app/Support/Search/Search.php@@ -56,7 +56,7 @@ class Search implements SearchInterface$this->modifiers = new Collection;$this->validModifiers = (array)config('firefly.search_modifiers');- if ('testing' === env('APP_ENV')) {+ if ('testing' === config('app.env')) {Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));}diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.phpindex e26f79374d..265db54739 100644--- a/app/Support/Twig/General.php+++ b/app/Support/Twig/General.php@@ -59,7 +59,6 @@ class General extends Twig_Extension$this->getCurrencyCode(),$this->getCurrencySymbol(),$this->phpdate(),- $this->env(),$this->activeRouteStrict(),$this->activeRoutePartial(),$this->activeRoutePartialWhat(),@@ -158,19 +157,6 @@ class General extends Twig_Extension);}- /**- * @return Twig_SimpleFunction- */- protected function env(): Twig_SimpleFunction- {- return new Twig_SimpleFunction(- 'env',- function (string $name, string $default): string {- return env($name, $default);- }- );- }-/*** @return Twig_SimpleFunction*/diff --git a/app/Transformers/AttachmentTransformer.php b/app/Transformers/AttachmentTransformer.phpindex 0682d7fd0c..576567fa72 100644--- a/app/Transformers/AttachmentTransformer.php+++ b/app/Transformers/AttachmentTransformer.php@@ -27,6 +27,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\Attachment;use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -51,6 +52,9 @@ class AttachmentTransformer extends TransformerAbstract{$this->parameters = $parameters;$this->repository = app(AttachmentRepositoryInterface::class);+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/AvailableBudgetTransformer.php b/app/Transformers/AvailableBudgetTransformer.phpindex 010e630d18..c217547059 100644--- a/app/Transformers/AvailableBudgetTransformer.php+++ b/app/Transformers/AvailableBudgetTransformer.php@@ -26,6 +26,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\AvailableBudget;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -46,6 +47,9 @@ class AvailableBudgetTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/BillTransformer.php b/app/Transformers/BillTransformer.phpindex b19d4cb638..53cdc1ce24 100644--- a/app/Transformers/BillTransformer.php+++ b/app/Transformers/BillTransformer.php@@ -56,6 +56,9 @@ class BillTransformer extends TransformerAbstract{$this->parameters = $parameters;$this->repository = app(BillRepositoryInterface::class);+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/BudgetLimitTransformer.php b/app/Transformers/BudgetLimitTransformer.phpindex 95e1ad68f0..0419efe726 100644--- a/app/Transformers/BudgetLimitTransformer.php+++ b/app/Transformers/BudgetLimitTransformer.php@@ -25,6 +25,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\BudgetLimit;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -45,6 +46,9 @@ class BudgetLimitTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/BudgetTransformer.php b/app/Transformers/BudgetTransformer.phpindex 5c2ba8e0fd..e150e6f543 100644--- a/app/Transformers/BudgetTransformer.php+++ b/app/Transformers/BudgetTransformer.php@@ -28,6 +28,7 @@ use FireflyIII\Models\Budget;use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;use Illuminate\Support\Collection;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -48,6 +49,9 @@ class BudgetTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/CategoryTransformer.php b/app/Transformers/CategoryTransformer.phpindex 4ac409d1ec..2412162298 100644--- a/app/Transformers/CategoryTransformer.php+++ b/app/Transformers/CategoryTransformer.php@@ -31,6 +31,7 @@ use FireflyIII\Models\TransactionCurrency;use FireflyIII\Repositories\Category\CategoryRepositoryInterface;use Illuminate\Support\Collection;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -51,6 +52,9 @@ class CategoryTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/CurrencyExchangeRateTransformer.php b/app/Transformers/CurrencyExchangeRateTransformer.phpindex edd3575e7e..4e2c4872c7 100644--- a/app/Transformers/CurrencyExchangeRateTransformer.php+++ b/app/Transformers/CurrencyExchangeRateTransformer.php@@ -26,6 +26,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\CurrencyExchangeRate;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -46,6 +47,9 @@ class CurrencyExchangeRateTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/CurrencyTransformer.php b/app/Transformers/CurrencyTransformer.phpindex 4ec2288a49..a052c17012 100644--- a/app/Transformers/CurrencyTransformer.php+++ b/app/Transformers/CurrencyTransformer.php@@ -25,6 +25,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\TransactionCurrency;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -45,6 +46,9 @@ class CurrencyTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/ImportJobTransformer.php b/app/Transformers/ImportJobTransformer.phpindex 521a90668e..5d2b5e8cd8 100644--- a/app/Transformers/ImportJobTransformer.php+++ b/app/Transformers/ImportJobTransformer.php@@ -26,6 +26,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\ImportJob;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -46,6 +47,9 @@ class ImportJobTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}diff --git a/app/Transformers/JournalLinkTransformer.php b/app/Transformers/JournalLinkTransformer.phpindex e82d3a396f..52b0951771 100644--- a/app/Transformers/JournalLinkTransformer.php+++ b/app/Transformers/JournalLinkTransformer.php@@ -27,6 +27,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\Note;use FireflyIII\Models\TransactionJournalLink;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -48,6 +49,9 @@ class JournalLinkTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/JournalMetaTransformer.php b/app/Transformers/JournalMetaTransformer.phpindex 33067e02ba..d0efd43c9f 100644--- a/app/Transformers/JournalMetaTransformer.php+++ b/app/Transformers/JournalMetaTransformer.php@@ -29,6 +29,7 @@ use FireflyIII\Models\TransactionJournalMeta;use Illuminate\Support\Collection;use League\Fractal\Resource\Collection as FractalCollection;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -49,6 +50,9 @@ class JournalMetaTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/LinkTypeTransformer.php b/app/Transformers/LinkTypeTransformer.phpindex 0868c45bc3..b7b7dea683 100644--- a/app/Transformers/LinkTypeTransformer.php+++ b/app/Transformers/LinkTypeTransformer.php@@ -26,6 +26,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\LinkType;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -61,6 +62,9 @@ class LinkTypeTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/NoteTransformer.php b/app/Transformers/NoteTransformer.phpindex 4bb7dbce51..415432f4ba 100644--- a/app/Transformers/NoteTransformer.php+++ b/app/Transformers/NoteTransformer.php@@ -27,6 +27,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\Note;use League\CommonMark\CommonMarkConverter;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -60,6 +61,9 @@ class NoteTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/PiggyBankEventTransformer.php b/app/Transformers/PiggyBankEventTransformer.phpindex 673dabba17..3f436e74e6 100644--- a/app/Transformers/PiggyBankEventTransformer.php+++ b/app/Transformers/PiggyBankEventTransformer.php@@ -28,6 +28,7 @@ use FireflyIII\Models\PiggyBankEvent;use FireflyIII\Repositories\Account\AccountRepositoryInterface;use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -48,6 +49,9 @@ class PiggyBankEventTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/PiggyBankTransformer.php b/app/Transformers/PiggyBankTransformer.phpindex 9ae7195a00..32e1e0ff61 100644--- a/app/Transformers/PiggyBankTransformer.php+++ b/app/Transformers/PiggyBankTransformer.php@@ -30,29 +30,23 @@ use FireflyIII\Models\PiggyBank;use FireflyIII\Repositories\Account\AccountRepositoryInterface;use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;-use League\Fractal\Resource\Collection as FractalCollection;-use League\Fractal\Resource\Item;-use League\Fractal\TransformerAbstract;-use Symfony\Component\HttpFoundation\ParameterBag;+use Log;/*** Class PiggyBankTransformer*/-class PiggyBankTransformer extends TransformerAbstract+class PiggyBankTransformer extends AbstractTransformer{- /** @var ParameterBag */- protected $parameters;-/*** PiggyBankTransformer constructor.** @codeCoverageIgnore- *- * @param ParameterBag $parameters*/- public function __construct(ParameterBag $parameters)+ public function __construct(){- $this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}diff --git a/app/Transformers/PreferenceTransformer.php b/app/Transformers/PreferenceTransformer.phpindex 8061f88523..c75cf49b7a 100644--- a/app/Transformers/PreferenceTransformer.php+++ b/app/Transformers/PreferenceTransformer.php@@ -26,6 +26,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\Preference;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -44,6 +45,9 @@ class PreferenceTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/RecurrenceTransformer.php b/app/Transformers/RecurrenceTransformer.phpindex 9e5df6a545..3f1a1be985 100644--- a/app/Transformers/RecurrenceTransformer.php+++ b/app/Transformers/RecurrenceTransformer.php@@ -37,6 +37,7 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -60,6 +61,9 @@ class RecurrenceTransformer extends TransformerAbstract{$this->repository = app(RecurringRepositoryInterface::class);$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/RuleActionTransformer.php b/app/Transformers/RuleActionTransformer.phpindex 89a7160208..33d59ed0f1 100644--- a/app/Transformers/RuleActionTransformer.php+++ b/app/Transformers/RuleActionTransformer.php@@ -26,6 +26,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\RuleAction;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -47,6 +48,9 @@ class RuleActionTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/RuleGroupTransformer.php b/app/Transformers/RuleGroupTransformer.phpindex a3b1d2a7f1..9003b399b4 100644--- a/app/Transformers/RuleGroupTransformer.php+++ b/app/Transformers/RuleGroupTransformer.php@@ -25,6 +25,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\RuleGroup;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -45,6 +46,9 @@ class RuleGroupTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/RuleTransformer.php b/app/Transformers/RuleTransformer.phpindex a5b8944682..51382c5964 100644--- a/app/Transformers/RuleTransformer.php+++ b/app/Transformers/RuleTransformer.php@@ -28,6 +28,7 @@ use FireflyIII\Models\Rule;use FireflyIII\Models\RuleAction;use FireflyIII\Models\RuleTrigger;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -48,6 +49,9 @@ class RuleTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/RuleTriggerTransformer.php b/app/Transformers/RuleTriggerTransformer.phpindex 1fbd638c24..5e03033f66 100644--- a/app/Transformers/RuleTriggerTransformer.php+++ b/app/Transformers/RuleTriggerTransformer.php@@ -26,6 +26,7 @@ namespace FireflyIII\Transformers;use FireflyIII\Models\RuleTrigger;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -46,6 +47,9 @@ class RuleTriggerTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/TagTransformer.php b/app/Transformers/TagTransformer.phpindex a3a862f330..5b0ec28b9d 100644--- a/app/Transformers/TagTransformer.php+++ b/app/Transformers/TagTransformer.php@@ -29,6 +29,7 @@ use FireflyIII\Models\Tag;use League\Fractal\Resource\Collection as FractalCollection;use League\Fractal\Resource\Item;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -50,6 +51,9 @@ class TagTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/TransactionTransformer.php b/app/Transformers/TransactionTransformer.phpindex 58ded272f2..bc6bf6ce15 100644--- a/app/Transformers/TransactionTransformer.php+++ b/app/Transformers/TransactionTransformer.php@@ -35,11 +35,8 @@ use Symfony\Component\HttpFoundation\ParameterBag;/*** Class TransactionTransformer*/-class TransactionTransformer extends TransformerAbstract+class TransactionTransformer extends AbstractTransformer{- /** @var ParameterBag */- protected $parameters;-/** @var JournalRepositoryInterface */protected $repository;@@ -47,14 +44,13 @@ class TransactionTransformer extends TransformerAbstract* TransactionTransformer constructor.** @codeCoverageIgnore- *- * @param ParameterBag $parameters- * @param JournalRepositoryInterface $repository*/- public function __construct(ParameterBag $parameters)+ public function __construct(){- $this->parameters = $parameters;$this->repository = app(JournalRepositoryInterface::class);+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/**diff --git a/app/Transformers/UserTransformer.php b/app/Transformers/UserTransformer.phpindex ace2097a48..f8ec7e7e9c 100644--- a/app/Transformers/UserTransformer.php+++ b/app/Transformers/UserTransformer.php@@ -28,6 +28,7 @@ use FireflyIII\Models\Role;use FireflyIII\User;use League\Fractal\Resource\Collection as FractalCollection;use League\Fractal\TransformerAbstract;+use Log;use Symfony\Component\HttpFoundation\ParameterBag;/**@@ -48,6 +49,9 @@ class UserTransformer extends TransformerAbstractpublic function __construct(ParameterBag $parameters){$this->parameters = $parameters;+ if ('testing' === config('app.env')) {+ Log::warning(sprintf('%s should not be instantiated in the TEST environment!', \get_class($this)));+ }}/*** Transform user.diff --git a/config/firefly.php b/config/firefly.phpindex 50d2aa7994..af77d499fa 100644--- a/config/firefly.php+++ b/config/firefly.php@@ -95,6 +95,21 @@ return ['api_version' => '0.9.0','db_version' => 6,'maxUploadSize' => 15242880,+ 'send_error_message' => env('SEND_ERROR_MESSAGE', true),+ 'site_owner' => env('SITE_OWNER', ''),+ 'send_registration_mail' => env('SEND_REGISTRATION_MAIL', true),+ 'demo_username' => env('DEMO_USERNAME', ''),+ 'demo_password' => env('DEMO_PASSWORD', ''),+ 'is_sandstorm' => env('IS_SANDSTORM', 'unknown'),+ 'is_docker' => env('IS_DOCKER', 'unknown'),+ 'bunq_use_sandbox' => env('BUNQ_USE_SANDBOX', false),+ 'fixer_api_key' => env('FIXER_API_KEY', ''),+ 'mapbox_api_key' => env('MAPBOX_API_KEY', ''),+ 'trusted_proxies' => env('TRUSTED_PROXIES', ''),+ 'search_result_limit' => env('SEARCH_RESULT_LIMIT', 50),+ 'send_report_journals' => envNonEmpty('SEND_REPORT_JOURNALS', true),+ 'analytics_id' => env('ANALYTICS_ID', ''),+ 'disable_frame_header' => env('DISABLE_FRAME_HEADER', false),'login_provider' => envNonEmpty('LOGIN_PROVIDER', 'eloquent'),'allowedMimes' => [/* plain files */diff --git a/resources/views/v1/auth/login.twig b/resources/views/v1/auth/login.twigindex 2029179ad5..ad0a5feae8 100644--- a/resources/views/v1/auth/login.twig+++ b/resources/views/v1/auth/login.twig@@ -54,7 +54,7 @@<input type="hidden" name="_token" value="{{ csrf_token() }}"/><div class="form-group has-feedback">- {% if env('LOGIN_PROVIDER', 'eloquent') == 'eloquent' %}+ {% if config('firefly.login_provider') == 'eloquent' %}<input type="email" autocomplete="email" name="email" value="{{ email }}" class="form-control" placeholder="{{ trans('form.email') }}"/>{% else %}<input type="text" autocomplete="username" name="email" value="{{ email }}" class="form-control" placeholder="{{ trans('form.login_name') }}"/>diff --git a/resources/views/v1/layout/default.twig b/resources/views/v1/layout/default.twigindex 406ed8d15d..4c7a08f7ab 100644--- a/resources/views/v1/layout/default.twig+++ b/resources/views/v1/layout/default.twig@@ -199,15 +199,15 @@{% endif %}{% block scripts %}{% endblock %}-{% if env('ANALYTICS_ID','') != '' %}+{% if config('firefly.analytics_id') != '' %}<!-- Global site tag (gtag.js) - Google Analytics -->- <script async src="https://www.googletagmanager.com/gtag/js?id={{ env('ANALYTICS_ID', 'XXX-XX-X') }}"></script>+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ config('firefly.analytics_id') }}"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());- gtag('config', '{{ env('ANALYTICS_ID', 'XXX-XX-X') }}');+ gtag('config', '{{ config('firefly.analytics_id') }}');</script>{% endif %}diff --git a/resources/views/v1/layout/empty.twig b/resources/views/v1/layout/empty.twigindex 8ecb62d9b1..d45d1236bb 100644--- a/resources/views/v1/layout/empty.twig+++ b/resources/views/v1/layout/empty.twig@@ -41,15 +41,15 @@</div><script src="v1/js/app.js?v={{ FF_VERSION }}" type="text/javascript"></script>-{% if env('ANALYTICS_ID','') != '' %}+{% if config('firefly.analytics_id') != '' %}<!-- Global site tag (gtag.js) - Google Analytics -->- <script async src="https://www.googletagmanager.com/gtag/js?id={{ env('ANALYTICS_ID', 'XXX-XX-X') }}"></script>+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ config('firefly.analytics_id') }}"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());- gtag('config', '{{ env('ANALYTICS_ID', 'XXX-XX-X') }}');+ gtag('config', '{{ config('firefly.analytics_id') }}');</script>{% endif %}</body>diff --git a/resources/views/v1/layout/guest.twig b/resources/views/v1/layout/guest.twigindex 8a442c417a..cd5f2eb525 100644--- a/resources/views/v1/layout/guest.twig+++ b/resources/views/v1/layout/guest.twig@@ -50,15 +50,15 @@</div><script src="v1/js/app.js?v={{ FF_VERSION }}" type="text/javascript"></script><script type="text/javascript" src="v1/js/ff/guest.js?v={{ FF_VERSION }}"></script>-{% if env('ANALYTICS_ID','') != '' %}+{% if config('firefly.analytics_id') != '' %}<!-- Global site tag (gtag.js) - Google Analytics -->- <script async src="https://www.googletagmanager.com/gtag/js?id={{ env('ANALYTICS_ID', 'XXX-XX-X') }}"></script>+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ config('firefly.analytics_id') }}"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());- gtag('config', '{{ env('ANALYTICS_ID', 'XXX-XX-X') }}');+ gtag('config', '{{ config('firefly.analytics_id') }}');</script>{% endif %}</body>diff --git a/resources/views/v1/tags/create.twig b/resources/views/v1/tags/create.twigindex 1af998a2da..cbf7e474c6 100644--- a/resources/views/v1/tags/create.twig+++ b/resources/views/v1/tags/create.twig@@ -82,7 +82,7 @@{% endif %}// token for Mapbox:- var mapboxToken = "{{ env('MAPBOX_API_KEY','') }}";+ var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";</script><script src="lib/leaflet/leaflet.js?v={{ FF_VERSION }}"></script>diff --git a/resources/views/v1/tags/edit.twig b/resources/views/v1/tags/edit.twigindex 88dee7f3b6..7529d90336 100644--- a/resources/views/v1/tags/edit.twig+++ b/resources/views/v1/tags/edit.twig@@ -86,7 +86,7 @@// token for Mapbox:- var mapboxToken = "{{ env('MAPBOX_API_KEY','') }}";+ var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";</script><script src="lib/leaflet/leaflet.js?v={{ FF_VERSION }}"></script>diff --git a/resources/views/v1/tags/show.twig b/resources/views/v1/tags/show.twigindex 80caca5c2f..62b5ad1ca9 100644--- a/resources/views/v1/tags/show.twig+++ b/resources/views/v1/tags/show.twig@@ -183,7 +183,7 @@{% endif %}// token for Mapbox:- var mapboxToken = "{{ env('MAPBOX_API_KEY','') }}";+ var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";</script><script src="lib/leaflet/leaflet.js?v={{ FF_VERSION }}"></script>diff --git a/resources/views/v2/auth/login.twig b/resources/views/v2/auth/login.twigindex ff48d5c8e1..56d0b419d3 100644--- a/resources/views/v2/auth/login.twig+++ b/resources/views/v2/auth/login.twig@@ -39,7 +39,7 @@</p>{% endif %}<div class="form-group">- {% if env('LOGIN_PROVIDER', 'eloquent') == 'eloquent' %}+ {% if config('firefly.login_provider') == 'eloquent' %}<label class="form-label">{{ trans('form.email') }}</label><input type="email" class="{% if errors.has('email') %}is-invalid{% endif %} form-control" name="email" id="email" value="{{ old('email') }}" autocomplete="email" aria-describedby="emailHelp" placeholder="{{ trans('form.email') }}" required>{% if errors.has('email') %}