From 87d3d14504920ef665be0be901f386ca1b8f92e7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 1 Oct 2025 20:28:24 +0200 Subject: [PATCH 01/26] Fix #10990 --- .../Models/PiggyBank/UpdateController.php | 4 ---- .../Requests/Models/Transaction/UpdateRequest.php | 10 +++++----- app/Factory/PiggyBankFactory.php | 14 +++++++++----- app/Repositories/PiggyBank/ModifiesPiggyBanks.php | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/Api/V1/Controllers/Models/PiggyBank/UpdateController.php b/app/Api/V1/Controllers/Models/PiggyBank/UpdateController.php index 94a6d2e022..ba53793505 100644 --- a/app/Api/V1/Controllers/Models/PiggyBank/UpdateController.php +++ b/app/Api/V1/Controllers/Models/PiggyBank/UpdateController.php @@ -68,10 +68,6 @@ class UpdateController extends Controller $data = $request->getAll(); $piggyBank = $this->repository->update($piggyBank, $data); - if (array_key_exists('current_amount', $data) && '' !== $data['current_amount']) { - $this->repository->setCurrentAmount($piggyBank, $data['current_amount']); - } - // enrich /** @var User $admin */ $admin = auth()->user(); diff --git a/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php b/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php index 7a2d0a7be4..023a48169e 100644 --- a/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php @@ -64,7 +64,7 @@ class UpdateRequest extends FormRequest */ public function getAll(): array { - app('log')->debug(sprintf('Now in %s', __METHOD__)); + Log::debug(sprintf('Now in %s', __METHOD__)); $this->integerFields = ['order', 'currency_id', 'foreign_currency_id', 'transaction_journal_id', 'source_id', 'destination_id', 'budget_id', 'category_id', 'bill_id', 'recurrence_id']; $this->dateFields = ['date', 'interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date']; $this->textareaFields = ['notes']; @@ -97,7 +97,7 @@ class UpdateRequest extends FormRequest */ private function getTransactionData(): array { - app('log')->debug(sprintf('Now in %s', __METHOD__)); + Log::debug(sprintf('Now in %s', __METHOD__)); $return = []; /** @var null|array $transactions */ @@ -181,7 +181,7 @@ class UpdateRequest extends FormRequest private function getDateData(array $current, array $transaction): array { foreach ($this->dateFields as $fieldName) { - app('log')->debug(sprintf('Now at date field %s', $fieldName)); + Log::debug(sprintf('Now at date field %s', $fieldName)); if (array_key_exists($fieldName, $transaction)) { Log::debug(sprintf('New value: "%s"', $transaction[$fieldName])); $current[$fieldName] = $this->dateFromValue((string) $transaction[$fieldName]); @@ -247,7 +247,7 @@ class UpdateRequest extends FormRequest */ public function rules(): array { - app('log')->debug(sprintf('Now in %s', __METHOD__)); + Log::debug(sprintf('Now in %s', __METHOD__)); $validProtocols = config('firefly.valid_url_protocols'); return [ @@ -330,7 +330,7 @@ class UpdateRequest extends FormRequest */ public function withValidator(Validator $validator): void { - app('log')->debug('Now in withValidator'); + Log::debug('Now in withValidator'); /** @var TransactionGroup $transactionGroup */ $transactionGroup = $this->route()->parameter('transactionGroup'); diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.php index 40455001d3..bc6b9f9f8a 100644 --- a/app/Factory/PiggyBankFactory.php +++ b/app/Factory/PiggyBankFactory.php @@ -242,7 +242,7 @@ class PiggyBankFactory } } } - + Log::debug('Looping all accounts.'); /** @var array $info */ foreach ($accounts as $info) { $account = $this->accountRepository->find((int)($info['account_id'] ?? 0)); @@ -251,6 +251,7 @@ class PiggyBankFactory continue; } + Log::debug(sprintf('Working on account #%d', $account->id)); if (array_key_exists('current_amount', $info) && null !== $info['current_amount']) { // an amount is set, first check out if there is a difference with the previous amount. $previous = $toBeLinked[$account->id]['current_amount'] ?? '0'; @@ -258,22 +259,24 @@ class PiggyBankFactory // create event for difference. if (0 !== bccomp($diff, '0')) { + // 2025-10-01 for issue #10990 disable this event. Log::debug(sprintf('[a] Will save event for difference %s (previous value was %s)', $diff, $previous)); - event(new ChangedAmount($piggyBank, $diff, null, null)); + // event(new ChangedAmount($piggyBank, $diff, null, null)); } $toBeLinked[$account->id] = ['current_amount' => $info['current_amount']]; Log::debug(sprintf('[a] Will link account #%d with amount %s', $account->id, $info['current_amount'])); } if (array_key_exists('current_amount', $info) && null === $info['current_amount']) { - // an amount is set, first check out if there is a difference with the previous amount. + // no amount is set, first check out if there is a difference with the previous amount. $previous = $toBeLinked[$account->id]['current_amount'] ?? '0'; $diff = bcsub('0', $previous); // create event for difference. if (0 !== bccomp($diff, '0')) { + // 2025-10-01 for issue #10990 disable this event. Log::debug(sprintf('[b] Will save event for difference %s (previous value was %s)', $diff, $previous)); - event(new ChangedAmount($piggyBank, $diff, null, null)); + // event(new ChangedAmount($piggyBank, $diff, null, null)); } // no amount set, use previous amount or go to ZERO. @@ -282,7 +285,8 @@ class PiggyBankFactory // create event: Log::debug('linkToAccountIds: Trigger change for positive amount [b].'); - event(new ChangedAmount($piggyBank, $toBeLinked[$account->id]['current_amount'] ?? '0', null, null)); + // 2025-10-01 for issue #10990 disable this event. + // event(new ChangedAmount($piggyBank, $toBeLinked[$account->id]['current_amount'] ?? '0', null, null)); } if (!array_key_exists('current_amount', $info)) { $toBeLinked[$account->id] ??= []; diff --git a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php index e63da28927..734cfe8b0f 100644 --- a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php +++ b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php @@ -36,6 +36,7 @@ use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups; use FireflyIII\Support\Facades\Amount; +use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Http\Api\ExchangeRateConverter; use Illuminate\Support\Facades\Log; @@ -227,7 +228,6 @@ trait ModifiesPiggyBanks $factory->user = $this->user; // the piggy bank currency is set or updated FIRST, if it exists. - $factory->linkToAccountIds($piggyBank, $data['accounts'] ?? []); @@ -244,7 +244,7 @@ trait ModifiesPiggyBanks // question is, from which account(s) to remove the difference? // solution: just start from the top until there is no more money left to remove. - $this->removeAmountFromAll($piggyBank, app('steam')->positive($difference)); + $this->removeAmountFromAll($piggyBank, Steam::positive($difference)); } // update using name: From 3b85f87502ad98579af577c75d20948d92798b75 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 2 Oct 2025 06:53:23 +0200 Subject: [PATCH 02/26] Stop using "db_version", check versions instead. --- .../Commands/System/OutputsInstructions.php | 59 ++++++------ app/Http/Middleware/Installer.php | 60 +----------- .../FireflyIIIOrg/Update/UpdateRequest.php | 11 +-- app/Support/System/IsOldVersion.php | 94 +++++++++++++++++++ config/firefly.php | 2 +- 5 files changed, 131 insertions(+), 95 deletions(-) create mode 100644 app/Support/System/IsOldVersion.php diff --git a/app/Console/Commands/System/OutputsInstructions.php b/app/Console/Commands/System/OutputsInstructions.php index fb99e99692..1e8c0b6d80 100644 --- a/app/Console/Commands/System/OutputsInstructions.php +++ b/app/Console/Commands/System/OutputsInstructions.php @@ -26,16 +26,18 @@ namespace FireflyIII\Console\Commands\System; use Carbon\Carbon; use FireflyIII\Support\System\GeneratesInstallationId; +use FireflyIII\Support\System\IsOldVersion; use Illuminate\Console\Command; use Random\RandomException; class OutputsInstructions extends Command { use GeneratesInstallationId; + use IsOldVersion; protected $description = 'Instructions in case of upgrade trouble.'; - protected $signature = 'firefly-iii:instructions {task=install}'; + protected $signature = 'firefly-iii:instructions {task=install}'; /** * Execute the console command. @@ -58,26 +60,26 @@ class OutputsInstructions extends Command */ private function updateInstructions(): void { - $version = (string) config('firefly.version'); + $version = (string)config('firefly.version'); /** @var array $config */ - $config = config('upgrade.text.upgrade'); - $text = ''; + $config = config('upgrade.text.upgrade'); + $text = ''; /** @var string $compare */ foreach (array_keys($config) as $compare) { // if string starts with: if (str_starts_with($version, $compare)) { - $text = (string) $config[$compare]; + $text = (string)$config[$compare]; } } // validate some settings. - if ('' === $text && 'local' === (string) config('app.env')) { + if ('' === $text && 'local' === (string)config('app.env')) { $text = 'Please set APP_ENV=production for a safer environment.'; } - $prefix = 'v'; + $prefix = 'v'; if (str_starts_with($version, 'develop') || str_starts_with($version, 'branch')) { $prefix = ''; } @@ -114,8 +116,8 @@ class OutputsInstructions extends Command */ private function showLogo(): void { - $today = Carbon::now()->format('m-d'); - $month = Carbon::now()->format('m'); + $today = Carbon::now()->format('m-d'); + $month = Carbon::now()->format('m'); // variation in colors and effects just because I can! // default is Ukraine flag: $colors = ['blue', 'blue', 'blue', 'yellow', 'yellow', 'yellow', 'default', 'default']; @@ -164,7 +166,7 @@ class OutputsInstructions extends Command { $parts = explode("\n", wordwrap($text)); foreach ($parts as $string) { - $this->line('| '.sprintf('%-77s', $string).'|'); + $this->line('| ' . sprintf('%-77s', $string) . '|'); } } @@ -175,7 +177,7 @@ class OutputsInstructions extends Command { $parts = explode("\n", wordwrap($text)); foreach ($parts as $string) { - $this->info('| '.sprintf('%-77s', $string).'|'); + $this->info('| ' . sprintf('%-77s', $string) . '|'); } } @@ -191,26 +193,26 @@ class OutputsInstructions extends Command */ private function installInstructions(): void { - $version = (string) config('firefly.version'); + $version = (string)config('firefly.version'); /** @var array $config */ - $config = config('upgrade.text.install'); - $text = ''; + $config = config('upgrade.text.install'); + $text = ''; /** @var string $compare */ foreach (array_keys($config) as $compare) { // if string starts with: if (str_starts_with($version, $compare)) { - $text = (string) $config[$compare]; + $text = (string)$config[$compare]; } } // validate some settings. - if ('' === $text && 'local' === (string) config('app.env')) { + if ('' === $text && 'local' === (string)config('app.env')) { $text = 'Please set APP_ENV=production for a safer environment.'; } - $prefix = 'v'; + $prefix = 'v'; if (str_starts_with($version, 'develop')) { $prefix = ''; } @@ -242,14 +244,15 @@ class OutputsInstructions extends Command private function someQuote(): void { - $lines = [ - 'Forgive yourself for not being at peace.', - 'Doesn\'t look like anything to me.', - 'Be proud of what you make.', - 'Be there or forever wonder.', - 'A year from now you will wish you had started today.', + $lines = [ + '"Forgive yourself for not being at peace."', + '"Doesn\'t look like anything to me."', + '"Be proud of what you make."', + '"Be there or forever wonder."', + '"A year from now you will wish you had started today."', + '🇺🇦 Слава Україні!', + '🇺🇦 Slava Ukraini!', ]; - $addQuotes = true; // fuck the Russian aggression in Ukraine. @@ -260,8 +263,7 @@ class OutputsInstructions extends Command // going on, to allow that to happen. if ('ru_RU' === config('firefly.default_language')) { - $addQuotes = false; - $lines = [ + $lines = [ '🇺🇦 Слава Україні!', '🇺🇦 Slava Ukraini!', ]; @@ -272,11 +274,6 @@ class OutputsInstructions extends Command } catch (RandomException) { $random = 0; } - if ($addQuotes) { - $this->line(sprintf(' "%s"', $lines[$random])); - - return; - } $this->line(sprintf(' %s', $lines[$random])); } diff --git a/app/Http/Middleware/Installer.php b/app/Http/Middleware/Installer.php index f7d38232ca..79f9494929 100644 --- a/app/Http/Middleware/Installer.php +++ b/app/Http/Middleware/Installer.php @@ -26,6 +26,8 @@ namespace FireflyIII\Http\Middleware; use Closure; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Support\FireflyConfig; +use FireflyIII\Support\System\IsOldVersion; use FireflyIII\Support\System\OAuthKeys; use Illuminate\Database\QueryException; use Illuminate\Http\Request; @@ -37,6 +39,7 @@ use Illuminate\Support\Facades\Log; */ class Installer { + use IsOldVersion; /** * Handle an incoming request. * @@ -65,7 +68,7 @@ class Installer // run installer when no tables are present, // or when old scheme version // or when old firefly version - if ($this->hasNoTables() || $this->oldDBVersion() || $this->oldVersion()) { + if ($this->hasNoTables() || $this->isOldVersionInstalled()) { return response()->redirectTo(route('installer.index')); } OAuthKeys::verifyKeysRoutine(); @@ -126,59 +129,4 @@ class Installer { return false !== stripos($message, 'Base table or view not found'); } - - /** - * Check if the "db_version" variable is correct. - */ - private function oldDBVersion(): bool - { - // older version in config than database? - $configVersion = (int) config('firefly.db_version'); - $dbVersion = (int) app('fireflyconfig')->getFresh('db_version', 1)->data; - if ($configVersion > $dbVersion) { - Log::warning( - sprintf( - 'The current configured version (%d) is older than the required version (%d). Redirect to migrate routine.', - $dbVersion, - $configVersion - ) - ); - - return true; - } - - // Log::info(sprintf('Configured DB version (%d) equals expected DB version (%d)', $dbVersion, $configVersion)); - - return false; - } - - /** - * Check if the "firefly_version" variable is correct. - */ - private function oldVersion(): bool - { - // version compare thing. - $configVersion = (string) config('firefly.version'); - $dbVersion = (string) app('fireflyconfig')->getFresh('ff3_version', '1.0')->data; - if (str_starts_with($configVersion, 'develop')) { - Log::debug('Skipping version check for develop version.'); - - return false; - } - if (1 === version_compare($configVersion, $dbVersion)) { - Log::warning( - sprintf( - 'The current configured Firefly III version (%s) is older than the required version (%s). Redirect to migrate routine.', - $dbVersion, - $configVersion - ) - ); - - return true; - } - - // Log::info(sprintf('Installed Firefly III version (%s) equals expected Firefly III version (%s)', $dbVersion, $configVersion)); - - return false; - } } diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php index 9516071ddb..b2c806a966 100644 --- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php +++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php @@ -26,6 +26,7 @@ namespace FireflyIII\Services\FireflyIIIOrg\Update; use Carbon\Carbon; use FireflyIII\Events\NewVersionAvailable; +use FireflyIII\Support\System\IsOldVersion; use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; use Illuminate\Support\Facades\Log; @@ -38,6 +39,7 @@ use function Safe\json_decode; */ class UpdateRequest implements UpdateRequestInterface { + use IsOldVersion; public function getUpdateInformation(string $channel): array { Log::debug(sprintf('Now in getUpdateInformation(%s)', $channel)); @@ -183,20 +185,15 @@ class UpdateRequest implements UpdateRequestInterface private function parseResultDevelop(string $current, string $latest, array $information): array { Log::debug(sprintf('User is running develop version "%s"', $current)); - $parts = explode('/', $current); + $compare = $this->compareDevelopVersions($current, $latest); $return = []; - /** @var Carbon $devDate */ - $devDate = Carbon::createFromFormat('Y-m-d', $parts[1]); - - if ($devDate->lte($information['date'])) { - Log::debug(sprintf('This development release is older, release = %s, latest version %s = %s', $devDate->format('Y-m-d'), $latest, $information['date']->format('Y-m-d'))); + if (-1 === $compare) { $return['level'] = 'info'; $return['message'] = (string) trans('firefly.update_current_dev_older', ['version' => $current, 'new_version' => $latest]); return $return; } - Log::debug(sprintf('This development release is newer, release = %s, latest version %s = %s', $devDate->format('Y-m-d'), $latest, $information['date']->format('Y-m-d'))); $return['level'] = 'info'; $return['message'] = (string) trans('firefly.update_current_dev_newer', ['version' => $current, 'new_version' => $latest]); diff --git a/app/Support/System/IsOldVersion.php b/app/Support/System/IsOldVersion.php new file mode 100644 index 0000000000..175a8ed7fa --- /dev/null +++ b/app/Support/System/IsOldVersion.php @@ -0,0 +1,94 @@ +. + */ + +namespace FireflyIII\Support\System; + +use Carbon\Carbon; +use FireflyIII\Support\Facades\FireflyConfig; +use Illuminate\Support\Facades\Log; + +trait IsOldVersion +{ + + /** + * By default, version_compare() returns -1 if the first version is lower than the second, 0 if they are equal, and + * 1 if the second is lower. + */ + protected function compareDevelopVersions(string $current, string $latest): int + { + $currentParts = explode('/', $current); + $latestParts = explode('/', $latest); + if (2 !== count($currentParts) || 2 !== count($latestParts)) { + Log::error(sprintf('Version "%s" or "%s" is not a valid develop-version.', $current, $latest)); + return 0; + } + + $currentDate = Carbon::createFromFormat('!Y-m-d', $currentParts[1]); + $latestDate = Carbon::createFromFormat('!Y-m-d', $latestParts[1]); + + if ($currentDate->lt($latestDate)) { + Log::debug(sprintf('This current version is older, current = %s, latest version %s.', $current, $latest)); + return -1; + } + if ($currentDate->gt($latestDate)) { + Log::debug(sprintf('This current version is newer, current = %s, latest version %s.', $current, $latest)); + return 1; + } + Log::debug(sprintf('This current version is of the same age, current = %s, latest version %s.', $current, $latest)); + + return 0; + } + + /** + * Check if the "firefly_version" variable is correct. + */ + protected function isOldVersionInstalled(): bool + { + // version compare thing. + $configVersion = (string)config('firefly.version'); + $dbVersion = (string)FireflyConfig::getFresh('ff3_version', '1.0')->data; + $compare = 0; + // compare develop to develop + if (str_starts_with($configVersion, 'develop') && str_starts_with($dbVersion, 'develop')) { + $compare = $this->compareDevelopVersions($configVersion, $dbVersion); + } + // user has develop installed, goes to normal version. + if (!str_starts_with($configVersion, 'develop') && str_starts_with($dbVersion, 'develop')) { + return true; + } + + // user has normal, goes to develop version. + if (str_starts_with($configVersion, 'develop') && !str_starts_with($dbVersion, 'develop')) { + return true; + } + + // compare normal with normal. + if (!str_starts_with($configVersion, 'develop') && !str_starts_with($dbVersion, 'develop')) { + $compare = version_compare($configVersion, $dbVersion); + } + if (-1 === $compare) { + Log::warning(sprintf('The current configured Firefly III version (%s) is older than the required version (%s). Redirect to migrate routine.', $dbVersion, $configVersion)); + + return true; + } + return false; + } +} diff --git a/config/firefly.php b/config/firefly.php index d3ff9f679b..7b1af7a67a 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -81,7 +81,7 @@ return [ 'version' => 'develop/2025-09-29', 'build_time' => 1759116036, 'api_version' => '2.1.0', // field is no longer used. - 'db_version' => 27, + 'db_version' => 28, // generic settings 'maxUploadSize' => 1073741824, // 1 GB From 62b9f2785f3ad8994765f875c5bc40a0a456be6a Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 2 Oct 2025 06:55:09 +0200 Subject: [PATCH 03/26] Ignore db version in scripts. --- app/Console/Commands/System/SetsLatestVersion.php | 4 ++-- app/Console/Commands/Upgrade/UpgradesDatabase.php | 5 ++--- app/Http/Controllers/DebugController.php | 1 - app/Http/Controllers/System/InstallController.php | 6 ++---- config/firefly.php | 2 +- resources/views/partials/debug-table.twig | 3 +-- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/app/Console/Commands/System/SetsLatestVersion.php b/app/Console/Commands/System/SetsLatestVersion.php index f6207ee15a..3c6f6b5244 100644 --- a/app/Console/Commands/System/SetsLatestVersion.php +++ b/app/Console/Commands/System/SetsLatestVersion.php @@ -25,6 +25,7 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\System; use FireflyIII\Console\Commands\ShowsFriendlyMessages; +use FireflyIII\Support\Facades\FireflyConfig; use Illuminate\Console\Command; class SetsLatestVersion extends Command @@ -45,8 +46,7 @@ class SetsLatestVersion extends Command return 0; } - app('fireflyconfig')->set('db_version', config('firefly.db_version')); - app('fireflyconfig')->set('ff3_version', config('firefly.version')); + FireflyConfig::set('ff3_version', config('firefly.version')); $this->friendlyInfo('Updated version.'); return 0; diff --git a/app/Console/Commands/Upgrade/UpgradesDatabase.php b/app/Console/Commands/Upgrade/UpgradesDatabase.php index 92429a9a36..c2f6912b5a 100644 --- a/app/Console/Commands/Upgrade/UpgradesDatabase.php +++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; +use FireflyIII\Support\Facades\FireflyConfig; use Illuminate\Support\Facades\Log; use Safe\Exceptions\InfoException; @@ -86,10 +87,8 @@ class UpgradesDatabase extends Command $this->friendlyLine(sprintf('Now executing %s', $command)); $this->call($command, $args); } - // set new DB version. - app('fireflyconfig')->set('db_version', (int) config('firefly.db_version')); // index will set FF3 version. - app('fireflyconfig')->set('ff3_version', (string) config('firefly.version')); + FireflyConfig::set('ff3_version', (string) config('firefly.version')); return 0; } diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index 377bacd735..9138daf037 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -184,7 +184,6 @@ class DebugController extends Controller $currentDriver = DB::getDriverName(); return [ - 'db_version' => app('fireflyconfig')->get('db_version', 1)->data, 'php_version' => PHP_VERSION, 'php_os' => PHP_OS, 'uname' => php_uname('m'), diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index e2acfb680f..cd800053d4 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\System; +use FireflyIII\Support\Facades\FireflyConfig; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Cache; use Exception; @@ -81,10 +82,7 @@ class InstallController extends Controller { app('view')->share('FF_VERSION', config('firefly.version')); // index will set FF3 version. - app('fireflyconfig')->set('ff3_version', (string) config('firefly.version')); - - // set new DB version. - app('fireflyconfig')->set('db_version', (int) config('firefly.db_version')); + FireflyConfig::set('ff3_version', (string) config('firefly.version')); return view('install.index'); } diff --git a/config/firefly.php b/config/firefly.php index 7b1af7a67a..e4e4f573c1 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -81,7 +81,7 @@ return [ 'version' => 'develop/2025-09-29', 'build_time' => 1759116036, 'api_version' => '2.1.0', // field is no longer used. - 'db_version' => 28, + 'db_version' => 28, // field is no longer used. // generic settings 'maxUploadSize' => 1073741824, // 1 GB diff --git a/resources/views/partials/debug-table.twig b/resources/views/partials/debug-table.twig index 6dd268a04e..2e498a162a 100644 --- a/resources/views/partials/debug-table.twig +++ b/resources/views/partials/debug-table.twig @@ -12,8 +12,7 @@ {# Firefly III version #} Firefly III - {% if FF_IS_DEVELOP %}{% endif %}{% if not FF_IS_DEVELOP %}v{% endif %}{{ FF_VERSION }} / #{{ system.db_version }} (expects #{{ config('firefly.db_version') }}) - + {% if FF_IS_DEVELOP %}{% endif %}{% if not FF_IS_DEVELOP %}v{% endif %}{{ FF_VERSION }} {# PHP version + settings #} From c5cf52941388b60e565279e72138b6dc7bf15c4a Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 2 Oct 2025 06:59:56 +0200 Subject: [PATCH 04/26] Update changelog. --- changelog.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index aecba981e0..f4123d6829 100644 --- a/changelog.md +++ b/changelog.md @@ -5,16 +5,31 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## 6.4.1 - 2025-09-15 +### Added + +- #10979 + ### Fixed - Fixed a missing filter from [issue 10803](https://github.com/firefly-iii/firefly-iii/issues/10803). +- #10833 +- #10854 - #10891 +- #10916 - #10920 - #10921 -- #10833 +- #10924 +- #10938 +- #10940 +- #10954 +- #10956 +- #10960 +- #10974 +- #10990 ### API +- #10803 - #10908 From d1bae875f798da8837a635691160492b75ccdf23 Mon Sep 17 00:00:00 2001 From: JC5 Date: Thu, 2 Oct 2025 07:04:45 +0200 Subject: [PATCH 05/26] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-10-02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Commands/System/OutputsInstructions.php | 22 +-- app/Factory/PiggyBankFactory.php | 1 + app/Http/Middleware/Installer.php | 2 +- .../FireflyIIIOrg/Update/UpdateRequest.php | 3 +- .../Http/Controllers/PeriodOverview.php | 28 ++-- app/Support/System/IsOldVersion.php | 11 +- composer.lock | 92 ++-------- config/firefly.php | 4 +- package-lock.json | 158 ++++++------------ 9 files changed, 101 insertions(+), 220 deletions(-) diff --git a/app/Console/Commands/System/OutputsInstructions.php b/app/Console/Commands/System/OutputsInstructions.php index 1e8c0b6d80..877576e4a4 100644 --- a/app/Console/Commands/System/OutputsInstructions.php +++ b/app/Console/Commands/System/OutputsInstructions.php @@ -37,7 +37,7 @@ class OutputsInstructions extends Command protected $description = 'Instructions in case of upgrade trouble.'; - protected $signature = 'firefly-iii:instructions {task=install}'; + protected $signature = 'firefly-iii:instructions {task=install}'; /** * Execute the console command. @@ -63,8 +63,8 @@ class OutputsInstructions extends Command $version = (string)config('firefly.version'); /** @var array $config */ - $config = config('upgrade.text.upgrade'); - $text = ''; + $config = config('upgrade.text.upgrade'); + $text = ''; /** @var string $compare */ foreach (array_keys($config) as $compare) { @@ -79,7 +79,7 @@ class OutputsInstructions extends Command $text = 'Please set APP_ENV=production for a safer environment.'; } - $prefix = 'v'; + $prefix = 'v'; if (str_starts_with($version, 'develop') || str_starts_with($version, 'branch')) { $prefix = ''; } @@ -116,8 +116,8 @@ class OutputsInstructions extends Command */ private function showLogo(): void { - $today = Carbon::now()->format('m-d'); - $month = Carbon::now()->format('m'); + $today = Carbon::now()->format('m-d'); + $month = Carbon::now()->format('m'); // variation in colors and effects just because I can! // default is Ukraine flag: $colors = ['blue', 'blue', 'blue', 'yellow', 'yellow', 'yellow', 'default', 'default']; @@ -166,7 +166,7 @@ class OutputsInstructions extends Command { $parts = explode("\n", wordwrap($text)); foreach ($parts as $string) { - $this->line('| ' . sprintf('%-77s', $string) . '|'); + $this->line('| '.sprintf('%-77s', $string).'|'); } } @@ -177,7 +177,7 @@ class OutputsInstructions extends Command { $parts = explode("\n", wordwrap($text)); foreach ($parts as $string) { - $this->info('| ' . sprintf('%-77s', $string) . '|'); + $this->info('| '.sprintf('%-77s', $string).'|'); } } @@ -196,8 +196,8 @@ class OutputsInstructions extends Command $version = (string)config('firefly.version'); /** @var array $config */ - $config = config('upgrade.text.install'); - $text = ''; + $config = config('upgrade.text.install'); + $text = ''; /** @var string $compare */ foreach (array_keys($config) as $compare) { @@ -212,7 +212,7 @@ class OutputsInstructions extends Command $text = 'Please set APP_ENV=production for a safer environment.'; } - $prefix = 'v'; + $prefix = 'v'; if (str_starts_with($version, 'develop')) { $prefix = ''; } diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.php index bc6b9f9f8a..b31056b10f 100644 --- a/app/Factory/PiggyBankFactory.php +++ b/app/Factory/PiggyBankFactory.php @@ -243,6 +243,7 @@ class PiggyBankFactory } } Log::debug('Looping all accounts.'); + /** @var array $info */ foreach ($accounts as $info) { $account = $this->accountRepository->find((int)($info['account_id'] ?? 0)); diff --git a/app/Http/Middleware/Installer.php b/app/Http/Middleware/Installer.php index 79f9494929..852c523c4c 100644 --- a/app/Http/Middleware/Installer.php +++ b/app/Http/Middleware/Installer.php @@ -26,7 +26,6 @@ namespace FireflyIII\Http\Middleware; use Closure; use FireflyIII\Exceptions\FireflyException; -use FireflyIII\Support\FireflyConfig; use FireflyIII\Support\System\IsOldVersion; use FireflyIII\Support\System\OAuthKeys; use Illuminate\Database\QueryException; @@ -40,6 +39,7 @@ use Illuminate\Support\Facades\Log; class Installer { use IsOldVersion; + /** * Handle an incoming request. * diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php index b2c806a966..ad55aee903 100644 --- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php +++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php @@ -40,6 +40,7 @@ use function Safe\json_decode; class UpdateRequest implements UpdateRequestInterface { use IsOldVersion; + public function getUpdateInformation(string $channel): array { Log::debug(sprintf('Now in getUpdateInformation(%s)', $channel)); @@ -185,7 +186,7 @@ class UpdateRequest implements UpdateRequestInterface private function parseResultDevelop(string $current, string $latest, array $information): array { Log::debug(sprintf('User is running develop version "%s"', $current)); - $compare = $this->compareDevelopVersions($current, $latest); + $compare = $this->compareDevelopVersions($current, $latest); $return = []; if (-1 === $compare) { diff --git a/app/Support/Http/Controllers/PeriodOverview.php b/app/Support/Http/Controllers/PeriodOverview.php index 5209eab2fe..ddbe866e84 100644 --- a/app/Support/Http/Controllers/PeriodOverview.php +++ b/app/Support/Http/Controllers/PeriodOverview.php @@ -263,13 +263,13 @@ trait PeriodOverview $entry = [ - 'title' => $title, - 'route' => route(sprintf('%s.no-%s', Str::plural($model), $model), [$start->format('Y-m-d'), $end->format('Y-m-d')]), - 'total_transactions' => 0, - 'spent' => [], - 'earned' => [], - 'transferred' => [], - ]; + 'title' => $title, + 'route' => route(sprintf('%s.no-%s', Str::plural($model), $model), [$start->format('Y-m-d'), $end->format('Y-m-d')]), + 'total_transactions' => 0, + 'spent' => [], + 'earned' => [], + 'transferred' => [], + ]; $grouped = []; /** @var PeriodStatistic $statistic */ @@ -515,13 +515,13 @@ trait PeriodOverview } $entries[] = [ - 'title' => $title, - 'route' => route('transactions.index', [$transactionType, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), - 'total_transactions' => count($spent) + count($earned) + count($transferred), - 'spent' => $this->groupByCurrency($spent), - 'earned' => $this->groupByCurrency($earned), - 'transferred' => $this->groupByCurrency($transferred), - ]; + 'title' => $title, + 'route' => route('transactions.index', [$transactionType, $currentDate['start']->format('Y-m-d'), $currentDate['end']->format('Y-m-d')]), + 'total_transactions' => count($spent) + count($earned) + count($transferred), + 'spent' => $this->groupByCurrency($spent), + 'earned' => $this->groupByCurrency($earned), + 'transferred' => $this->groupByCurrency($transferred), + ]; ++$loops; } diff --git a/app/Support/System/IsOldVersion.php b/app/Support/System/IsOldVersion.php index 175a8ed7fa..2499debbe8 100644 --- a/app/Support/System/IsOldVersion.php +++ b/app/Support/System/IsOldVersion.php @@ -1,4 +1,6 @@ lt($latestDate)) { Log::debug(sprintf('This current version is older, current = %s, latest version %s.', $current, $latest)); + return -1; } if ($currentDate->gt($latestDate)) { Log::debug(sprintf('This current version is newer, current = %s, latest version %s.', $current, $latest)); + return 1; } Log::debug(sprintf('This current version is of the same age, current = %s, latest version %s.', $current, $latest)); @@ -89,6 +93,7 @@ trait IsOldVersion return true; } + return false; } } diff --git a/composer.lock b/composer.lock index f7341ff02a..bf27259208 100644 --- a/composer.lock +++ b/composer.lock @@ -1878,16 +1878,16 @@ }, { "name": "laravel/framework", - "version": "v12.31.1", + "version": "v12.32.5", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "281b711710c245dd8275d73132e92635be3094df" + "reference": "77b2740391cd2a825ba59d6fada45e9b8b9bcc5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/281b711710c245dd8275d73132e92635be3094df", - "reference": "281b711710c245dd8275d73132e92635be3094df", + "url": "https://api.github.com/repos/laravel/framework/zipball/77b2740391cd2a825ba59d6fada45e9b8b9bcc5a", + "reference": "77b2740391cd2a825ba59d6fada45e9b8b9bcc5a", "shasum": "" }, "require": { @@ -1915,7 +1915,6 @@ "monolog/monolog": "^3.0", "nesbot/carbon": "^3.8.4", "nunomaduro/termwind": "^2.0", - "phiki/phiki": "^2.0.0", "php": "^8.2", "psr/container": "^1.1.1|^2.0.1", "psr/log": "^1.0|^2.0|^3.0", @@ -2094,7 +2093,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2025-09-23T15:33:04+00:00" + "time": "2025-09-30T17:39:22+00:00" }, { "name": "laravel/passport", @@ -2812,16 +2811,16 @@ }, { "name": "league/csv", - "version": "9.25.0", + "version": "9.26.0", "source": { "type": "git", "url": "https://github.com/thephpleague/csv.git", - "reference": "f856f532866369fb1debe4e7c5a1db185f40ef86" + "reference": "7fce732754d043f3938899e5183e2d0f3d31b571" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/csv/zipball/f856f532866369fb1debe4e7c5a1db185f40ef86", - "reference": "f856f532866369fb1debe4e7c5a1db185f40ef86", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/7fce732754d043f3938899e5183e2d0f3d31b571", + "reference": "7fce732754d043f3938899e5183e2d0f3d31b571", "shasum": "" }, "require": { @@ -2899,7 +2898,7 @@ "type": "github" } ], - "time": "2025-09-11T08:29:08+00:00" + "time": "2025-10-01T11:24:54+00:00" }, { "name": "league/event", @@ -4352,77 +4351,6 @@ }, "time": "2020-10-15T08:29:30+00:00" }, - { - "name": "phiki/phiki", - "version": "v2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phikiphp/phiki.git", - "reference": "160785c50c01077780ab217e5808f00ab8f05a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phikiphp/phiki/zipball/160785c50c01077780ab217e5808f00ab8f05a13", - "reference": "160785c50c01077780ab217e5808f00ab8f05a13", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "league/commonmark": "^2.5.3", - "php": "^8.2", - "psr/simple-cache": "^3.0" - }, - "require-dev": { - "illuminate/support": "^11.45", - "laravel/pint": "^1.18.1", - "orchestra/testbench": "^9.15", - "pestphp/pest": "^3.5.1", - "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan": "^2.0", - "symfony/var-dumper": "^7.1.6" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Phiki\\Adapters\\Laravel\\PhikiServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Phiki\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ryan Chandler", - "email": "support@ryangjchandler.co.uk", - "homepage": "https://ryangjchandler.co.uk", - "role": "Developer" - } - ], - "description": "Syntax highlighting using TextMate grammars in PHP.", - "support": { - "issues": "https://github.com/phikiphp/phiki/issues", - "source": "https://github.com/phikiphp/phiki/tree/v2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sponsors/ryangjchandler", - "type": "github" - }, - { - "url": "https://buymeacoffee.com/ryangjchandler", - "type": "other" - } - ], - "time": "2025-09-20T17:21:02+00:00" - }, { "name": "php-http/client-common", "version": "2.7.2", diff --git a/config/firefly.php b/config/firefly.php index e4e4f573c1..24c618740a 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,8 +78,8 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-09-29', - 'build_time' => 1759116036, + 'version' => 'develop/2025-10-02', + 'build_time' => 1759381368, 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 28, // field is no longer used. diff --git a/package-lock.json b/package-lock.json index 91344ae85e..77e6898b78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2135,9 +2135,9 @@ } }, "node_modules/@fortawesome/fontawesome-free": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-7.0.1.tgz", - "integrity": "sha512-RLmb9U6H2rJDnGxEqXxzy7ANPrQz7WK2/eTjdZqyU9uRU5W+FkAec9uU5gTYzFBH7aoXIw2WTJSCJR4KPlReQw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-7.1.0.tgz", + "integrity": "sha512-+WxNld5ZCJHvPQCr/GnzCTVREyStrAJjisUPtUxG5ngDA8TMlPnKp6dddlTpai4+1GNmltAeuk1hJEkBohwZYA==", "license": "(CC-BY-4.0 AND OFL-1.1 AND MIT)", "engines": { "node": ">=6" @@ -3173,13 +3173,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "24.5.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz", - "integrity": "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ==", + "version": "24.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.6.2.tgz", + "integrity": "sha512-d2L25Y4j+W3ZlNAeMKcy7yDsK425ibcAOO2t7aPTz6gNMH0z2GThtwENCDc0d/Pw9wgyRqE5Px1wkV7naz8ang==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~7.12.0" + "undici-types": "~7.13.0" } }, "node_modules/@types/node-forge": { @@ -3898,16 +3898,6 @@ "dev": true, "license": "MIT" }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/autoprefixer": { "version": "10.4.21", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.21.tgz", @@ -4075,9 +4065,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.9.tgz", - "integrity": "sha512-hY/u2lxLrbecMEWSB0IpGzGyDyeoMFQhCvZd2jGFSE5I17Fh01sYUBPCJtkWERw7zrac9+cIghxm/ytJa2X8iA==", + "version": "2.8.10", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.10.tgz", + "integrity": "sha512-uLfgBi+7IBNay8ECBO2mVMGZAc1VgZWEChxm4lv+TobGdG82LnXMjuNGo/BSSZZL4UmkWhxEHP2f5ziLNwGWMA==", "dev": true, "license": "Apache-2.0", "bin": { @@ -4360,9 +4350,9 @@ } }, "node_modules/browserslist": { - "version": "4.26.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.26.2.tgz", - "integrity": "sha512-ECFzp6uFOSB+dcZ5BK/IBaGWssbSYBHvuMeMt3MMFyhI0Z8SqGgEkBLARgpRH3hutIgPVsALcMwbDrJqPxQ65A==", + "version": "4.26.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.26.3.tgz", + "integrity": "sha512-lAUU+02RFBuCKQPj/P6NgjlbCnLBMp4UtgTx7vNHd3XSIJF87s9a5rA3aH2yw3GS9DqZAUbOtZdCCiZeVRqt0w==", "dev": true, "funding": [ { @@ -4380,9 +4370,9 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.8.3", - "caniuse-lite": "^1.0.30001741", - "electron-to-chromium": "^1.5.218", + "baseline-browser-mapping": "^2.8.9", + "caniuse-lite": "^1.0.30001746", + "electron-to-chromium": "^1.5.227", "node-releases": "^2.0.21", "update-browserslist-db": "^1.1.3" }, @@ -4521,9 +4511,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001745", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001745.tgz", - "integrity": "sha512-ywt6i8FzvdgrrrGbr1jZVObnVv6adj+0if2/omv9cmR2oiZs30zL4DIyaptKcbOrBdOIc74QTMoJvSE2QHh5UQ==", + "version": "1.0.30001746", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001746.tgz", + "integrity": "sha512-eA7Ys/DGw+pnkWWSE/id29f2IcPHVoE8wxtvE5JdvD2V28VTDPy1yEeo11Guz0sJ4ZeGRcm3uaTcAqK1LXaphA==", "dev": true, "funding": [ { @@ -5061,9 +5051,9 @@ } }, "node_modules/cross-env": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.0.0.tgz", - "integrity": "sha512-aU8qlEK/nHYtVuN4p7UQgAwVljzMg8hB4YK5ThRqD2l/ziSnryncPNn7bMLt5cFYsKVKBh8HqLqyCoTupEUu7Q==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz", + "integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==", "dev": true, "license": "MIT", "dependencies": { @@ -5736,9 +5726,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.227", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.227.tgz", - "integrity": "sha512-ITxuoPfJu3lsNWUi2lBM2PaBPYgH3uqmxut5vmBxgYvyI4AlJ6P3Cai1O76mOrkJCBzq0IxWg/NtqOrpu/0gKA==", + "version": "1.5.228", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.228.tgz", + "integrity": "sha512-nxkiyuqAn4MJ1QbobwqJILiDtu/jk14hEAWaMiJmNPh1Z+jqoFlBFZjdXwLWGeVSeu9hGLg6+2G9yJaW8rBIFA==", "dev": true, "license": "ISC" }, @@ -7088,9 +7078,9 @@ } }, "node_modules/i18next": { - "version": "25.5.2", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.5.2.tgz", - "integrity": "sha512-lW8Zeh37i/o0zVr+NoCHfNnfvVw+M6FQbRp36ZZ/NyHDJ3NJVpp2HhAUyU9WafL5AssymNoOjMRB48mmx2P6Hw==", + "version": "25.5.3", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.5.3.tgz", + "integrity": "sha512-joFqorDeQ6YpIXni944upwnuHBf5IoPMuqAchGVeQLdWC2JOjxgM9V8UGLhNIIH/Q8QleRxIi0BSRQehSrDLcg==", "funding": [ { "type": "individual", @@ -8653,16 +8643,6 @@ "dev": true, "license": "MIT" }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -8818,9 +8798,9 @@ } }, "node_modules/patch-package": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", - "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.1.tgz", + "integrity": "sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw==", "dev": true, "license": "MIT", "dependencies": { @@ -8829,15 +8809,14 @@ "ci-info": "^3.7.0", "cross-spawn": "^7.0.3", "find-yarn-workspace-root": "^2.0.0", - "fs-extra": "^9.0.0", + "fs-extra": "^10.0.0", "json-stable-stringify": "^1.0.2", "klaw-sync": "^6.0.0", "minimist": "^1.2.6", "open": "^7.4.2", - "rimraf": "^2.6.3", "semver": "^7.5.3", "slash": "^2.0.0", - "tmp": "^0.0.33", + "tmp": "^0.2.4", "yaml": "^2.2.2" }, "bin": { @@ -8848,22 +8827,6 @@ "npm": ">5" } }, - "node_modules/patch-package/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/patch-package/node_modules/slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", @@ -10086,9 +10049,9 @@ } }, "node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "license": "ISC", @@ -10097,6 +10060,9 @@ }, "bin": { "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/ripemd160": { @@ -11214,16 +11180,13 @@ } }, "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", + "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", "dev": true, "license": "MIT", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, "engines": { - "node": ">=0.6.0" + "node": ">=14.14" } }, "node_modules/to-arraybuffer": { @@ -11343,9 +11306,9 @@ } }, "node_modules/undici-types": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz", - "integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.13.0.tgz", + "integrity": "sha512-Ov2Rr9Sx+fRgagJ5AX0qvItZG/JKKoBRAVITs1zk7IqZGTJUwgUr7qoYBpWwakpWilTZFM98rG/AFRocu10iIQ==", "dev": true, "license": "MIT" }, @@ -11863,9 +11826,9 @@ "license": "BSD-2-Clause" }, "node_modules/webpack": { - "version": "5.101.3", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.101.3.tgz", - "integrity": "sha512-7b0dTKR3Ed//AD/6kkx/o7duS8H3f1a4w3BYpIriX4BzIhjkn4teo05cptsxvLesHFKK5KObnadmCHBwGc+51A==", + "version": "5.102.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.102.0.tgz", + "integrity": "sha512-hUtqAR3ZLVEYDEABdBioQCIqSoguHbFn1K7WlPPWSuXmx0031BD73PSE35jKyftdSh4YLDoQNgK4pqBt5Q82MA==", "dev": true, "license": "MIT", "dependencies": { @@ -11877,7 +11840,7 @@ "@webassemblyjs/wasm-parser": "^1.14.1", "acorn": "^8.15.0", "acorn-import-phases": "^1.0.3", - "browserslist": "^4.24.0", + "browserslist": "^4.24.5", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.17.3", "es-module-lexer": "^1.2.1", @@ -11890,9 +11853,9 @@ "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^4.3.2", - "tapable": "^2.1.1", + "tapable": "^2.2.3", "terser-webpack-plugin": "^5.3.11", - "watchpack": "^2.4.1", + "watchpack": "^2.4.4", "webpack-sources": "^3.3.3" }, "bin": { @@ -12155,23 +12118,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/webpack-dev-server/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/webpack-dev-server/node_modules/schema-utils": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", From a6ba75d5288ddd6cba69c90aa036c2ec722338da Mon Sep 17 00:00:00 2001 From: JC5 Date: Thu, 2 Oct 2025 07:39:29 +0200 Subject: [PATCH 06/26] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-10-02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 34 +++++++++++++++++----------------- config/firefly.php | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/changelog.md b/changelog.md index f4123d6829..a165d12d9b 100644 --- a/changelog.md +++ b/changelog.md @@ -7,30 +7,30 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added -- #10979 +- [PR 10979](https://github.com/firefly-iii/firefly-iii/pull/10979) (Add Kazakhstani Tenge (KZT) currency) reported by @maksimkurb ### Fixed - Fixed a missing filter from [issue 10803](https://github.com/firefly-iii/firefly-iii/issues/10803). -- #10833 -- #10854 -- #10891 -- #10916 -- #10920 -- #10921 -- #10924 -- #10938 -- #10940 -- #10954 -- #10956 -- #10960 -- #10974 -- #10990 +- [Issue 10833](https://github.com/firefly-iii/firefly-iii/issues/10833) (Can't open transaction after assigning a tag to it) reported by @zynexiz +- [Issue 10854](https://github.com/firefly-iii/firefly-iii/issues/10854) (string / null in budget causes budget page to not render) reported by @4e868df3 +- [Discussion 10891](https://github.com/orgs/firefly-iii/discussions/10891) (User group id is null when downloading new exchange rates) started by @dakennguyen +- [Discussion 10916](https://github.com/orgs/firefly-iii/discussions/10916) (Errors/Warnings in Logs after Batch API Import) started by @Mr-Kanister +- [Issue 10920](https://github.com/firefly-iii/firefly-iii/issues/10920) (Liability transaction with same source and destination possible) reported by @Mr-Kanister +- [Issue 10921](https://github.com/firefly-iii/firefly-iii/issues/10921) (Transaction type between asset and liability not correctly enforced using API) reported by @Mr-Kanister +- [Issue 10924](https://github.com/firefly-iii/firefly-iii/issues/10924) (Recurring transactions don't save (or show) selected subscription) reported by @SteffoSpieler +- [Discussion 10938](https://github.com/orgs/firefly-iii/discussions/10938) (Unable to apply default rule group to certain transactions) started by @praemon +- [Issue 10940](https://github.com/firefly-iii/firefly-iii/issues/10940) (Internal Server Error when trying to open piggy banks) reported by @mattephi +- [Issue 10954](https://github.com/firefly-iii/firefly-iii/issues/10954) (Internal Server Error when trying to access (default) account) reported by @thomaschristory +- [Issue 10956](https://github.com/firefly-iii/firefly-iii/issues/10956) (Manual webhook trigger fail) reported by @dudu7731 +- [Issue 10960](https://github.com/firefly-iii/firefly-iii/issues/10960) (404 after deleting subscription) reported by @lindely +- [Discussion 10974](https://github.com/orgs/firefly-iii/discussions/10974) (Big webhook_messages table) started by @Billos +- [Issue 10990](https://github.com/firefly-iii/firefly-iii/issues/10990) (duplicate piggy event via API) reported by @4e868df3 ### API -- #10803 -- #10908 +- [Issue 10803](https://github.com/firefly-iii/firefly-iii/issues/10803) (Issue in /v1/budget-limits spent attribute) reported by @Billos +- [Discussion 10908](https://github.com/orgs/firefly-iii/discussions/10908) (New fields for BudgetLimit object) started by @Billos ## 6.4.0 - 2025-09-14 diff --git a/config/firefly.php b/config/firefly.php index 24c618740a..01c88d918a 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -79,7 +79,7 @@ return [ // see cer.php for exchange rates feature flag. ], 'version' => 'develop/2025-10-02', - 'build_time' => 1759381368, + 'build_time' => 1759383469, 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 28, // field is no longer used. From 3f81aa74036d6ab28692f4f0bd5ffd06847584ba Mon Sep 17 00:00:00 2001 From: Sander Dorigo Date: Thu, 2 Oct 2025 10:15:18 +0200 Subject: [PATCH 07/26] Fix #10988 --- app/Api/V1/Requests/Data/DateRequest.php | 10 ++++++++++ changelog.md | 1 + 2 files changed, 11 insertions(+) diff --git a/app/Api/V1/Requests/Data/DateRequest.php b/app/Api/V1/Requests/Data/DateRequest.php index 7ba1861086..05125a8868 100644 --- a/app/Api/V1/Requests/Data/DateRequest.php +++ b/app/Api/V1/Requests/Data/DateRequest.php @@ -46,6 +46,16 @@ class DateRequest extends FormRequest { $start = $this->getCarbonDate('start'); $end = $this->getCarbonDate('end'); + if(null === $start) { + $start = now()->startOfMonth(); + } + if(null === $end) { + $end = now()->endOfMonth(); + } + // sanity check on dates: + [$start, $end] = $end < $start ? [$end, $start] : [$start, $end]; + + $start->startOfDay(); $end->endOfDay(); if ($start->diffInYears($end, true) > 5) { diff --git a/changelog.md b/changelog.md index a165d12d9b..1c9594c475 100644 --- a/changelog.md +++ b/changelog.md @@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - [Issue 10956](https://github.com/firefly-iii/firefly-iii/issues/10956) (Manual webhook trigger fail) reported by @dudu7731 - [Issue 10960](https://github.com/firefly-iii/firefly-iii/issues/10960) (404 after deleting subscription) reported by @lindely - [Discussion 10974](https://github.com/orgs/firefly-iii/discussions/10974) (Big webhook_messages table) started by @Billos +- #10988 - [Issue 10990](https://github.com/firefly-iii/firefly-iii/issues/10990) (duplicate piggy event via API) reported by @4e868df3 ### API From 5088e20f258217bac1b6685c71139611271f3c9d Mon Sep 17 00:00:00 2001 From: Nicky De Maeyer Date: Thu, 2 Oct 2025 10:25:11 +0200 Subject: [PATCH 08/26] use correct translation key for category report income table --- resources/views/reports/category/partials/avg-income.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/reports/category/partials/avg-income.twig b/resources/views/reports/category/partials/avg-income.twig index b859f13a09..f473a8011b 100644 --- a/resources/views/reports/category/partials/avg-income.twig +++ b/resources/views/reports/category/partials/avg-income.twig @@ -2,7 +2,7 @@ {{ 'account'|_ }} - {{ 'spent_average'|_ }} + {{ 'income_average'|_ }} {{ 'total'|_ }} {{ 'transaction_count'|_ }} From a70fab1e878e10fcad24a8065081aaf042429161 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 2 Oct 2025 19:49:32 +0200 Subject: [PATCH 09/26] Clean up piggy alerts. --- app/Support/Http/Controllers/PeriodOverview.php | 8 ++------ app/TransactionRules/Actions/UpdatePiggyBank.php | 12 ++++++++++-- resources/lang/en_US/rules.php | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/Support/Http/Controllers/PeriodOverview.php b/app/Support/Http/Controllers/PeriodOverview.php index ddbe866e84..b639eff171 100644 --- a/app/Support/Http/Controllers/PeriodOverview.php +++ b/app/Support/Http/Controllers/PeriodOverview.php @@ -331,9 +331,7 @@ trait PeriodOverview } return $this->statistics->filter( - function (PeriodStatistic $statistic) use ($start, $end, $type) { - return $statistic->start->eq($start) && $statistic->end->eq($end) && $statistic->type === $type; - } + fn(PeriodStatistic $statistic) => $statistic->start->eq($start) && $statistic->end->eq($end) && $statistic->type === $type ); } @@ -346,9 +344,7 @@ trait PeriodOverview } return $this->statistics->filter( - function (PeriodStatistic $statistic) use ($start, $end, $prefix) { - return $statistic->start->eq($start) && $statistic->end->eq($end) && str_starts_with($statistic->type, $prefix); - } + fn(PeriodStatistic $statistic) => $statistic->start->eq($start) && $statistic->end->eq($end) && str_starts_with($statistic->type, $prefix) ); } diff --git a/app/TransactionRules/Actions/UpdatePiggyBank.php b/app/TransactionRules/Actions/UpdatePiggyBank.php index 64fe735e6a..e5bb2a9411 100644 --- a/app/TransactionRules/Actions/UpdatePiggyBank.php +++ b/app/TransactionRules/Actions/UpdatePiggyBank.php @@ -31,7 +31,9 @@ use FireflyIII\Models\PiggyBank; use FireflyIII\Models\RuleAction; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; +use FireflyIII\Support\Facades\Amount; use FireflyIII\User; use Illuminate\Support\Facades\Log; @@ -176,7 +178,9 @@ class UpdatePiggyBank implements ActionInterface private function removeAmount(PiggyBank $piggyBank, array $array, TransactionJournal $journal, Account $account, string $amount): void { $repository = app(PiggyBankRepositoryInterface::class); + $accountRepository = app(AccountRepositoryInterface::class); $repository->setUser($journal->user); + $accountRepository->setUser($account->user); // how much can we remove from this piggy bank? $toRemove = $repository->getCurrentAmount($piggyBank, $account); @@ -196,7 +200,8 @@ class UpdatePiggyBank implements ActionInterface if (false === $repository->canRemoveAmount($piggyBank, $account, $amount)) { Log::warning(sprintf('Cannot remove %s from piggy bank.', $amount)); - event(new RuleActionFailedOnArray($this->action, $array, trans('rules.cannot_remove_from_piggy', ['amount' => $amount, 'name' => $piggyBank->name]))); + $currency = $accountRepository->getAccountCurrency($account) ?? Amount::getPrimaryCurrency(); + event(new RuleActionFailedOnArray($this->action, $array, trans('rules.cannot_remove_from_piggy', ['amount' => Amount::formatAnything($amount, $currency, false), 'name' => $piggyBank->name]))); return; } @@ -208,7 +213,9 @@ class UpdatePiggyBank implements ActionInterface private function addAmount(PiggyBank $piggyBank, array $array, TransactionJournal $journal, Account $account, string $amount): void { $repository = app(PiggyBankRepositoryInterface::class); + $accountRepository = app(AccountRepositoryInterface::class); $repository->setUser($journal->user); + $accountRepository->setUser($account->user); // how much can we add to the piggy bank? if (0 !== bccomp($piggyBank->target_amount, '0')) { @@ -233,7 +240,8 @@ class UpdatePiggyBank implements ActionInterface if (false === $repository->canAddAmount($piggyBank, $account, $amount)) { Log::warning(sprintf('Cannot add %s to piggy bank.', $amount)); - event(new RuleActionFailedOnArray($this->action, $array, trans('rules.cannot_add_to_piggy', ['amount' => $amount, 'name' => $piggyBank->name]))); + $currency = $accountRepository->getAccountCurrency($account) ?? Amount::getPrimaryCurrency(); + event(new RuleActionFailedOnArray($this->action, $array, trans('rules.cannot_add_to_piggy', ['amount' => Amount::formatAnything($amount, $currency, false), 'name' => $piggyBank->name]))); return; } diff --git a/resources/lang/en_US/rules.php b/resources/lang/en_US/rules.php index ce60269015..405b13cb01 100644 --- a/resources/lang/en_US/rules.php +++ b/resources/lang/en_US/rules.php @@ -75,7 +75,7 @@ return [ 'cannot_set_budget' => 'Firefly III can\'t set budget ":name" to a transaction of type ":type"', 'journal_invalid_amount' => 'Firefly III can\'t set amount ":amount" because it is not a valid number.', 'cannot_remove_zero_piggy' => 'Cannot remove zero amount from piggy bank ":name"', - 'cannot_remove_from_piggy' => 'Cannot remove ":amount" from piggy bank ":name"', + 'cannot_remove_from_piggy' => 'Cannot remove :amount from piggy bank ":name"', 'cannot_add_zero_piggy' => 'Cannot add zero amount to piggy bank ":name"', - 'cannot_add_to_piggy' => 'Cannot add ":amount" to piggy bank ":name"', + 'cannot_add_to_piggy' => 'Cannot add :amount to piggy bank ":name"', ]; From 354bbebbee3c0d8eb19633f708b5fcf112907370 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 2 Oct 2025 19:52:51 +0200 Subject: [PATCH 10/26] Fix #10965 --- resources/views/list/groups.twig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/views/list/groups.twig b/resources/views/list/groups.twig index a53f271fd8..fe4ab310d5 100644 --- a/resources/views/list/groups.twig +++ b/resources/views/list/groups.twig @@ -270,7 +270,12 @@ {% if (null == transaction.balance_dirty or false == transaction.balance_dirty) and null != transaction.destination_balance_after and null != transaction.source_balance_after %} {% if transaction.transaction_type_type == 'Deposit' %} - {{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% if transaction.source_account_id == account.id %} + {{ formatAmountBySymbol(transaction.source_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% else %} + {{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }} + {% endif %} + {% elseif transaction.transaction_type_type == 'Withdrawal' %} {% if 'Loan' == transaction.destination_account_type or 'Mortgage' == transaction.destination_account_type or 'Debt' == transaction.destination_account_type %} {% if currency.id == transaction.currency_id %} From e55af7186c261ac660bdf0b4d1a4bed19b5ea4e8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Oct 2025 05:24:24 +0200 Subject: [PATCH 11/26] Fix #10994 --- .../JsonApi/Enrichments/PiggyBankEnrichment.php | 15 +++++++++++---- changelog.md | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php index 7c6a8a8a5b..fbc11552be 100644 --- a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php +++ b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php @@ -57,10 +57,12 @@ class PiggyBankEnrichment implements EnrichmentInterface private readonly TransactionCurrency $primaryCurrency; private User $user; private UserGroup $userGroup; + private ?Carbon $date; public function __construct() { $this->primaryCurrency = Amount::getPrimaryCurrency(); + $this->date = now(config('app.timezone')); } public function enrich(Collection $collection): Collection @@ -69,7 +71,6 @@ class PiggyBankEnrichment implements EnrichmentInterface $this->collectIds(); $this->collectObjectGroups(); $this->collectNotes(); - $this->collectCurrentAmounts(); $this->appendCollectedData(); @@ -157,8 +158,8 @@ class PiggyBankEnrichment implements EnrichmentInterface } // get suggested per month. - $meta['save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($item->start_date, $item->target_date, $meta['target_amount'], $meta['current_amount']), $currency->decimal_places); - $meta['pc_save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($item->start_date, $item->target_date, $meta['pc_target_amount'], $meta['pc_current_amount']), $currency->decimal_places); + $meta['save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['target_amount'], $meta['current_amount']), $currency->decimal_places); + $meta['pc_save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['pc_target_amount'], $meta['pc_current_amount']), $currency->decimal_places); $item->meta = $meta; @@ -166,7 +167,13 @@ class PiggyBankEnrichment implements EnrichmentInterface }); } - private function collectCurrentAmounts(): void {} + public function setDate(?Carbon $date): void + { + $this->date = $date; + } + + + private function collectIds(): void { diff --git a/changelog.md b/changelog.md index 1c9594c475..b0421f2815 100644 --- a/changelog.md +++ b/changelog.md @@ -24,9 +24,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). - [Issue 10954](https://github.com/firefly-iii/firefly-iii/issues/10954) (Internal Server Error when trying to access (default) account) reported by @thomaschristory - [Issue 10956](https://github.com/firefly-iii/firefly-iii/issues/10956) (Manual webhook trigger fail) reported by @dudu7731 - [Issue 10960](https://github.com/firefly-iii/firefly-iii/issues/10960) (404 after deleting subscription) reported by @lindely +- #10965 - [Discussion 10974](https://github.com/orgs/firefly-iii/discussions/10974) (Big webhook_messages table) started by @Billos - #10988 - [Issue 10990](https://github.com/firefly-iii/firefly-iii/issues/10990) (duplicate piggy event via API) reported by @4e868df3 +- #10994 ### API From ca364dc8778b6bf0337fd59c20129db4b1f537cb Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Oct 2025 05:53:50 +0200 Subject: [PATCH 12/26] Remove stats from empty objects. --- .../Events/StoredGroupEventHandler.php | 32 ++++++--- .../PeriodStatisticRepository.php | 70 ++++++++++--------- .../PeriodStatisticRepositoryInterface.php | 3 + .../Http/Controllers/PeriodOverview.php | 4 +- 4 files changed, 64 insertions(+), 45 deletions(-) diff --git a/app/Handlers/Events/StoredGroupEventHandler.php b/app/Handlers/Events/StoredGroupEventHandler.php index 50ce62f742..f01331a15c 100644 --- a/app/Handlers/Events/StoredGroupEventHandler.php +++ b/app/Handlers/Events/StoredGroupEventHandler.php @@ -62,14 +62,14 @@ class StoredGroupEventHandler } Log::debug('Now in StoredGroupEventHandler::processRules()'); - $journals = $storedGroupEvent->transactionGroup->transactionJournals; - $array = []; + $journals = $storedGroupEvent->transactionGroup->transactionJournals; + $array = []; /** @var TransactionJournal $journal */ foreach ($journals as $journal) { $array[] = $journal->id; } - $journalIds = implode(',', $array); + $journalIds = implode(',', $array); Log::debug(sprintf('Add local operator for journal(s): %s', $journalIds)); // collect rules: @@ -78,10 +78,10 @@ class StoredGroupEventHandler // add the groups to the rule engine. // it should run the rules in the group and cancel the group if necessary. - $groups = $ruleGroupRepository->getRuleGroupsWithRules('store-journal'); + $groups = $ruleGroupRepository->getRuleGroupsWithRules('store-journal'); // create and fire rule engine. - $newRuleEngine = app(RuleEngineInterface::class); + $newRuleEngine = app(RuleEngineInterface::class); $newRuleEngine->setUser($storedGroupEvent->transactionGroup->user); $newRuleEngine->addOperator(['type' => 'journal_id', 'value' => $journalIds]); $newRuleEngine->setRuleGroups($groups); @@ -90,7 +90,7 @@ class StoredGroupEventHandler private function recalculateCredit(StoredTransactionGroup $event): void { - $group = $event->transactionGroup; + $group = $event->transactionGroup; /** @var CreditRecalculateService $object */ $object = app(CreditRecalculateService::class); @@ -109,12 +109,24 @@ class StoredGroupEventHandler $dest = $journal->transactions()->where('amount', '>', '0')->first(); $repository->deleteStatisticsForModel($source->account, $journal->date); $repository->deleteStatisticsForModel($dest->account, $journal->date); - foreach ($journal->categories as $category) { + $categories = $journal->categories; + $tags = $journal->tags; + $budgets = $journal->budgets; + foreach ($categories as $category) { $repository->deleteStatisticsForModel($category, $journal->date); } - foreach ($journal->tags as $tag) { + foreach ($tags as $tag) { $repository->deleteStatisticsForModel($tag, $journal->date); } + foreach ($budgets as $budget) { + $repository->deleteStatisticsForModel($budget, $journal->date); + } + if (0 === $categories->count()) { + $repository->deleteStatisticsForPrefix($journal->userGroup, 'no_category', $journal->date); + } + if (0 === $budgets->count()) { + $repository->deleteStatisticsForPrefix($journal->userGroup, 'no_budget', $journal->date); + } } } @@ -124,14 +136,14 @@ class StoredGroupEventHandler private function triggerWebhooks(StoredTransactionGroup $storedGroupEvent): void { Log::debug(__METHOD__); - $group = $storedGroupEvent->transactionGroup; + $group = $storedGroupEvent->transactionGroup; if (false === $storedGroupEvent->fireWebhooks) { Log::info(sprintf('Will not fire webhooks for transaction group #%d', $group->id)); return; } - $user = $group->user; + $user = $group->user; /** @var MessageGeneratorInterface $engine */ $engine = app(MessageGeneratorInterface::class); diff --git a/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php b/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php index ad294b9fcb..8763009535 100644 --- a/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php +++ b/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php @@ -25,6 +25,7 @@ namespace FireflyIII\Repositories\PeriodStatistic; use Carbon\Carbon; use FireflyIII\Models\PeriodStatistic; +use FireflyIII\Models\UserGroup; use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface; use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use Illuminate\Database\Eloquent\Model; @@ -39,26 +40,24 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U public function findPeriodStatistics(Model $model, Carbon $start, Carbon $end, array $types): Collection { return $model->primaryPeriodStatistics() - ->where('start', $start) - ->where('end', $end) - ->whereIn('type', $types) - ->get() - ; + ->where('start', $start) + ->where('end', $end) + ->whereIn('type', $types) + ->get(); } public function findPeriodStatistic(Model $model, Carbon $start, Carbon $end, string $type): Collection { return $model->primaryPeriodStatistics() - ->where('start', $start) - ->where('end', $end) - ->where('type', $type) - ->get() - ; + ->where('start', $start) + ->where('end', $end) + ->where('type', $type) + ->get(); } public function saveStatistic(Model $model, int $currencyId, Carbon $start, Carbon $end, string $type, int $count, string $amount): PeriodStatistic { - $stat = new PeriodStatistic(); + $stat = new PeriodStatistic(); $stat->primaryStatable()->associate($model); $stat->transaction_currency_id = $currencyId; $stat->user_group_id = $this->getUserGroup()->id; @@ -72,16 +71,16 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U $stat->save(); Log::debug(sprintf( - 'Saved #%d [currency #%d, Model %s #%d, %s to %s, %d, %s] as new statistic.', - $stat->id, - $model::class, - $model->id, - $stat->transaction_currency_id, - $stat->start->toW3cString(), - $stat->end->toW3cString(), - $count, - $amount - )); + 'Saved #%d [currency #%d, Model %s #%d, %s to %s, %d, %s] as new statistic.', + $stat->id, + $model::class, + $model->id, + $stat->transaction_currency_id, + $stat->start->toW3cString(), + $stat->end->toW3cString(), + $count, + $amount + )); return $stat; } @@ -100,9 +99,8 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U public function allInRangeForPrefix(string $prefix, Carbon $start, Carbon $end): Collection { return $this->userGroup->periodStatistics() - ->where('type', 'LIKE', sprintf('%s%%', $prefix)) - ->where('start', '>=', $start)->where('end', '<=', $end)->get() - ; + ->where('type', 'LIKE', sprintf('%s%%', $prefix)) + ->where('start', '>=', $start)->where('end', '<=', $end)->get(); } #[Override] @@ -121,16 +119,22 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U $stat->save(); Log::debug(sprintf( - 'Saved #%d [currency #%d, type "%s", %s to %s, %d, %s] as new statistic.', - $stat->id, - $stat->transaction_currency_id, - $stat->type, - $stat->start->toW3cString(), - $stat->end->toW3cString(), - $count, - $amount - )); + 'Saved #%d [currency #%d, type "%s", %s to %s, %d, %s] as new statistic.', + $stat->id, + $stat->transaction_currency_id, + $stat->type, + $stat->start->toW3cString(), + $stat->end->toW3cString(), + $count, + $amount + )); return $stat; } + + #[\Override] + public function deleteStatisticsForPrefix(UserGroup $userGroup, string $prefix, Carbon $date): void + { + $userGroup->periodStatistics()->where('start', '<=', $date)->where('end', '>=', $date)->where('type', 'LIKE', sprintf('%s%%', $prefix))->delete(); + } } diff --git a/app/Repositories/PeriodStatistic/PeriodStatisticRepositoryInterface.php b/app/Repositories/PeriodStatistic/PeriodStatisticRepositoryInterface.php index 22f17d8f2d..c4a9574d29 100644 --- a/app/Repositories/PeriodStatistic/PeriodStatisticRepositoryInterface.php +++ b/app/Repositories/PeriodStatistic/PeriodStatisticRepositoryInterface.php @@ -25,6 +25,7 @@ namespace FireflyIII\Repositories\PeriodStatistic; use Carbon\Carbon; use FireflyIII\Models\PeriodStatistic; +use FireflyIII\Models\UserGroup; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; @@ -43,4 +44,6 @@ interface PeriodStatisticRepositoryInterface public function allInRangeForPrefix(string $prefix, Carbon $start, Carbon $end): Collection; public function deleteStatisticsForModel(Model $model, Carbon $date): void; + + public function deleteStatisticsForPrefix(UserGroup $userGroup, string $prefix, Carbon $date): void; } diff --git a/app/Support/Http/Controllers/PeriodOverview.php b/app/Support/Http/Controllers/PeriodOverview.php index b639eff171..1fc9dc3fd4 100644 --- a/app/Support/Http/Controllers/PeriodOverview.php +++ b/app/Support/Http/Controllers/PeriodOverview.php @@ -325,7 +325,7 @@ trait PeriodOverview private function filterStatistics(Carbon $start, Carbon $end, string $type): Collection { if (0 === $this->statistics->count()) { - Log::warning('Have no statistic to filter!'); + Log::debug('Have no statistic to filter!'); return new Collection(); } @@ -338,7 +338,7 @@ trait PeriodOverview private function filterPrefixedStatistics(Carbon $start, Carbon $end, string $prefix): Collection { if (0 === $this->statistics->count()) { - Log::warning('Have no statistic to filter!'); + Log::debug('Have no statistic to filter!'); return new Collection(); } From 037a128942339ef81cab576c6178ce6feeb16fc8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Oct 2025 05:57:21 +0200 Subject: [PATCH 13/26] Add missing translation. --- resources/lang/en_US/firefly.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 4a2ab3d092..f530ea76e0 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -909,6 +909,7 @@ return [ 'rule_trigger_tag_is' => 'Any tag is ":trigger_value"', 'rule_trigger_tag_contains_choice' => 'Any tag contains..', 'rule_trigger_tag_contains' => 'Any tag contains ":trigger_value"', + 'rule_trigger_not_tag_contains' => 'No tag contains ":trigger_value"', 'rule_trigger_tag_ends_choice' => 'Any tag ends with..', 'rule_trigger_tag_ends' => 'Any tag ends with ":trigger_value"', 'rule_trigger_tag_starts_choice' => 'Any tag starts with..', From 8e700944fd938c475892066bade687907f26d4e7 Mon Sep 17 00:00:00 2001 From: JC5 Date: Fri, 3 Oct 2025 06:04:16 +0200 Subject: [PATCH 14/26] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-10-03?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- THANKS.md | 1 + app/Api/V1/Requests/Data/DateRequest.php | 10 +-- .../Events/StoredGroupEventHandler.php | 20 +++--- .../PeriodStatisticRepository.php | 65 ++++++++++--------- .../Http/Controllers/PeriodOverview.php | 4 +- .../Enrichments/PiggyBankEnrichment.php | 5 +- .../Actions/UpdatePiggyBank.php | 8 +-- changelog.md | 6 +- composer.lock | 25 +++---- config/firefly.php | 4 +- package-lock.json | 42 ++++++------ resources/assets/v1/src/locales/ro.json | 2 +- 12 files changed, 94 insertions(+), 98 deletions(-) diff --git a/THANKS.md b/THANKS.md index 6c53dc2c9d..b9811e97f8 100755 --- a/THANKS.md +++ b/THANKS.md @@ -4,6 +4,7 @@ Over time, many people have contributed to Firefly III. Their efforts are not al Please find below all the people who contributed to the Firefly III code. Their names are mentioned in the year of their first contribution. ## 2025 +- Nicky De Maeyer - Denis Iskandarov - = - Lompi diff --git a/app/Api/V1/Requests/Data/DateRequest.php b/app/Api/V1/Requests/Data/DateRequest.php index 05125a8868..7155994862 100644 --- a/app/Api/V1/Requests/Data/DateRequest.php +++ b/app/Api/V1/Requests/Data/DateRequest.php @@ -44,16 +44,16 @@ class DateRequest extends FormRequest */ public function getAll(): array { - $start = $this->getCarbonDate('start'); - $end = $this->getCarbonDate('end'); - if(null === $start) { + $start = $this->getCarbonDate('start'); + $end = $this->getCarbonDate('end'); + if (null === $start) { $start = now()->startOfMonth(); } - if(null === $end) { + if (null === $end) { $end = now()->endOfMonth(); } // sanity check on dates: - [$start, $end] = $end < $start ? [$end, $start] : [$start, $end]; + [$start, $end] = $end < $start ? [$end, $start] : [$start, $end]; $start->startOfDay(); diff --git a/app/Handlers/Events/StoredGroupEventHandler.php b/app/Handlers/Events/StoredGroupEventHandler.php index f01331a15c..b960ff88df 100644 --- a/app/Handlers/Events/StoredGroupEventHandler.php +++ b/app/Handlers/Events/StoredGroupEventHandler.php @@ -62,14 +62,14 @@ class StoredGroupEventHandler } Log::debug('Now in StoredGroupEventHandler::processRules()'); - $journals = $storedGroupEvent->transactionGroup->transactionJournals; - $array = []; + $journals = $storedGroupEvent->transactionGroup->transactionJournals; + $array = []; /** @var TransactionJournal $journal */ foreach ($journals as $journal) { $array[] = $journal->id; } - $journalIds = implode(',', $array); + $journalIds = implode(',', $array); Log::debug(sprintf('Add local operator for journal(s): %s', $journalIds)); // collect rules: @@ -78,10 +78,10 @@ class StoredGroupEventHandler // add the groups to the rule engine. // it should run the rules in the group and cancel the group if necessary. - $groups = $ruleGroupRepository->getRuleGroupsWithRules('store-journal'); + $groups = $ruleGroupRepository->getRuleGroupsWithRules('store-journal'); // create and fire rule engine. - $newRuleEngine = app(RuleEngineInterface::class); + $newRuleEngine = app(RuleEngineInterface::class); $newRuleEngine->setUser($storedGroupEvent->transactionGroup->user); $newRuleEngine->addOperator(['type' => 'journal_id', 'value' => $journalIds]); $newRuleEngine->setRuleGroups($groups); @@ -90,7 +90,7 @@ class StoredGroupEventHandler private function recalculateCredit(StoredTransactionGroup $event): void { - $group = $event->transactionGroup; + $group = $event->transactionGroup; /** @var CreditRecalculateService $object */ $object = app(CreditRecalculateService::class); @@ -105,8 +105,8 @@ class StoredGroupEventHandler /** @var TransactionJournal $journal */ foreach ($event->transactionGroup->transactionJournals as $journal) { - $source = $journal->transactions()->where('amount', '<', '0')->first(); - $dest = $journal->transactions()->where('amount', '>', '0')->first(); + $source = $journal->transactions()->where('amount', '<', '0')->first(); + $dest = $journal->transactions()->where('amount', '>', '0')->first(); $repository->deleteStatisticsForModel($source->account, $journal->date); $repository->deleteStatisticsForModel($dest->account, $journal->date); $categories = $journal->categories; @@ -136,14 +136,14 @@ class StoredGroupEventHandler private function triggerWebhooks(StoredTransactionGroup $storedGroupEvent): void { Log::debug(__METHOD__); - $group = $storedGroupEvent->transactionGroup; + $group = $storedGroupEvent->transactionGroup; if (false === $storedGroupEvent->fireWebhooks) { Log::info(sprintf('Will not fire webhooks for transaction group #%d', $group->id)); return; } - $user = $group->user; + $user = $group->user; /** @var MessageGeneratorInterface $engine */ $engine = app(MessageGeneratorInterface::class); diff --git a/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php b/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php index 8763009535..e2d6649064 100644 --- a/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php +++ b/app/Repositories/PeriodStatistic/PeriodStatisticRepository.php @@ -40,24 +40,26 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U public function findPeriodStatistics(Model $model, Carbon $start, Carbon $end, array $types): Collection { return $model->primaryPeriodStatistics() - ->where('start', $start) - ->where('end', $end) - ->whereIn('type', $types) - ->get(); + ->where('start', $start) + ->where('end', $end) + ->whereIn('type', $types) + ->get() + ; } public function findPeriodStatistic(Model $model, Carbon $start, Carbon $end, string $type): Collection { return $model->primaryPeriodStatistics() - ->where('start', $start) - ->where('end', $end) - ->where('type', $type) - ->get(); + ->where('start', $start) + ->where('end', $end) + ->where('type', $type) + ->get() + ; } public function saveStatistic(Model $model, int $currencyId, Carbon $start, Carbon $end, string $type, int $count, string $amount): PeriodStatistic { - $stat = new PeriodStatistic(); + $stat = new PeriodStatistic(); $stat->primaryStatable()->associate($model); $stat->transaction_currency_id = $currencyId; $stat->user_group_id = $this->getUserGroup()->id; @@ -71,16 +73,16 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U $stat->save(); Log::debug(sprintf( - 'Saved #%d [currency #%d, Model %s #%d, %s to %s, %d, %s] as new statistic.', - $stat->id, - $model::class, - $model->id, - $stat->transaction_currency_id, - $stat->start->toW3cString(), - $stat->end->toW3cString(), - $count, - $amount - )); + 'Saved #%d [currency #%d, Model %s #%d, %s to %s, %d, %s] as new statistic.', + $stat->id, + $model::class, + $model->id, + $stat->transaction_currency_id, + $stat->start->toW3cString(), + $stat->end->toW3cString(), + $count, + $amount + )); return $stat; } @@ -99,8 +101,9 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U public function allInRangeForPrefix(string $prefix, Carbon $start, Carbon $end): Collection { return $this->userGroup->periodStatistics() - ->where('type', 'LIKE', sprintf('%s%%', $prefix)) - ->where('start', '>=', $start)->where('end', '<=', $end)->get(); + ->where('type', 'LIKE', sprintf('%s%%', $prefix)) + ->where('start', '>=', $start)->where('end', '<=', $end)->get() + ; } #[Override] @@ -119,20 +122,20 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U $stat->save(); Log::debug(sprintf( - 'Saved #%d [currency #%d, type "%s", %s to %s, %d, %s] as new statistic.', - $stat->id, - $stat->transaction_currency_id, - $stat->type, - $stat->start->toW3cString(), - $stat->end->toW3cString(), - $count, - $amount - )); + 'Saved #%d [currency #%d, type "%s", %s to %s, %d, %s] as new statistic.', + $stat->id, + $stat->transaction_currency_id, + $stat->type, + $stat->start->toW3cString(), + $stat->end->toW3cString(), + $count, + $amount + )); return $stat; } - #[\Override] + #[Override] public function deleteStatisticsForPrefix(UserGroup $userGroup, string $prefix, Carbon $date): void { $userGroup->periodStatistics()->where('start', '<=', $date)->where('end', '>=', $date)->where('type', 'LIKE', sprintf('%s%%', $prefix))->delete(); diff --git a/app/Support/Http/Controllers/PeriodOverview.php b/app/Support/Http/Controllers/PeriodOverview.php index 1fc9dc3fd4..caa114007b 100644 --- a/app/Support/Http/Controllers/PeriodOverview.php +++ b/app/Support/Http/Controllers/PeriodOverview.php @@ -331,7 +331,7 @@ trait PeriodOverview } return $this->statistics->filter( - fn(PeriodStatistic $statistic) => $statistic->start->eq($start) && $statistic->end->eq($end) && $statistic->type === $type + fn (PeriodStatistic $statistic) => $statistic->start->eq($start) && $statistic->end->eq($end) && $statistic->type === $type ); } @@ -344,7 +344,7 @@ trait PeriodOverview } return $this->statistics->filter( - fn(PeriodStatistic $statistic) => $statistic->start->eq($start) && $statistic->end->eq($end) && str_starts_with($statistic->type, $prefix) + fn (PeriodStatistic $statistic) => $statistic->start->eq($start) && $statistic->end->eq($end) && str_starts_with($statistic->type, $prefix) ); } diff --git a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php index fbc11552be..f1a79ad0fc 100644 --- a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php +++ b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php @@ -62,7 +62,7 @@ class PiggyBankEnrichment implements EnrichmentInterface public function __construct() { $this->primaryCurrency = Amount::getPrimaryCurrency(); - $this->date = now(config('app.timezone')); + $this->date = now(config('app.timezone')); } public function enrich(Collection $collection): Collection @@ -172,9 +172,6 @@ class PiggyBankEnrichment implements EnrichmentInterface $this->date = $date; } - - - private function collectIds(): void { /** @var PiggyBank $piggy */ diff --git a/app/TransactionRules/Actions/UpdatePiggyBank.php b/app/TransactionRules/Actions/UpdatePiggyBank.php index e5bb2a9411..9e21497d97 100644 --- a/app/TransactionRules/Actions/UpdatePiggyBank.php +++ b/app/TransactionRules/Actions/UpdatePiggyBank.php @@ -177,17 +177,17 @@ class UpdatePiggyBank implements ActionInterface private function removeAmount(PiggyBank $piggyBank, array $array, TransactionJournal $journal, Account $account, string $amount): void { - $repository = app(PiggyBankRepositoryInterface::class); + $repository = app(PiggyBankRepositoryInterface::class); $accountRepository = app(AccountRepositoryInterface::class); $repository->setUser($journal->user); $accountRepository->setUser($account->user); // how much can we remove from this piggy bank? - $toRemove = $repository->getCurrentAmount($piggyBank, $account); + $toRemove = $repository->getCurrentAmount($piggyBank, $account); Log::debug(sprintf('Amount is %s, max to remove is %s', $amount, $toRemove)); // if $amount is bigger than $toRemove, shrink it. - $amount = -1 === bccomp($amount, $toRemove) ? $amount : $toRemove; + $amount = -1 === bccomp($amount, $toRemove) ? $amount : $toRemove; Log::debug(sprintf('Amount is now %s', $amount)); // if amount is zero, stop. @@ -212,7 +212,7 @@ class UpdatePiggyBank implements ActionInterface private function addAmount(PiggyBank $piggyBank, array $array, TransactionJournal $journal, Account $account, string $amount): void { - $repository = app(PiggyBankRepositoryInterface::class); + $repository = app(PiggyBankRepositoryInterface::class); $accountRepository = app(AccountRepositoryInterface::class); $repository->setUser($journal->user); $accountRepository->setUser($account->user); diff --git a/changelog.md b/changelog.md index b0421f2815..588034223d 100644 --- a/changelog.md +++ b/changelog.md @@ -24,11 +24,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). - [Issue 10954](https://github.com/firefly-iii/firefly-iii/issues/10954) (Internal Server Error when trying to access (default) account) reported by @thomaschristory - [Issue 10956](https://github.com/firefly-iii/firefly-iii/issues/10956) (Manual webhook trigger fail) reported by @dudu7731 - [Issue 10960](https://github.com/firefly-iii/firefly-iii/issues/10960) (404 after deleting subscription) reported by @lindely -- #10965 +- [Issue 10965](https://github.com/firefly-iii/firefly-iii/issues/10965) (Fix running balance on liability overview) reported by @JC5 - [Discussion 10974](https://github.com/orgs/firefly-iii/discussions/10974) (Big webhook_messages table) started by @Billos -- #10988 +- [Discussion 10988](https://github.com/orgs/firefly-iii/discussions/10988) (Call to a member function startOfDay() on null.) started by @molnarti - [Issue 10990](https://github.com/firefly-iii/firefly-iii/issues/10990) (duplicate piggy event via API) reported by @4e868df3 -- #10994 +- [Discussion 10994](https://github.com/orgs/firefly-iii/discussions/10994) (How does the save per month attribute from a piggy bank is calculated?) started by @AdriDevelopsThings ### API diff --git a/composer.lock b/composer.lock index bf27259208..c9b187ff48 100644 --- a/composer.lock +++ b/composer.lock @@ -6193,16 +6193,16 @@ }, { "name": "spatie/laravel-html", - "version": "3.12.0", + "version": "3.12.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-html.git", - "reference": "3655f335609d853f51e431698179ddfe05851126" + "reference": "72af3cad24d153c230ff6e1da9fa3b7b702834c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-html/zipball/3655f335609d853f51e431698179ddfe05851126", - "reference": "3655f335609d853f51e431698179ddfe05851126", + "url": "https://api.github.com/repos/spatie/laravel-html/zipball/72af3cad24d153c230ff6e1da9fa3b7b702834c9", + "reference": "72af3cad24d153c230ff6e1da9fa3b7b702834c9", "shasum": "" }, "require": { @@ -6259,7 +6259,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/laravel-html/tree/3.12.0" + "source": "https://github.com/spatie/laravel-html/tree/3.12.1" }, "funding": [ { @@ -6267,7 +6267,7 @@ "type": "custom" } ], - "time": "2025-03-21T08:58:06+00:00" + "time": "2025-10-02T07:26:38+00:00" }, { "name": "spatie/laravel-ignition", @@ -11333,16 +11333,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.29", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-phar-composer-source.git", - "reference": "git" - }, + "version": "2.1.30", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d618573eed4a1b6b75e37b2e0b65ac65c885d88e", - "reference": "d618573eed4a1b6b75e37b2e0b65ac65c885d88e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a4a7f159927983dd4f7c8020ed227d80b7f39d7d", + "reference": "a4a7f159927983dd4f7c8020ed227d80b7f39d7d", "shasum": "" }, "require": { @@ -11387,7 +11382,7 @@ "type": "github" } ], - "time": "2025-09-25T06:58:18+00:00" + "time": "2025-10-02T16:07:52+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", diff --git a/config/firefly.php b/config/firefly.php index 01c88d918a..24a4a410e6 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,8 +78,8 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-10-02', - 'build_time' => 1759383469, + 'version' => 'develop/2025-10-03', + 'build_time' => 1759464146, 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 28, // field is no longer used. diff --git a/package-lock.json b/package-lock.json index 77e6898b78..c97c70daf4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5726,9 +5726,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.228", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.228.tgz", - "integrity": "sha512-nxkiyuqAn4MJ1QbobwqJILiDtu/jk14hEAWaMiJmNPh1Z+jqoFlBFZjdXwLWGeVSeu9hGLg6+2G9yJaW8rBIFA==", + "version": "1.5.229", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.229.tgz", + "integrity": "sha512-cwhDcZKGcT/rEthLRJ9eBlMDkh1sorgsuk+6dpsehV0g9CABsIqBxU4rLRjG+d/U6pYU1s37A4lSKrVc5lSQYg==", "dev": true, "license": "ISC" }, @@ -10980,9 +10980,9 @@ } }, "node_modules/tapable": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.3.tgz", - "integrity": "sha512-ZL6DDuAlRlLGghwcfmSn9sK3Hr6ArtyudlSAiCqQ6IfE+b+HHbydbYDIG15IfS5do+7XQQBdBiubF/cV2dnDzg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", "dev": true, "license": "MIT", "engines": { @@ -11085,9 +11085,9 @@ "license": "MIT" }, "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", - "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { @@ -11503,9 +11503,9 @@ } }, "node_modules/vite": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.7.tgz", - "integrity": "sha512-VbA8ScMvAISJNJVbRDTJdCwqQoAareR/wutevKanhR2/1EkoXVZVkkORaYm/tNVCjP/UDTKtcw3bAkwOUdedmA==", + "version": "7.1.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.9.tgz", + "integrity": "sha512-4nVGliEpxmhCL8DslSAUdxlB6+SMrhB0a1v5ijlh1xB1nEPuy1mxaHxysVucLHuWryAxLWg6a5ei+U4TLn/rFg==", "dev": true, "license": "MIT", "dependencies": { @@ -11984,9 +11984,9 @@ "license": "MIT" }, "node_modules/webpack-dev-middleware/node_modules/schema-utils": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", - "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { @@ -12119,9 +12119,9 @@ } }, "node_modules/webpack-dev-server/node_modules/schema-utils": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", - "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { @@ -12221,9 +12221,9 @@ "license": "MIT" }, "node_modules/webpack/node_modules/schema-utils": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", - "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/resources/assets/v1/src/locales/ro.json b/resources/assets/v1/src/locales/ro.json index 118eaf015b..eec1bf47de 100644 --- a/resources/assets/v1/src/locales/ro.json +++ b/resources/assets/v1/src/locales/ro.json @@ -160,7 +160,7 @@ "url": "URL", "active": "Activ", "interest_date": "Data de interes", - "administration_currency": "Primary currency", + "administration_currency": "Moneda principala", "title": "Titlu", "date": "Dat\u0103", "book_date": "Rezerv\u0103 dat\u0103", From 957bc00847f2bfef3384de028033e7f22ac198d4 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Oct 2025 06:41:42 +0200 Subject: [PATCH 15/26] Add statistics to budget, although unused atm. --- app/Models/Budget.php | 5 +++++ app/Models/Category.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 4375c6c2a7..481ad1c6dc 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -128,4 +128,9 @@ class Budget extends Model get: static fn ($value) => (int)$value, ); } + + public function primaryPeriodStatistics(): MorphMany + { + return $this->morphMany(PeriodStatistic::class, 'primary_statable'); + } } diff --git a/app/Models/Category.php b/app/Models/Category.php index 55c9c7ebcf..5eb63dbcba 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -81,7 +81,7 @@ class Category extends Model } /** - * Get all of the category's notes. + * Get all the category's notes. */ public function notes(): MorphMany { From 012172b0b5724a0b4e2107be24f7b540a28fc323 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Oct 2025 06:42:24 +0200 Subject: [PATCH 16/26] Add statistics routine to update event. --- .../Events/UpdatedGroupEventHandler.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/Handlers/Events/UpdatedGroupEventHandler.php b/app/Handlers/Events/UpdatedGroupEventHandler.php index e1393a3355..28a687ea3d 100644 --- a/app/Handlers/Events/UpdatedGroupEventHandler.php +++ b/app/Handlers/Events/UpdatedGroupEventHandler.php @@ -72,12 +72,26 @@ class UpdatedGroupEventHandler $dest = $journal->transactions()->where('amount', '>', '0')->first(); $repository->deleteStatisticsForModel($source->account, $journal->date); $repository->deleteStatisticsForModel($dest->account, $journal->date); - foreach ($journal->categories as $category) { + + $categories = $journal->categories; + $tags = $journal->tags; + $budgets = $journal->budgets; + + foreach ($categories as $category) { $repository->deleteStatisticsForModel($category, $journal->date); } - foreach ($journal->tags as $tag) { + foreach ($tags as $tag) { $repository->deleteStatisticsForModel($tag, $journal->date); } + foreach ($budgets as $budget) { + $repository->deleteStatisticsForModel($budget, $journal->date); + } + if (0 === $categories->count()) { + $repository->deleteStatisticsForPrefix($journal->userGroup, 'no_category', $journal->date); + } + if (0 === $budgets->count()) { + $repository->deleteStatisticsForPrefix($journal->userGroup, 'no_budget', $journal->date); + } } } From 1652c3af72d0d3b3b994157c5daf0f62825a564b Mon Sep 17 00:00:00 2001 From: JC5 Date: Fri, 3 Oct 2025 06:46:56 +0200 Subject: [PATCH 17/26] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-10-03?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- THANKS.md | 1 - app/Handlers/Events/UpdatedGroupEventHandler.php | 4 ++-- composer.lock | 14 +++++++------- config/firefly.php | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/THANKS.md b/THANKS.md index b9811e97f8..2839b6f7f6 100755 --- a/THANKS.md +++ b/THANKS.md @@ -6,7 +6,6 @@ Please find below all the people who contributed to the Firefly III code. Their ## 2025 - Nicky De Maeyer - Denis Iskandarov -- = - Lompi - Jose Diaz-Gonzalez - SoftBrix diff --git a/app/Handlers/Events/UpdatedGroupEventHandler.php b/app/Handlers/Events/UpdatedGroupEventHandler.php index 28a687ea3d..1fb89d2be6 100644 --- a/app/Handlers/Events/UpdatedGroupEventHandler.php +++ b/app/Handlers/Events/UpdatedGroupEventHandler.php @@ -68,8 +68,8 @@ class UpdatedGroupEventHandler /** @var TransactionJournal $journal */ foreach ($event->transactionGroup->transactionJournals as $journal) { - $source = $journal->transactions()->where('amount', '<', '0')->first(); - $dest = $journal->transactions()->where('amount', '>', '0')->first(); + $source = $journal->transactions()->where('amount', '<', '0')->first(); + $dest = $journal->transactions()->where('amount', '>', '0')->first(); $repository->deleteStatisticsForModel($source->account, $journal->date); $repository->deleteStatisticsForModel($dest->account, $journal->date); diff --git a/composer.lock b/composer.lock index c9b187ff48..982569fbbd 100644 --- a/composer.lock +++ b/composer.lock @@ -11815,16 +11815,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.3.15", + "version": "12.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b035ee2cd8ecad4091885b61017ebb1d80eb0e57" + "reference": "f62aab5794e36ccd26860db2d1bbf89ac19028d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b035ee2cd8ecad4091885b61017ebb1d80eb0e57", - "reference": "b035ee2cd8ecad4091885b61017ebb1d80eb0e57", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f62aab5794e36ccd26860db2d1bbf89ac19028d9", + "reference": "f62aab5794e36ccd26860db2d1bbf89ac19028d9", "shasum": "" }, "require": { @@ -11860,7 +11860,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "12.3-dev" + "dev-main": "12.4-dev" } }, "autoload": { @@ -11892,7 +11892,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.3.15" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.4.0" }, "funding": [ { @@ -11916,7 +11916,7 @@ "type": "tidelift" } ], - "time": "2025-09-28T12:10:54+00:00" + "time": "2025-10-03T04:28:03+00:00" }, { "name": "rector/rector", diff --git a/config/firefly.php b/config/firefly.php index 24a4a410e6..906dab11e0 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -79,7 +79,7 @@ return [ // see cer.php for exchange rates feature flag. ], 'version' => 'develop/2025-10-03', - 'build_time' => 1759464146, + 'build_time' => 1759466687, 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 28, // field is no longer used. From 362705ec713ffe645547b17ceb9250dbce993f19 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 5 Oct 2025 07:47:36 +0200 Subject: [PATCH 18/26] Add missing entry. --- app/Support/Navigation.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index cb9ac29d9f..5c9c61054b 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -423,6 +423,7 @@ class Navigation 'month' => (string)trans('config.month_js'), 'monthly' => (string)trans('config.month_js'), '1Y' => (string)trans('config.year_js'), + 'YTD' => (string)trans('config.year_js'), 'year' => (string)trans('config.year_js'), 'yearly' => (string)trans('config.year_js'), '6M' => (string)trans('config.half_year_js'), From 072212c1124047b80e00bc46607a1131aaecb927 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 5 Oct 2025 12:49:39 +0200 Subject: [PATCH 19/26] Replace log. --- .ci/phpstan.neon | 2 +- .../V1/Controllers/Chart/BudgetController.php | 53 ------------------- .../Controllers/Chart/CategoryController.php | 28 +++++----- .../CorrectsOpeningBalanceCurrencies.php | 3 +- .../Correction/CorrectsTransferBudgets.php | 5 +- .../Correction/CorrectsUnevenAmount.php | 4 +- .../Correction/RemovesEmptyJournals.php | 9 ++-- app/Console/Commands/Export/ExportsData.php | 5 +- .../Commands/System/ForcesDecimalSize.php | 3 +- .../Commands/System/VerifySecurityAlerts.php | 17 +++--- app/Console/Commands/Tools/ApplyRules.php | 2 +- app/Console/Commands/Tools/Cron.php | 24 ++++----- .../Upgrade/AddsTransactionIdentifiers.php | 3 +- .../Upgrade/RemovesDatabaseDecryption.php | 13 ++--- .../Commands/Upgrade/UpgradesAttachments.php | 3 +- .../Upgrade/UpgradesBudgetLimitPeriods.php | 5 +- .../Commands/Upgrade/UpgradesJournalNotes.php | 3 +- .../Upgrade/UpgradesLiabilitiesEight.php | 3 +- .../Commands/Upgrade/UpgradesToGroups.php | 37 ++++++------- .../Upgrade/UpgradesTransferCurrencies.php | 5 +- app/Console/Commands/VerifiesAccessToken.php | 9 ++-- app/Console/Kernel.php | 3 +- app/Events/DestroyedTransactionGroup.php | 3 +- app/Events/Model/PiggyBank/ChangedAmount.php | 3 +- .../Model/Rule/RuleActionFailedOnArray.php | 3 +- .../Model/Rule/RuleActionFailedOnObject.php | 3 +- app/Events/RequestedReportOnJournals.php | 3 +- .../Test/OwnerTestNotificationChannel.php | 3 +- .../Test/UserTestNotificationChannel.php | 3 +- app/Exceptions/GracefulNotFoundHandler.php | 19 +++---- app/Exceptions/Handler.php | 29 +++++----- app/Factory/AccountFactory.php | 30 ++++++----- app/Models/BudgetLimit.php | 21 +++++--- app/Models/Recurrence.php | 5 ++ app/Models/Rule.php | 3 ++ app/Models/RuleGroup.php | 3 ++ app/Models/TransactionGroup.php | 16 ++++-- app/Models/TransactionJournal.php | 1 + app/Support/Navigation.php | 2 - 39 files changed, 194 insertions(+), 195 deletions(-) diff --git a/.ci/phpstan.neon b/.ci/phpstan.neon index 1b8e889c72..d145b09f80 100644 --- a/.ci/phpstan.neon +++ b/.ci/phpstan.neon @@ -28,5 +28,5 @@ parameters: # The level 8 is the highest level. original was 5 # 7 is more than enough, higher just leaves NULL things. - level: 7 + level: 6 diff --git a/app/Api/V1/Controllers/Chart/BudgetController.php b/app/Api/V1/Controllers/Chart/BudgetController.php index 726f4c78bd..194bcf0362 100644 --- a/app/Api/V1/Controllers/Chart/BudgetController.php +++ b/app/Api/V1/Controllers/Chart/BudgetController.php @@ -259,59 +259,6 @@ class BudgetController extends Controller return $return; } - // /** - // * Function that processes each budget limit (per budget). - // * - // * If you have a budget limit in EUR, only transactions in EUR will be considered. - // * If you have a budget limit in GBP, only transactions in GBP will be considered. - // * - // * If you have a budget limit in EUR, and a transaction in GBP, it will not be considered for the EUR budget limit. - // * - // * @throws FireflyException - // */ - // private function budgetLimits(Budget $budget, Collection $limits): array - // { - // Log::debug(sprintf('Now in budgetLimits(#%d)', $budget->id)); - // $data = []; - // - // /** @var BudgetLimit $limit */ - // foreach ($limits as $limit) { - // $data = array_merge($data, $this->processLimit($budget, $limit)); - // } - // - // return $data; - // } - - // /** - // * @throws FireflyException - // */ - // private function processLimit(Budget $budget, BudgetLimit $limit): array - // { - // Log::debug(sprintf('Created new ExchangeRateConverter in %s', __METHOD__)); - // $end = clone $limit->end_date; - // $end->endOfDay(); - // $spent = $this->opsRepository->listExpenses($limit->start_date, $end, null, new Collection()->push($budget)); - // $limitCurrencyId = $limit->transaction_currency_id; - // - // /** @var array $entry */ - // // only spent the entry where the entry's currency matches the budget limit's currency - // // so $filtered will only have 1 or 0 entries - // $filtered = array_filter($spent, fn ($entry) => $entry['currency_id'] === $limitCurrencyId); - // $result = $this->processExpenses($budget->id, $filtered, $limit->start_date, $end); - // if (1 === count($result)) { - // $compare = bccomp($limit->amount, (string)app('steam')->positive($result[$limitCurrencyId]['spent'])); - // $result[$limitCurrencyId]['budgeted'] = $limit->amount; - // if (1 === $compare) { - // // convert this amount into the primary currency: - // $result[$limitCurrencyId]['left'] = bcadd($limit->amount, (string)$result[$limitCurrencyId]['spent']); - // } - // if ($compare <= 0) { - // $result[$limitCurrencyId]['overspent'] = app('steam')->positive(bcadd($limit->amount, (string)$result[$limitCurrencyId]['spent'])); - // } - // } - // - // return $result; - // } private function filterLimit(int $currencyId, Collection $limits): ?BudgetLimit { diff --git a/app/Api/V1/Controllers/Chart/CategoryController.php b/app/Api/V1/Controllers/Chart/CategoryController.php index 9626c447a5..a81261e3ea 100644 --- a/app/Api/V1/Controllers/Chart/CategoryController.php +++ b/app/Api/V1/Controllers/Chart/CategoryController.php @@ -107,11 +107,11 @@ class CategoryController extends Controller $type = $journal['transaction_type_type']; $currency = $currencies[$journalCurrencyId] ?? $this->currencyRepos->find($journalCurrencyId); $currencies[$journalCurrencyId] = $currency; - $currencyId = (int)$currency->id; - $currencyName = (string)$currency->name; - $currencyCode = (string)$currency->code; - $currencySymbol = (string)$currency->symbol; - $currencyDecimalPlaces = (int)$currency->decimal_places; + $currencyId = $currency->id; + $currencyName = $currency->name; + $currencyCode = $currency->code; + $currencySymbol = $currency->symbol; + $currencyDecimalPlaces = $currency->decimal_places; $amount = Steam::positive((string)$journal['amount']); $pcAmount = null; @@ -120,11 +120,11 @@ class CategoryController extends Controller $pcAmount = $amount; } if ($this->convertToPrimary && $journalCurrencyId !== $this->primaryCurrency->id) { - $currencyId = (int)$this->primaryCurrency->id; - $currencyName = (string)$this->primaryCurrency->name; - $currencyCode = (string)$this->primaryCurrency->code; - $currencySymbol = (string)$this->primaryCurrency->symbol; - $currencyDecimalPlaces = (int)$this->primaryCurrency->decimal_places; + $currencyId = $this->primaryCurrency->id; + $currencyName = $this->primaryCurrency->name; + $currencyCode = $this->primaryCurrency->code; + $currencySymbol = $this->primaryCurrency->symbol; + $currencyDecimalPlaces = $this->primaryCurrency->decimal_places; $pcAmount = $converter->convert($currency, $this->primaryCurrency, $journal['date'], $amount); Log::debug(sprintf('Converted %s %s to %s %s', $journal['currency_code'], $amount, $this->primaryCurrency->code, $pcAmount)); } @@ -141,10 +141,10 @@ class CategoryController extends Controller 'currency_symbol' => $currencySymbol, 'currency_decimal_places' => $currencyDecimalPlaces, 'primary_currency_id' => (string)$this->primaryCurrency->id, - 'primary_currency_name' => (string)$this->primaryCurrency->name, - 'primary_currency_code' => (string)$this->primaryCurrency->code, - 'primary_currency_symbol' => (string)$this->primaryCurrency->symbol, - 'primary_currency_decimal_places' => (int)$this->primaryCurrency->decimal_places, + 'primary_currency_name' => $this->primaryCurrency->name, + 'primary_currency_code' => $this->primaryCurrency->code, + 'primary_currency_symbol' => $this->primaryCurrency->symbol, + 'primary_currency_decimal_places' => $this->primaryCurrency->decimal_places, 'period' => null, 'start_date' => $start->toAtomString(), 'end_date' => $end->toAtomString(), diff --git a/app/Console/Commands/Correction/CorrectsOpeningBalanceCurrencies.php b/app/Console/Commands/Correction/CorrectsOpeningBalanceCurrencies.php index 0383e72785..9857fa2209 100644 --- a/app/Console/Commands/Correction/CorrectsOpeningBalanceCurrencies.php +++ b/app/Console/Commands/Correction/CorrectsOpeningBalanceCurrencies.php @@ -34,6 +34,7 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Illuminate\Console\Command; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; class CorrectsOpeningBalanceCurrencies extends Command { @@ -78,7 +79,7 @@ class CorrectsOpeningBalanceCurrencies extends Command $account = $this->getAccount($journal); if (!$account instanceof Account) { $message = sprintf('Transaction journal #%d has no valid account. Can\'t fix this line.', $journal->id); - app('log')->warning($message); + Log::warning($message); $this->friendlyError($message); return 0; diff --git a/app/Console/Commands/Correction/CorrectsTransferBudgets.php b/app/Console/Commands/Correction/CorrectsTransferBudgets.php index 5098087f76..a717741833 100644 --- a/app/Console/Commands/Correction/CorrectsTransferBudgets.php +++ b/app/Console/Commands/Correction/CorrectsTransferBudgets.php @@ -28,6 +28,7 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Models\TransactionJournal; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class CorrectsTransferBudgets extends Command { @@ -53,13 +54,13 @@ class CorrectsTransferBudgets extends Command foreach ($set as $entry) { $message = sprintf('Transaction journal #%d is a %s, so has no longer a budget.', $entry->id, $entry->transactionType->type); $this->friendlyInfo($message); - app('log')->debug($message); + Log::debug($message); $entry->budgets()->sync([]); ++$count; } if (0 !== $count) { $message = sprintf('Corrected %d invalid budget/journal entries (entry).', $count); - app('log')->debug($message); + Log::debug($message); $this->friendlyInfo($message); } diff --git a/app/Console/Commands/Correction/CorrectsUnevenAmount.php b/app/Console/Commands/Correction/CorrectsUnevenAmount.php index 4d1e527f3e..cc34405706 100644 --- a/app/Console/Commands/Correction/CorrectsUnevenAmount.php +++ b/app/Console/Commands/Correction/CorrectsUnevenAmount.php @@ -152,7 +152,7 @@ class CorrectsUnevenAmount extends Command $entry->the_sum ); $this->friendlyWarning($message); - app('log')->warning($message); + Log::warning($message); ++$this->count; continue; @@ -230,7 +230,7 @@ class CorrectsUnevenAmount extends Command $message = sprintf('Sum of journal #%d is not zero, journal is broken and now fixed.', $journal->id); $this->friendlyWarning($message); - app('log')->warning($message); + Log::warning($message); $destination->amount = $amount; $destination->save(); diff --git a/app/Console/Commands/Correction/RemovesEmptyJournals.php b/app/Console/Commands/Correction/RemovesEmptyJournals.php index 4ea323c72c..1e850b4bda 100644 --- a/app/Console/Commands/Correction/RemovesEmptyJournals.php +++ b/app/Console/Commands/Correction/RemovesEmptyJournals.php @@ -30,6 +30,7 @@ use FireflyIII\Models\TransactionJournal; use Illuminate\Console\Command; use Illuminate\Database\QueryException; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; class RemovesEmptyJournals extends Command { @@ -68,8 +69,8 @@ class RemovesEmptyJournals extends Command $journal = TransactionJournal::find($row->transaction_journal_id); $journal?->delete(); } catch (QueryException $e) { - app('log')->info(sprintf('Could not delete journal: %s', $e->getMessage())); - app('log')->error($e->getTraceAsString()); + Log::info(sprintf('Could not delete journal: %s', $e->getMessage())); + Log::error($e->getTraceAsString()); } Transaction::where('transaction_journal_id', $row->transaction_journal_id)->delete(); @@ -96,8 +97,8 @@ class RemovesEmptyJournals extends Command $journal = TransactionJournal::find($entry->id); $journal?->delete(); } catch (QueryException $e) { - app('log')->info(sprintf('Could not delete entry: %s', $e->getMessage())); - app('log')->error($e->getTraceAsString()); + Log::info(sprintf('Could not delete entry: %s', $e->getMessage())); + Log::error($e->getTraceAsString()); } $this->friendlyInfo(sprintf('Deleted empty transaction journal #%d', $entry->id)); diff --git a/app/Console/Commands/Export/ExportsData.php b/app/Console/Commands/Export/ExportsData.php index d1189a2b40..cce69d8e45 100644 --- a/app/Console/Commands/Export/ExportsData.php +++ b/app/Console/Commands/Export/ExportsData.php @@ -37,6 +37,7 @@ use FireflyIII\Support\Export\ExportDataGenerator; use Illuminate\Console\Command; use Illuminate\Support\Collection; use Exception; +use Illuminate\Support\Facades\Log; use InvalidArgumentException; use function Safe\file_put_contents; @@ -189,7 +190,7 @@ class ExportsData extends Command try { $date = Carbon::createFromFormat('!Y-m-d', $this->option($field)); } catch (InvalidArgumentException $e) { - app('log')->error($e->getMessage()); + Log::error($e->getMessage()); $this->friendlyError(sprintf('%s date "%s" must be formatted YYYY-MM-DD. Field will be ignored.', $field, $this->option('start'))); $error = true; } @@ -200,7 +201,7 @@ class ExportsData extends Command } } if (null === $this->option($field)) { - app('log')->info(sprintf('No date given in field "%s"', $field)); + Log::info(sprintf('No date given in field "%s"', $field)); $error = true; } diff --git a/app/Console/Commands/System/ForcesDecimalSize.php b/app/Console/Commands/System/ForcesDecimalSize.php index 91884011ce..b96ace66da 100644 --- a/app/Console/Commands/System/ForcesDecimalSize.php +++ b/app/Console/Commands/System/ForcesDecimalSize.php @@ -43,6 +43,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; use function Safe\mb_regex_encoding; use function Safe\json_encode; @@ -95,7 +96,7 @@ class ForcesDecimalSize extends Command */ public function handle(): int { - app('log')->debug('Now in ForceDecimalSize::handle()'); + Log::debug('Now in ForceDecimalSize::handle()'); $this->determineDatabaseType(); $this->friendlyError('Running this command is dangerous and can cause data loss.'); diff --git a/app/Console/Commands/System/VerifySecurityAlerts.php b/app/Console/Commands/System/VerifySecurityAlerts.php index 920142d794..75b7f85b10 100644 --- a/app/Console/Commands/System/VerifySecurityAlerts.php +++ b/app/Console/Commands/System/VerifySecurityAlerts.php @@ -27,6 +27,7 @@ namespace FireflyIII\Console\Commands\System; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use Illuminate\Console\Command; use Illuminate\Database\QueryException; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use League\Flysystem\FilesystemException; @@ -54,7 +55,7 @@ class VerifySecurityAlerts extends Command $disk = Storage::disk('resources'); // Next line is ignored because it's a Laravel Facade. if (!$disk->has('alerts.json')) { // @phpstan-ignore-line - app('log')->debug('No alerts.json file present.'); + Log::debug('No alerts.json file present.'); return 0; } @@ -64,19 +65,19 @@ class VerifySecurityAlerts extends Command /** @var array $array */ foreach ($json as $array) { if ($version === $array['version'] && true === $array['advisory']) { - app('log')->debug(sprintf('Version %s has an alert!', $array['version'])); + Log::debug(sprintf('Version %s has an alert!', $array['version'])); // add advisory to configuration. $this->saveSecurityAdvisory($array); // depends on level if ('info' === $array['level']) { - app('log')->debug('INFO level alert'); + Log::debug('INFO level alert'); $this->friendlyInfo($array['message']); return 0; } if ('warning' === $array['level']) { - app('log')->debug('WARNING level alert'); + Log::debug('WARNING level alert'); $this->friendlyWarning('------------------------ :o'); $this->friendlyWarning($array['message']); $this->friendlyWarning('------------------------ :o'); @@ -84,7 +85,7 @@ class VerifySecurityAlerts extends Command return 0; } if ('danger' === $array['level']) { - app('log')->debug('DANGER level alert'); + Log::debug('DANGER level alert'); $this->friendlyError('------------------------ :-('); $this->friendlyError($array['message']); $this->friendlyError('------------------------ :-('); @@ -95,7 +96,7 @@ class VerifySecurityAlerts extends Command return 0; } } - app('log')->debug(sprintf('No security alerts for version %s', $version)); + Log::debug(sprintf('No security alerts for version %s', $version)); $this->friendlyPositive(sprintf('No security alerts for version %s', $version)); return 0; @@ -107,7 +108,7 @@ class VerifySecurityAlerts extends Command app('fireflyconfig')->delete('upgrade_security_message'); app('fireflyconfig')->delete('upgrade_security_level'); } catch (QueryException $e) { - app('log')->debug(sprintf('Could not delete old security advisory, but thats OK: %s', $e->getMessage())); + Log::debug(sprintf('Could not delete old security advisory, but thats OK: %s', $e->getMessage())); } } @@ -117,7 +118,7 @@ class VerifySecurityAlerts extends Command app('fireflyconfig')->set('upgrade_security_message', $array['message']); app('fireflyconfig')->set('upgrade_security_level', $array['level']); } catch (QueryException $e) { - app('log')->debug(sprintf('Could not save new security advisory, but thats OK: %s', $e->getMessage())); + Log::debug(sprintf('Could not save new security advisory, but thats OK: %s', $e->getMessage())); } } } diff --git a/app/Console/Commands/Tools/ApplyRules.php b/app/Console/Commands/Tools/ApplyRules.php index 6a42ac0990..0b07299ab1 100644 --- a/app/Console/Commands/Tools/ApplyRules.php +++ b/app/Console/Commands/Tools/ApplyRules.php @@ -315,7 +315,7 @@ class ApplyRules extends Command // if in rule selection, or group in selection or all rules, it's included. $test = $this->includeRule($rule, $group); if (true === $test) { - app('log')->debug(sprintf('Will include rule #%d "%s"', $rule->id, $rule->title)); + Log::debug(sprintf('Will include rule #%d "%s"', $rule->id, $rule->title)); $rulesToApply->push($rule); } } diff --git a/app/Console/Commands/Tools/Cron.php b/app/Console/Commands/Tools/Cron.php index 27a4e66a64..ec91c4ebde 100644 --- a/app/Console/Commands/Tools/Cron.php +++ b/app/Console/Commands/Tools/Cron.php @@ -76,8 +76,8 @@ class Cron extends Command try { $this->exchangeRatesCronJob($force, $date); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } @@ -87,8 +87,8 @@ class Cron extends Command try { $this->checkForUpdates($force); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } @@ -98,8 +98,8 @@ class Cron extends Command try { $this->recurringCronJob($force, $date); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } @@ -109,8 +109,8 @@ class Cron extends Command try { $this->autoBudgetCronJob($force, $date); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } @@ -120,8 +120,8 @@ class Cron extends Command try { $this->subscriptionWarningCronJob($force, $date); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } @@ -130,8 +130,8 @@ class Cron extends Command try { $this->webhookCronJob($force, $date); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); $this->friendlyError($e->getMessage()); } } diff --git a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php index af59ca61ce..ebcc347d0a 100644 --- a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php +++ b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php @@ -31,6 +31,7 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface; use Illuminate\Console\Command; use Illuminate\Database\QueryException; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; class AddsTransactionIdentifiers extends Command @@ -147,7 +148,7 @@ class AddsTransactionIdentifiers extends Command ->first() ; } catch (QueryException $e) { - app('log')->error($e->getMessage()); + Log::error($e->getMessage()); $this->friendlyError('Firefly III could not find the "identifier" field in the "transactions" table.'); $this->friendlyError(sprintf('This field is required for Firefly III version %s to run.', config('firefly.version'))); $this->friendlyError('Please run "php artisan migrate --force" to add this field to the table.'); diff --git a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php index b1e3d198db..57463c5d8d 100644 --- a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php +++ b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php @@ -31,6 +31,7 @@ use Illuminate\Console\Command; use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; use JsonException; use stdClass; @@ -96,7 +97,7 @@ class RemovesDatabaseDecryption extends Command try { $configVar = app('fireflyconfig')->get($configName, false); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); + Log::error($e->getMessage()); } if (null !== $configVar) { return (bool) $configVar->data; @@ -129,8 +130,8 @@ class RemovesDatabaseDecryption extends Command } catch (FireflyException $e) { $message = sprintf('Could not decrypt field "%s" in row #%d of table "%s": %s', $field, $id, $table, $e->getMessage()); $this->friendlyError($message); - app('log')->error($message); - app('log')->error($e->getTraceAsString()); + Log::error($message); + Log::error($e->getTraceAsString()); } // A separate routine for preferences table: @@ -175,9 +176,9 @@ class RemovesDatabaseDecryption extends Command } catch (JsonException $e) { $message = sprintf('Could not JSON decode preference row #%d: %s. This does not have to be a problem.', $id, $e->getMessage()); $this->friendlyError($message); - app('log')->warning($message); - app('log')->warning($value); - app('log')->warning($e->getTraceAsString()); + Log::warning($message); + Log::warning($value); + Log::warning($e->getTraceAsString()); return; } diff --git a/app/Console/Commands/Upgrade/UpgradesAttachments.php b/app/Console/Commands/Upgrade/UpgradesAttachments.php index c3e0d32eb9..06f8175e08 100644 --- a/app/Console/Commands/Upgrade/UpgradesAttachments.php +++ b/app/Console/Commands/Upgrade/UpgradesAttachments.php @@ -29,6 +29,7 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Attachment; use FireflyIII\Models\Note; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class UpgradesAttachments extends Command { @@ -75,7 +76,7 @@ class UpgradesAttachments extends Command $att->description = ''; $att->save(); - app('log')->debug(sprintf('Migrated attachment #%s description to note #%d.', $att->id, $note->id)); + Log::debug(sprintf('Migrated attachment #%s description to note #%d.', $att->id, $note->id)); ++$count; } } diff --git a/app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php b/app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php index a43f05682d..d3581741b3 100644 --- a/app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php +++ b/app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php @@ -27,6 +27,7 @@ namespace FireflyIII\Console\Commands\Upgrade; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Models\BudgetLimit; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class UpgradesBudgetLimitPeriods extends Command { @@ -84,7 +85,7 @@ class UpgradesBudgetLimitPeriods extends Command $limit->end_date->format('Y-m-d') ); $this->friendlyWarning($message); - app('log')->warning($message); + Log::warning($message); return; } @@ -98,7 +99,7 @@ class UpgradesBudgetLimitPeriods extends Command $limit->end_date->format('Y-m-d'), $period ); - app('log')->debug($msg); + Log::debug($msg); } private function getLimitPeriod(BudgetLimit $limit): ?string diff --git a/app/Console/Commands/Upgrade/UpgradesJournalNotes.php b/app/Console/Commands/Upgrade/UpgradesJournalNotes.php index 788cf1f6c1..5a3390e3d6 100644 --- a/app/Console/Commands/Upgrade/UpgradesJournalNotes.php +++ b/app/Console/Commands/Upgrade/UpgradesJournalNotes.php @@ -28,6 +28,7 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Models\Note; use FireflyIII\Models\TransactionJournalMeta; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class UpgradesJournalNotes extends Command { @@ -66,7 +67,7 @@ class UpgradesJournalNotes extends Command $note->text = $meta->data; $note->save(); - app('log')->debug(sprintf('Migrated meta note #%d to Note #%d', $meta->id, $note->id)); + Log::debug(sprintf('Migrated meta note #%d to Note #%d', $meta->id, $note->id)); $meta->delete(); ++$count; diff --git a/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php b/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php index 9a2bf9f048..072c48ca08 100644 --- a/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php +++ b/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php @@ -35,6 +35,7 @@ use FireflyIII\Services\Internal\Destroy\TransactionGroupDestroyService; use FireflyIII\Services\Internal\Support\CreditRecalculateService; use FireflyIII\User; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class UpgradesLiabilitiesEight extends Command { @@ -186,7 +187,7 @@ class UpgradesLiabilitiesEight extends Command return; } - app('log')->warning('Did not find opening balance.'); + Log::warning('Did not find opening balance.'); } private function deleteTransactions(Account $account): int diff --git a/app/Console/Commands/Upgrade/UpgradesToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php index 453c31e0d3..3ceee64711 100644 --- a/app/Console/Commands/Upgrade/UpgradesToGroups.php +++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php @@ -38,6 +38,7 @@ use Illuminate\Console\Command; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Exception; +use Illuminate\Support\Facades\Log; class UpgradesToGroups extends Command { @@ -127,11 +128,11 @@ class UpgradesToGroups extends Command { // double check transaction count. if ($journal->transactions->count() <= 2) { - app('log')->debug(sprintf('Will not try to convert journal #%d because it has 2 or fewer transactions.', $journal->id)); + Log::debug(sprintf('Will not try to convert journal #%d because it has 2 or fewer transactions.', $journal->id)); return; } - app('log')->debug(sprintf('Will now try to convert journal #%d', $journal->id)); + Log::debug(sprintf('Will now try to convert journal #%d', $journal->id)); $this->journalRepository->setUser($journal->user); $this->groupFactory->setUser($journal->user); @@ -144,15 +145,15 @@ class UpgradesToGroups extends Command ]; $destTransactions = $this->getDestinationTransactions($journal); - app('log')->debug(sprintf('Will use %d positive transactions to create a new group.', $destTransactions->count())); + Log::debug(sprintf('Will use %d positive transactions to create a new group.', $destTransactions->count())); /** @var Transaction $transaction */ foreach ($destTransactions as $transaction) { $data['transactions'][] = $this->generateTransaction($journal, $transaction); } - app('log')->debug(sprintf('Now calling transaction journal factory (%d transactions in array)', count($data['transactions']))); + Log::debug(sprintf('Now calling transaction journal factory (%d transactions in array)', count($data['transactions']))); $group = $this->groupFactory->create($data); - app('log')->debug('Done calling transaction journal factory'); + Log::debug('Done calling transaction journal factory'); // delete the old transaction journal. $this->service->destroy($journal); @@ -160,7 +161,7 @@ class UpgradesToGroups extends Command ++$this->count; // report on result: - app('log')->debug( + Log::debug( sprintf( 'Migrated journal #%d into group #%d with these journals: #%s', $journal->id, @@ -190,7 +191,7 @@ class UpgradesToGroups extends Command */ private function generateTransaction(TransactionJournal $journal, Transaction $transaction): array { - app('log')->debug(sprintf('Now going to add transaction #%d to the array.', $transaction->id)); + Log::debug(sprintf('Now going to add transaction #%d to the array.', $transaction->id)); $opposingTr = $this->findOpposingTransaction($journal, $transaction); if (!$opposingTr instanceof Transaction) { @@ -282,8 +283,8 @@ class UpgradesToGroups extends Command static function (Transaction $subject) use ($transaction) { $amount = (float) $transaction->amount * -1 === (float) $subject->amount; // intentional float $identifier = $transaction->identifier === $subject->identifier; - app('log')->debug(sprintf('Amount the same? %s', var_export($amount, true))); - app('log')->debug(sprintf('ID the same? %s', var_export($identifier, true))); + Log::debug(sprintf('Amount the same? %s', var_export($amount, true))); + Log::debug(sprintf('ID the same? %s', var_export($identifier, true))); return $amount && $identifier; } @@ -294,13 +295,13 @@ class UpgradesToGroups extends Command private function getTransactionBudget(Transaction $left, Transaction $right): ?int { - app('log')->debug('Now in getTransactionBudget()'); + Log::debug('Now in getTransactionBudget()'); // try to get a budget ID from the left transaction: /** @var null|Budget $budget */ $budget = $left->budgets()->first(); if (null !== $budget) { - app('log')->debug(sprintf('Return budget #%d, from transaction #%d', $budget->id, $left->id)); + Log::debug(sprintf('Return budget #%d, from transaction #%d', $budget->id, $left->id)); return $budget->id; } @@ -309,11 +310,11 @@ class UpgradesToGroups extends Command /** @var null|Budget $budget */ $budget = $right->budgets()->first(); if (null !== $budget) { - app('log')->debug(sprintf('Return budget #%d, from transaction #%d', $budget->id, $right->id)); + Log::debug(sprintf('Return budget #%d, from transaction #%d', $budget->id, $right->id)); return $budget->id; } - app('log')->debug('Neither left or right have a budget, return NULL'); + Log::debug('Neither left or right have a budget, return NULL'); // if all fails, return NULL. return null; @@ -321,13 +322,13 @@ class UpgradesToGroups extends Command private function getTransactionCategory(Transaction $left, Transaction $right): ?int { - app('log')->debug('Now in getTransactionCategory()'); + Log::debug('Now in getTransactionCategory()'); // try to get a category ID from the left transaction: /** @var null|Category $category */ $category = $left->categories()->first(); if (null !== $category) { - app('log')->debug(sprintf('Return category #%d, from transaction #%d', $category->id, $left->id)); + Log::debug(sprintf('Return category #%d, from transaction #%d', $category->id, $left->id)); return $category->id; } @@ -336,11 +337,11 @@ class UpgradesToGroups extends Command /** @var null|Category $category */ $category = $right->categories()->first(); if (null !== $category) { - app('log')->debug(sprintf('Return category #%d, from transaction #%d', $category->id, $category->id)); + Log::debug(sprintf('Return category #%d, from transaction #%d', $category->id, $category->id)); return $category->id; } - app('log')->debug('Neither left or right have a category, return NULL'); + Log::debug('Neither left or right have a category, return NULL'); // if all fails, return NULL. return null; @@ -354,7 +355,7 @@ class UpgradesToGroups extends Command $orphanedJournals = $this->cliRepository->getJournalsWithoutGroup(); $total = count($orphanedJournals); if ($total > 0) { - app('log')->debug(sprintf('Going to convert %d transaction journals. Please hold..', $total)); + Log::debug(sprintf('Going to convert %d transaction journals. Please hold..', $total)); $this->friendlyInfo(sprintf('Going to convert %d transaction journals. Please hold..', $total)); /** @var array $array */ diff --git a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php index d92813d6cd..fee9fde03d 100644 --- a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php +++ b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php @@ -33,6 +33,7 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Log; class UpgradesTransferCurrencies extends Command { @@ -262,7 +263,7 @@ class UpgradesTransferCurrencies extends Command // source account must have a currency preference. if (!$this->sourceCurrency instanceof TransactionCurrency) { $message = sprintf('Account #%d ("%s") must have currency preference but has none.', $this->sourceAccount->id, $this->sourceAccount->name); - app('log')->error($message); + Log::error($message); $this->friendlyError($message); return true; @@ -275,7 +276,7 @@ class UpgradesTransferCurrencies extends Command $this->destinationAccount->id, $this->destinationAccount->name ); - app('log')->error($message); + Log::error($message); $this->friendlyError($message); return true; diff --git a/app/Console/Commands/VerifiesAccessToken.php b/app/Console/Commands/VerifiesAccessToken.php index 9b9d3d06c2..b591978e4a 100644 --- a/app/Console/Commands/VerifiesAccessToken.php +++ b/app/Console/Commands/VerifiesAccessToken.php @@ -27,6 +27,7 @@ namespace FireflyIII\Console\Commands; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; +use Illuminate\Support\Facades\Log; /** * Trait VerifiesAccessToken. @@ -76,19 +77,19 @@ trait VerifiesAccessToken $user = $repository->find($userId); if (null === $user) { - app('log')->error(sprintf('verifyAccessToken(): no such user for input "%d"', $userId)); + Log::error(sprintf('verifyAccessToken(): no such user for input "%d"', $userId)); return false; } $accessToken = app('preferences')->getForUser($user, 'access_token'); if (null === $accessToken) { - app('log')->error(sprintf('User #%d has no access token, so cannot access command line options.', $userId)); + Log::error(sprintf('User #%d has no access token, so cannot access command line options.', $userId)); return false; } if ($accessToken->data !== $token) { - app('log')->error(sprintf('Invalid access token for user #%d.', $userId)); - app('log')->error(sprintf('Token given is "%s", expected something else.', $token)); + Log::error(sprintf('Invalid access token for user #%d.', $userId)); + Log::error(sprintf('Token given is "%s", expected something else.', $token)); return false; } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index bccbb2c3e5..071cdb65ca 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -26,6 +26,7 @@ namespace FireflyIII\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; +use Illuminate\Support\Facades\Log; use Override; /** @@ -52,7 +53,7 @@ class Kernel extends ConsoleKernel { $schedule->call( static function (): void { - app('log')->error( + Log::error( 'Firefly III no longer users the Laravel scheduler to do cron jobs! Please read the instructions at https://docs.firefly-iii.org/' ); echo "\n"; diff --git a/app/Events/DestroyedTransactionGroup.php b/app/Events/DestroyedTransactionGroup.php index f6692981f9..80b2dbaf79 100644 --- a/app/Events/DestroyedTransactionGroup.php +++ b/app/Events/DestroyedTransactionGroup.php @@ -26,6 +26,7 @@ namespace FireflyIII\Events; use FireflyIII\Models\TransactionGroup; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; /** * Class DestroyedTransactionGroup. @@ -39,6 +40,6 @@ class DestroyedTransactionGroup extends Event */ public function __construct(public TransactionGroup $transactionGroup) { - app('log')->debug(sprintf('Now in %s', __METHOD__)); + Log::debug(sprintf('Now in %s', __METHOD__)); } } diff --git a/app/Events/Model/PiggyBank/ChangedAmount.php b/app/Events/Model/PiggyBank/ChangedAmount.php index f60e8a5113..ffcae27f76 100644 --- a/app/Events/Model/PiggyBank/ChangedAmount.php +++ b/app/Events/Model/PiggyBank/ChangedAmount.php @@ -29,6 +29,7 @@ use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; /** * Class ChangedAmount @@ -45,7 +46,7 @@ class ChangedAmount extends Event */ public function __construct(PiggyBank $piggyBank, string $amount, public ?TransactionJournal $transactionJournal, public ?TransactionGroup $transactionGroup) { - app('log')->debug(sprintf('Created piggy bank event for piggy bank #%d with amount %s', $piggyBank->id, $amount)); + Log::debug(sprintf('Created piggy bank event for piggy bank #%d with amount %s', $piggyBank->id, $amount)); $this->piggyBank = $piggyBank; $this->amount = $amount; } diff --git a/app/Events/Model/Rule/RuleActionFailedOnArray.php b/app/Events/Model/Rule/RuleActionFailedOnArray.php index fc537cb430..9cb80f7fe2 100644 --- a/app/Events/Model/Rule/RuleActionFailedOnArray.php +++ b/app/Events/Model/Rule/RuleActionFailedOnArray.php @@ -26,6 +26,7 @@ namespace FireflyIII\Events\Model\Rule; use FireflyIII\Models\RuleAction; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; /** * Class RuleActionFailedOnArray @@ -36,6 +37,6 @@ class RuleActionFailedOnArray public function __construct(public RuleAction $ruleAction, public array $journal, public string $error) { - app('log')->debug('Created new RuleActionFailedOnArray'); + Log::debug('Created new RuleActionFailedOnArray'); } } diff --git a/app/Events/Model/Rule/RuleActionFailedOnObject.php b/app/Events/Model/Rule/RuleActionFailedOnObject.php index bde5cacdec..d774160f5b 100644 --- a/app/Events/Model/Rule/RuleActionFailedOnObject.php +++ b/app/Events/Model/Rule/RuleActionFailedOnObject.php @@ -27,6 +27,7 @@ namespace FireflyIII\Events\Model\Rule; use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; /** * Class RuleActionFailedOnObject @@ -37,6 +38,6 @@ class RuleActionFailedOnObject public function __construct(public RuleAction $ruleAction, public TransactionJournal $journal, public string $error) { - app('log')->debug('Created new RuleActionFailedOnObject'); + Log::debug('Created new RuleActionFailedOnObject'); } } diff --git a/app/Events/RequestedReportOnJournals.php b/app/Events/RequestedReportOnJournals.php index 8805776832..27df251eb3 100644 --- a/app/Events/RequestedReportOnJournals.php +++ b/app/Events/RequestedReportOnJournals.php @@ -29,6 +29,7 @@ use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; /** * Class RequestedReportOnJournals @@ -44,7 +45,7 @@ class RequestedReportOnJournals */ public function __construct(public int $userId, public Collection $groups) { - app('log')->debug('In event RequestedReportOnJournals.'); + Log::debug('In event RequestedReportOnJournals.'); } /** diff --git a/app/Events/Test/OwnerTestNotificationChannel.php b/app/Events/Test/OwnerTestNotificationChannel.php index efce1b2a80..759c0578fc 100644 --- a/app/Events/Test/OwnerTestNotificationChannel.php +++ b/app/Events/Test/OwnerTestNotificationChannel.php @@ -26,6 +26,7 @@ namespace FireflyIII\Events\Test; use FireflyIII\Notifications\Notifiables\OwnerNotifiable; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; class OwnerTestNotificationChannel { @@ -38,7 +39,7 @@ class OwnerTestNotificationChannel */ public function __construct(string $channel, public OwnerNotifiable $owner) { - app('log')->debug(sprintf('Triggered OwnerTestNotificationChannel("%s")', $channel)); + Log::debug(sprintf('Triggered OwnerTestNotificationChannel("%s")', $channel)); $this->channel = $channel; } } diff --git a/app/Events/Test/UserTestNotificationChannel.php b/app/Events/Test/UserTestNotificationChannel.php index 4d028459d1..6ee93f0190 100644 --- a/app/Events/Test/UserTestNotificationChannel.php +++ b/app/Events/Test/UserTestNotificationChannel.php @@ -26,6 +26,7 @@ namespace FireflyIII\Events\Test; use FireflyIII\User; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; class UserTestNotificationChannel { @@ -38,7 +39,7 @@ class UserTestNotificationChannel */ public function __construct(string $channel, public User $user) { - app('log')->debug(sprintf('Triggered UserTestNotificationChannel("%s")', $channel)); + Log::debug(sprintf('Triggered UserTestNotificationChannel("%s")', $channel)); $this->channel = $channel; } } diff --git a/app/Exceptions/GracefulNotFoundHandler.php b/app/Exceptions/GracefulNotFoundHandler.php index b2feef6ea6..762da63c55 100644 --- a/app/Exceptions/GracefulNotFoundHandler.php +++ b/app/Exceptions/GracefulNotFoundHandler.php @@ -33,6 +33,7 @@ use FireflyIII\Models\TransactionJournal; use FireflyIII\User; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Log; use Symfony\Component\HttpFoundation\Response; use Override; use Throwable; @@ -65,7 +66,7 @@ class GracefulNotFoundHandler extends ExceptionHandler switch ($name) { default: - app('log')->warning(sprintf('GracefulNotFoundHandler cannot handle route with name "%s"', $name)); + Log::warning(sprintf('GracefulNotFoundHandler cannot handle route with name "%s"', $name)); return parent::render($request, $e); @@ -152,7 +153,7 @@ class GracefulNotFoundHandler extends ExceptionHandler */ private function handleAccount(Request $request, Throwable $exception): Response { - app('log')->debug('404 page is probably a deleted account. Redirect to overview of account types.'); + Log::debug('404 page is probably a deleted account. Redirect to overview of account types.'); /** @var User $user */ $user = auth()->user(); @@ -169,7 +170,7 @@ class GracefulNotFoundHandler extends ExceptionHandler /** @var null|Account $account */ $account = $user->accounts()->withTrashed()->with(['accountType'])->find($accountId); if (null === $account) { - app('log')->error(sprintf('Could not find account %d, so give big fat error.', $accountId)); + Log::error(sprintf('Could not find account %d, so give big fat error.', $accountId)); return parent::render($request, $exception); } @@ -187,7 +188,7 @@ class GracefulNotFoundHandler extends ExceptionHandler */ private function handleGroup(Request $request, Throwable $exception) { - app('log')->debug('404 page is probably a deleted group. Redirect to overview of group types.'); + Log::debug('404 page is probably a deleted group. Redirect to overview of group types.'); /** @var User $user */ $user = auth()->user(); @@ -198,7 +199,7 @@ class GracefulNotFoundHandler extends ExceptionHandler /** @var null|TransactionGroup $group */ $group = $user->transactionGroups()->withTrashed()->find($groupId); if (null === $group) { - app('log')->error(sprintf('Could not find group %d, so give big fat error.', $groupId)); + Log::error(sprintf('Could not find group %d, so give big fat error.', $groupId)); return parent::render($request, $exception); } @@ -206,7 +207,7 @@ class GracefulNotFoundHandler extends ExceptionHandler /** @var null|TransactionJournal $journal */ $journal = $group->transactionJournals()->withTrashed()->first(); if (null === $journal) { - app('log')->error(sprintf('Could not find journal for group %d, so give big fat error.', $groupId)); + Log::error(sprintf('Could not find journal for group %d, so give big fat error.', $groupId)); return parent::render($request, $exception); } @@ -227,7 +228,7 @@ class GracefulNotFoundHandler extends ExceptionHandler */ private function handleAttachment(Request $request, Throwable $exception) { - app('log')->debug('404 page is probably a deleted attachment. Redirect to parent object.'); + Log::debug('404 page is probably a deleted attachment. Redirect to parent object.'); /** @var User $user */ $user = auth()->user(); @@ -238,7 +239,7 @@ class GracefulNotFoundHandler extends ExceptionHandler /** @var null|Attachment $attachment */ $attachment = $user->attachments()->withTrashed()->find($attachmentId); if (null === $attachment) { - app('log')->error(sprintf('Could not find attachment %d, so give big fat error.', $attachmentId)); + Log::error(sprintf('Could not find attachment %d, so give big fat error.', $attachmentId)); return parent::render($request, $exception); } @@ -260,7 +261,7 @@ class GracefulNotFoundHandler extends ExceptionHandler } } - app('log')->error(sprintf('Could not redirect attachment %d, its linked to a %s.', $attachmentId, $attachment->attachable_type)); + Log::error(sprintf('Could not redirect attachment %d, its linked to a %s.', $attachmentId, $attachment->attachable_type)); return parent::render($request, $exception); } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index fbdde03e1c..3bde465581 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -36,6 +36,7 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Session\TokenMismatchException; use Illuminate\Support\Arr; +use Illuminate\Support\Facades\Log; use Illuminate\Validation\ValidationException as LaravelValidationException; use Laravel\Passport\Exceptions\OAuthServerException as LaravelOAuthException; use League\OAuth2\Server\Exception\OAuthServerException; @@ -98,51 +99,51 @@ class Handler extends ExceptionHandler { $expectsJson = $request->expectsJson(); - app('log')->debug('Now in Handler::render()'); + Log::debug('Now in Handler::render()'); if ($e instanceof LaravelValidationException && $expectsJson) { // ignore it: controller will handle it. - app('log')->debug(sprintf('Return to parent to handle LaravelValidationException(%d)', $e->status)); + Log::debug(sprintf('Return to parent to handle LaravelValidationException(%d)', $e->status)); return parent::render($request, $e); } if ($e instanceof NotFoundHttpException && $expectsJson) { // JSON error: - app('log')->debug('Return JSON not found error.'); + Log::debug('Return JSON not found error.'); return response()->json(['message' => 'Resource not found', 'exception' => 'NotFoundHttpException'], 404); } if ($e instanceof AuthorizationException && $expectsJson) { // somehow Laravel handler does not catch this: - app('log')->debug('Return JSON unauthorized error.'); + Log::debug('Return JSON unauthorized error.'); return response()->json(['message' => $e->getMessage(), 'exception' => 'AuthorizationException'], 401); } if ($e instanceof AuthenticationException && $expectsJson) { // somehow Laravel handler does not catch this: - app('log')->debug('Return JSON unauthenticated error.'); + Log::debug('Return JSON unauthenticated error.'); return response()->json(['message' => $e->getMessage(), 'exception' => 'AuthenticationException'], 401); } if ($e instanceof OAuthServerException && $expectsJson) { - app('log')->debug('Return JSON OAuthServerException.'); + Log::debug('Return JSON OAuthServerException.'); // somehow Laravel handler does not catch this: return response()->json(['message' => $e->getMessage(), 'exception' => 'OAuthServerException'], 401); } if ($e instanceof BadRequestHttpException) { - app('log')->debug('Return JSON BadRequestHttpException.'); + Log::debug('Return JSON BadRequestHttpException.'); return response()->json(['message' => $e->getMessage(), 'exception' => 'HttpException'], 400); } if ($e instanceof BadHttpHeaderException) { // is always API exception. - app('log')->debug('Return JSON BadHttpHeaderException.'); + Log::debug('Return JSON BadHttpHeaderException.'); return response()->json(['message' => $e->getMessage(), 'exception' => 'BadHttpHeaderException'], $e->statusCode); } @@ -161,7 +162,7 @@ class Handler extends ExceptionHandler $isDebug = (bool) config('app.debug', false); if ($isDebug) { - app('log')->debug(sprintf('Return JSON %s with debug.', $e::class)); + Log::debug(sprintf('Return JSON %s with debug.', $e::class)); return response()->json( [ @@ -174,7 +175,7 @@ class Handler extends ExceptionHandler $errorCode ); } - app('log')->debug(sprintf('Return JSON %s.', $e::class)); + Log::debug(sprintf('Return JSON %s.', $e::class)); return response()->json( ['message' => sprintf('Internal Firefly III Exception: %s', $e->getMessage()), 'exception' => 'UndisclosedException'], @@ -183,7 +184,7 @@ class Handler extends ExceptionHandler } if ($e instanceof NotFoundHttpException) { - app('log')->debug('Refer to GracefulNotFoundHandler'); + Log::debug('Refer to GracefulNotFoundHandler'); $handler = app(GracefulNotFoundHandler::class); return $handler->render($request, $e); @@ -191,20 +192,20 @@ class Handler extends ExceptionHandler // special view for database errors with extra instructions if ($e instanceof QueryException) { - app('log')->debug('Return Firefly III database exception view.'); + Log::debug('Return Firefly III database exception view.'); $isDebug = config('app.debug'); return response()->view('errors.DatabaseException', ['exception' => $e, 'debug' => $isDebug], 500); } if ($e instanceof FireflyException || $e instanceof ErrorException || $e instanceof OAuthServerException) { - app('log')->debug('Return Firefly III error view.'); + Log::debug('Return Firefly III error view.'); $isDebug = config('app.debug'); return response()->view('errors.FireflyException', ['exception' => $e, 'debug' => $isDebug], 500); } - app('log')->debug(sprintf('Error "%s" has no Firefly III treatment, parent will handle.', $e::class)); + Log::debug(sprintf('Error "%s" has no Firefly III treatment, parent will handle.', $e::class)); return parent::render($request, $e); } diff --git a/app/Factory/AccountFactory.php b/app/Factory/AccountFactory.php index 94e9f5a5d9..3ea9d77a49 100644 --- a/app/Factory/AccountFactory.php +++ b/app/Factory/AccountFactory.php @@ -72,16 +72,18 @@ class AccountFactory */ public function findOrCreate(string $accountName, string $accountType): Account { - app('log')->debug(sprintf('findOrCreate("%s", "%s")', $accountName, $accountType)); + Log::debug(sprintf('findOrCreate("%s", "%s")', $accountName, $accountType)); $type = $this->accountRepository->getAccountTypeByType($accountType); if (!$type instanceof AccountType) { throw new FireflyException(sprintf('Cannot find account type "%s"', $accountType)); } + /** @var Account|null $return */ $return = $this->user->accounts->where('account_type_id', $type->id)->where('name', $accountName)->first(); if (null === $return) { - app('log')->debug('Found nothing. Will create a new one.'); + Log::debug('Found nothing. Will create a new one.'); + /** @var Account $return */ $return = $this->create( [ 'user_id' => $this->user->id, @@ -104,7 +106,7 @@ class AccountFactory */ public function create(array $data): Account { - app('log')->debug('Now in AccountFactory::create()'); + Log::debug('Now in AccountFactory::create()'); $type = $this->getAccountType($data); $data['iban'] = $this->filterIban($data['iban'] ?? null); @@ -146,18 +148,18 @@ class AccountFactory } } if (null === $result) { - app('log')->warning(sprintf('Found NO account type based on %d and "%s"', $accountTypeId, $accountTypeName)); + Log::warning(sprintf('Found NO account type based on %d and "%s"', $accountTypeId, $accountTypeName)); throw new FireflyException(sprintf('AccountFactory::create() was unable to find account type #%d ("%s").', $accountTypeId, $accountTypeName)); } - app('log')->debug(sprintf('Found account type based on %d and "%s": "%s"', $accountTypeId, $accountTypeName, $result->type)); + Log::debug(sprintf('Found account type based on %d and "%s": "%s"', $accountTypeId, $accountTypeName, $result->type)); return $result; } public function find(string $accountName, string $accountType): ?Account { - app('log')->debug(sprintf('Now in AccountFactory::find("%s", "%s")', $accountName, $accountType)); + Log::debug(sprintf('Now in AccountFactory::find("%s", "%s")', $accountName, $accountType)); $type = AccountType::whereType($accountType)->first(); /** @var null|Account */ @@ -204,16 +206,16 @@ class AccountFactory try { $this->storeOpeningBalance($account, $data); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); } // create credit liability data (only liabilities) try { $this->storeCreditLiability($account, $data); } catch (FireflyException $e) { - app('log')->error($e->getMessage()); - app('log')->error($e->getTraceAsString()); + Log::error($e->getMessage()); + Log::error($e->getTraceAsString()); } // create notes @@ -319,22 +321,22 @@ class AccountFactory */ private function storeCreditLiability(Account $account, array $data): void { - app('log')->debug('storeCreditLiability'); + Log::debug('storeCreditLiability'); $account->refresh(); $accountType = $account->accountType->type; $direction = $this->accountRepository->getMetaValue($account, 'liability_direction'); $valid = config('firefly.valid_liabilities'); if (in_array($accountType, $valid, true)) { - app('log')->debug('Is a liability with credit ("i am owed") direction.'); + Log::debug('Is a liability with credit ("i am owed") direction.'); if ($this->validOBData($data)) { - app('log')->debug('Has valid CL data.'); + Log::debug('Has valid CL data.'); $openingBalance = $data['opening_balance']; $openingBalanceDate = $data['opening_balance_date']; // store credit transaction. $this->updateCreditTransaction($account, $direction, $openingBalance, $openingBalanceDate); } if (!$this->validOBData($data)) { - app('log')->debug('Does NOT have valid CL data, deletr any CL transaction.'); + Log::debug('Does NOT have valid CL data, deletr any CL transaction.'); $this->deleteCreditTransaction($account); } } diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index 66f12753c6..f29c7102d1 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Carbon\Carbon; use FireflyIII\Casts\SeparateTimezoneCaster; use FireflyIII\Handlers\Observer\BudgetLimitObserver; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; @@ -33,6 +34,13 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphMany; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +/** + * Class BudgetLimit + * + * @property TransactionCurrency $transactionCurrency + * @property Carbon $start_date + * @property Carbon $end_date + */ #[ObservedBy([BudgetLimitObserver::class])] class BudgetLimit extends Model { @@ -50,10 +58,9 @@ class BudgetLimit extends Model if (auth()->check()) { $budgetLimitId = (int)$value; $budgetLimit = self::where('budget_limits.id', $budgetLimitId) - ->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id') - ->where('budgets.user_id', auth()->user()->id) - ->first(['budget_limits.*']) - ; + ->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id') + ->where('budgets.user_id', auth()->user()->id) + ->first(['budget_limits.*']); if (null !== $budgetLimit) { return $budgetLimit; } @@ -86,14 +93,14 @@ class BudgetLimit extends Model protected function amount(): Attribute { return Attribute::make( - get: static fn ($value) => (string)$value, + get: static fn($value) => (string)$value, ); } protected function budgetId(): Attribute { return Attribute::make( - get: static fn ($value) => (int)$value, + get: static fn($value) => (int)$value, ); } @@ -113,7 +120,7 @@ class BudgetLimit extends Model protected function transactionCurrencyId(): Attribute { return Attribute::make( - get: static fn ($value) => (int)$value, + get: static fn($value) => (int)$value, ); } } diff --git a/app/Models/Recurrence.php b/app/Models/Recurrence.php index b3fa7a3a8c..306be4dde4 100644 --- a/app/Models/Recurrence.php +++ b/app/Models/Recurrence.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Models; +use Carbon\Carbon; use FireflyIII\Casts\SeparateTimezoneCaster; use FireflyIII\Handlers\Observer\RecurrenceObserver; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; @@ -38,6 +39,10 @@ use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +/** + * @property Carbon $first_date + * @property Carbon|null $latest_date + */ #[ObservedBy([RecurrenceObserver::class])] class Recurrence extends Model { diff --git a/app/Models/Rule.php b/app/Models/Rule.php index 7755e00984..d2c235f532 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -35,6 +35,9 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +/** + * @property User $user + */ #[ObservedBy([RuleObserver::class])] class Rule extends Model { diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index 99f6655f63..514d4d222e 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -35,6 +35,9 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +/** + * @property User $user + */ #[ObservedBy([RuleGroupObserver::class])] class RuleGroup extends Model { diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php index 81e7aac2e6..544cdd3830 100644 --- a/app/Models/TransactionGroup.php +++ b/app/Models/TransactionGroup.php @@ -32,8 +32,16 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; +use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; + +/** + * @property User $user + * @property UserGroup $userGroup + * @property Collection $transactionJournals + */ #[ObservedBy([TransactionGroupObserver::class])] class TransactionGroup extends Model { @@ -50,13 +58,13 @@ class TransactionGroup extends Model */ public static function routeBinder(string $value): self { - app('log')->debug(sprintf('Now in %s("%s")', __METHOD__, $value)); + Log::debug(sprintf('Now in %s("%s")', __METHOD__, $value)); if (auth()->check()) { $groupId = (int)$value; /** @var User $user */ $user = auth()->user(); - app('log')->debug(sprintf('User authenticated as %s', $user->email)); + Log::debug(sprintf('User authenticated as %s', $user->email)); /** @var null|TransactionGroup $group */ $group = $user->transactionGroups() @@ -64,12 +72,12 @@ class TransactionGroup extends Model ->where('transaction_groups.id', $groupId)->first(['transaction_groups.*']) ; if (null !== $group) { - app('log')->debug(sprintf('Found group #%d.', $group->id)); + Log::debug(sprintf('Found group #%d.', $group->id)); return $group; } } - app('log')->debug('Found no group.'); + Log::debug('Found no group.'); throw new NotFoundHttpException(); } diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 3aa0099446..72e1cd35cc 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -47,6 +47,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @method EloquentBuilder|static before() * @method EloquentBuilder|static after() * @method static EloquentBuilder|static query() + * @property TransactionGroup $transactionGroup */ #[ObservedBy([TransactionJournalObserver::class])] class TransactionJournal extends Model diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 5c9c61054b..534eff6fe6 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -442,8 +442,6 @@ class Navigation Log::error(sprintf('No date formats for frequency "%s"!', $repeatFrequency)); throw new FireflyException(sprintf('No date formats for frequency "%s"!', $repeatFrequency)); - - return $date->format('Y-m-d'); } /** From 6341743cf91ab9085fb6c5cf738ff045e2ce871d Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 5 Oct 2025 12:57:58 +0200 Subject: [PATCH 20/26] Various code cleanup. --- .../Data/Export/ExportController.php | 44 +++++++++++++++---- .../Models/Account/ListController.php | 3 -- .../Models/Account/ShowController.php | 1 - .../Models/Attachment/ShowController.php | 1 - .../Models/AvailableBudget/ShowController.php | 1 - .../Models/Bill/ListController.php | 3 -- .../Models/Bill/ShowController.php | 1 - .../Models/Budget/ListController.php | 4 -- .../Models/Budget/ShowController.php | 1 - .../Models/BudgetLimit/ListController.php | 1 - .../Models/Category/ListController.php | 2 - .../Models/Category/ShowController.php | 1 - .../Models/ObjectGroup/ListController.php | 2 - .../Models/PiggyBank/ListController.php | 3 -- .../Models/PiggyBank/ShowController.php | 1 - .../Models/Recurrence/ListController.php | 1 - .../Models/Recurrence/ShowController.php | 1 - .../Models/Recurrence/TriggerController.php | 4 +- .../Models/Rule/ShowController.php | 1 - .../Models/RuleGroup/ListController.php | 1 - .../Models/RuleGroup/ShowController.php | 1 - .../Controllers/Models/Tag/ListController.php | 2 - .../Controllers/Models/Tag/ShowController.php | 1 - .../Models/Transaction/ListController.php | 3 -- .../Models/Transaction/ShowController.php | 1 - .../TransactionCurrency/ListController.php | 7 --- .../TransactionCurrency/ShowController.php | 3 -- .../TransactionCurrency/StoreController.php | 1 - .../TransactionCurrency/UpdateController.php | 2 - .../Models/TransactionLink/ShowController.php | 1 - .../TransactionLinkType/ListController.php | 1 - .../TransactionLinkType/ShowController.php | 1 - .../Search/TransactionController.php | 1 - .../V1/Controllers/System/UserController.php | 1 - .../User/PreferencesController.php | 1 - .../Controllers/Webhook/MessageController.php | 1 - .../V1/Controllers/Webhook/ShowController.php | 1 - .../Correction/ConvertsDatesToUTC.php | 1 - .../RemovesOrphanedTransactions.php | 4 +- app/Console/Commands/Export/ExportsData.php | 5 +++ .../System/CallsLaravelPassportKeys.php | 2 +- .../Commands/System/ForcesDecimalSize.php | 5 +-- .../Commands/System/VerifySecurityAlerts.php | 3 ++ .../Upgrade/AddsTransactionIdentifiers.php | 6 +-- .../Upgrade/RemovesDatabaseDecryption.php | 5 +-- .../Upgrade/UpgradesAccountCurrencies.php | 1 - .../Upgrade/UpgradesAccountMetaData.php | 5 +-- .../Commands/Upgrade/UpgradesAttachments.php | 5 +-- .../Commands/Upgrade/UpgradesBillsToRules.php | 6 +-- .../Commands/Upgrade/UpgradesBudgetLimits.php | 5 +-- .../Upgrade/UpgradesCurrencyPreferences.php | 5 +-- .../Commands/Upgrade/UpgradesJournalNotes.php | 5 +-- .../Commands/Upgrade/UpgradesLiabilities.php | 5 +-- .../Upgrade/UpgradesLiabilitiesEight.php | 5 +-- .../Upgrade/UpgradesMultiPiggyBanks.php | 5 +-- .../UpgradesPrimaryCurrencyAmounts.php | 5 +-- .../Upgrade/UpgradesRecurrenceMetaData.php | 5 +-- .../Commands/Upgrade/UpgradesRuleActions.php | 5 +-- .../Commands/Upgrade/UpgradesTagLocations.php | 5 +-- .../Commands/Upgrade/UpgradesToGroups.php | 5 +-- .../Upgrade/UpgradesTransferCurrencies.php | 5 +-- .../UpgradesVariousCurrencyInformation.php | 5 +-- .../Commands/Upgrade/UpgradesWebhooks.php | 5 +-- app/Console/Commands/VerifiesAccessToken.php | 1 - app/Factory/AccountFactory.php | 1 - app/Factory/TransactionJournalFactory.php | 5 ++- app/Handlers/Events/UserEventHandler.php | 3 -- .../Events/VersionCheckEventHandler.php | 10 +++++ app/Helpers/Attachments/AttachmentHelper.php | 8 +++- .../Extensions/AccountCollection.php | 1 - .../Extensions/AttachmentCollection.php | 4 -- app/Helpers/Collector/GroupCollector.php | 5 +++ app/Helpers/Fiscal/FiscalHelper.php | 6 +++ .../Webhook/Sha3SignatureGenerator.php | 2 +- .../Controllers/Account/CreateController.php | 7 ++- .../Controllers/Account/IndexController.php | 18 ++++++-- .../Controllers/Account/ShowController.php | 19 ++++++-- app/Http/Controllers/Admin/HomeController.php | 4 ++ app/Http/Controllers/Admin/UserController.php | 6 +++ app/Http/Controllers/AttachmentController.php | 1 - .../Auth/ForgotPasswordController.php | 8 ++++ app/Http/Controllers/Auth/LoginController.php | 8 +++- .../Controllers/Auth/RegisterController.php | 9 ++++ .../Auth/ResetPasswordController.php | 7 ++- .../Controllers/Auth/TwoFactorController.php | 6 +++ app/Http/Controllers/Bill/IndexController.php | 1 - app/Http/Controllers/Bill/ShowController.php | 7 +++ .../Budget/BudgetLimitController.php | 6 +-- .../Controllers/Budget/IndexController.php | 4 +- .../Controllers/Budget/ShowController.php | 23 ++++++++++ .../Controllers/Category/IndexController.php | 6 +++ .../Category/NoCategoryController.php | 12 +++++ .../Controllers/Category/ShowController.php | 14 ++++++ .../Controllers/Chart/AccountController.php | 9 +++- .../Controllers/Chart/CategoryController.php | 10 ++++- .../Controllers/Chart/PiggyBankController.php | 3 +- .../Controllers/Chart/ReportController.php | 2 +- app/Http/Controllers/DebugController.php | 3 +- app/Http/Controllers/JavascriptController.php | 10 ++++- app/Http/Controllers/Json/BoxController.php | 2 +- app/Http/Controllers/Json/IntroController.php | 2 - app/Http/Controllers/NewUserController.php | 1 - .../ObjectGroup/IndexController.php | 2 +- .../Controllers/PiggyBank/IndexController.php | 1 - .../Controllers/PreferencesController.php | 4 ++ .../Controllers/Profile/MfaController.php | 13 ++++-- app/Http/Controllers/ProfileController.php | 6 ++- .../Controllers/Recurring/IndexController.php | 6 +++ app/Http/Controllers/ReportController.php | 6 +++ app/Http/Controllers/Rule/IndexController.php | 2 +- app/Http/Controllers/TagController.php | 14 ++++++ .../Transaction/CreateController.php | 11 ++++- .../Transaction/EditController.php | 8 ++++ .../Transaction/IndexController.php | 14 ++++++ .../TransactionCurrency/DeleteController.php | 9 ++++ .../TransactionCurrency/EditController.php | 5 +++ .../TransactionCurrency/IndexController.php | 6 +++ app/Http/Middleware/AcceptHeaders.php | 5 +++ app/Http/Requests/ReportFormRequest.php | 5 +++ app/Jobs/DownloadExchangeRates.php | 4 ++ app/Mail/ReportNewJournalsMail.php | 1 + app/Repositories/Account/AccountTasker.php | 2 - .../Budget/AvailableBudgetRepository.php | 1 + app/Repositories/Budget/BudgetRepository.php | 15 ++----- .../Budget/NoBudgetRepository.php | 1 + .../Category/CategoryRepository.php | 15 ++----- .../Currency/CurrencyRepository.php | 7 ++- .../Journal/JournalCLIRepository.php | 5 +-- .../Recurring/RecurringRepository.php | 1 - .../TransactionGroupRepository.php | 5 +-- app/Repositories/User/UserRepository.php | 6 +-- .../UserGroup/UserGroupRepository.php | 3 -- app/Rules/Account/IsValidAccountType.php | 1 - .../Internal/Support/AccountServiceTrait.php | 7 +-- .../Internal/Support/BillServiceTrait.php | 4 +- .../Internal/Support/JournalServiceTrait.php | 7 +++ .../Support/RecurringTransactionTrait.php | 4 +- .../Internal/Update/AccountUpdateService.php | 1 - .../Internal/Update/BillUpdateService.php | 1 - .../Internal/Update/CategoryUpdateService.php | 4 +- app/Support/Binder/CLIToken.php | 1 - .../Category/WholePeriodChartGenerator.php | 4 +- app/Support/Export/ExportDataGenerator.php | 10 +++++ app/Support/Form/CurrencyForm.php | 2 - .../Http/Api/ExchangeRateConverter.php | 2 +- app/Support/Http/Controllers/AugumentData.php | 2 +- .../Http/Controllers/GetConfigurationData.php | 2 +- .../Enrichments/AvailableBudgetEnrichment.php | 4 +- .../JsonApi/Enrichments/BudgetEnrichment.php | 4 +- .../Enrichments/BudgetLimitEnrichment.php | 6 +-- .../Enrichments/CategoryEnrichment.php | 6 +-- .../Enrichments/PiggyBankEnrichment.php | 4 +- .../Enrichments/RecurringEnrichment.php | 4 +- app/Support/Models/BillDateCalculator.php | 2 +- .../RecalculatesAvailableBudgetsTrait.php | 2 +- app/Support/ParseDateString.php | 6 ++- app/Support/Preferences.php | 1 - .../Report/Budget/BudgetReportGenerator.php | 1 - .../Recurring/CalculateXOccurrencesSince.php | 2 +- app/Support/Search/OperatorQuerySearch.php | 1 - .../Search/QueryParser/GdbotsQueryParser.php | 5 +++ app/Support/Steam.php | 6 ++- app/Support/System/OAuthKeys.php | 5 +++ .../PiggyBankEventTransformer.php | 2 +- app/Transformers/PiggyBankTransformer.php | 1 - app/Transformers/RecurrenceTransformer.php | 1 - app/Transformers/UserTransformer.php | 1 - app/User.php | 1 - app/Validation/FireflyValidator.php | 9 +++- 169 files changed, 482 insertions(+), 305 deletions(-) diff --git a/app/Api/V1/Controllers/Data/Export/ExportController.php b/app/Api/V1/Controllers/Data/Export/ExportController.php index f65e23dfc0..f578b7b050 100644 --- a/app/Api/V1/Controllers/Data/Export/ExportController.php +++ b/app/Api/V1/Controllers/Data/Export/ExportController.php @@ -61,8 +61,11 @@ class ExportController extends Controller } /** - * @throws FireflyException + * @param ExportRequest $request * + * @return LaravelResponse + * @throws DatetimeException + * @throws FireflyException * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function accounts(ExportRequest $request): LaravelResponse @@ -100,8 +103,11 @@ class ExportController extends Controller } /** - * @throws FireflyException + * @param ExportRequest $request * + * @return LaravelResponse + * @throws DatetimeException + * @throws FireflyException * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function bills(ExportRequest $request): LaravelResponse @@ -112,8 +118,11 @@ class ExportController extends Controller } /** - * @throws FireflyException + * @param ExportRequest $request * + * @return LaravelResponse + * @throws DatetimeException + * @throws FireflyException * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function budgets(ExportRequest $request): LaravelResponse @@ -124,8 +133,11 @@ class ExportController extends Controller } /** - * @throws FireflyException + * @param ExportRequest $request * + * @return LaravelResponse + * @throws DatetimeException + * @throws FireflyException * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function categories(ExportRequest $request): LaravelResponse @@ -136,8 +148,11 @@ class ExportController extends Controller } /** - * @throws FireflyException + * @param ExportRequest $request * + * @return LaravelResponse + * @throws DatetimeException + * @throws FireflyException * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function piggyBanks(ExportRequest $request): LaravelResponse @@ -148,8 +163,11 @@ class ExportController extends Controller } /** - * @throws FireflyException + * @param ExportRequest $request * + * @return LaravelResponse + * @throws DatetimeException + * @throws FireflyException * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function recurring(ExportRequest $request): LaravelResponse @@ -160,8 +178,11 @@ class ExportController extends Controller } /** - * @throws FireflyException + * @param ExportRequest $request * + * @return LaravelResponse + * @throws DatetimeException + * @throws FireflyException * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function rules(ExportRequest $request): LaravelResponse @@ -172,8 +193,11 @@ class ExportController extends Controller } /** - * @throws FireflyException + * @param ExportRequest $request * + * @return LaravelResponse + * @throws DatetimeException + * @throws FireflyException * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function tags(ExportRequest $request): LaravelResponse @@ -184,6 +208,10 @@ class ExportController extends Controller } /** + * @param ExportRequest $request + * + * @return LaravelResponse + * @throws DatetimeException * @throws FireflyException */ public function transactions(ExportRequest $request): LaravelResponse diff --git a/app/Api/V1/Controllers/Models/Account/ListController.php b/app/Api/V1/Controllers/Models/Account/ListController.php index eacc1824f1..1d646a0388 100644 --- a/app/Api/V1/Controllers/Models/Account/ListController.php +++ b/app/Api/V1/Controllers/Models/Account/ListController.php @@ -71,7 +71,6 @@ class ListController extends Controller } /** - * @throws FireflyException */ public function attachments(Account $account): JsonResponse { @@ -97,7 +96,6 @@ class ListController extends Controller } /** - * @throws FireflyException */ public function piggyBanks(Account $account): JsonResponse { @@ -136,7 +134,6 @@ class ListController extends Controller /** * Show all transaction groups related to the account. * - * @throws FireflyException */ public function transactions(Request $request, Account $account): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Account/ShowController.php b/app/Api/V1/Controllers/Models/Account/ShowController.php index d2d02ac82a..5ef0363961 100644 --- a/app/Api/V1/Controllers/Models/Account/ShowController.php +++ b/app/Api/V1/Controllers/Models/Account/ShowController.php @@ -69,7 +69,6 @@ class ShowController extends Controller /** * Display a listing of the resource. * - * @throws FireflyException */ public function index(ShowRequest $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Attachment/ShowController.php b/app/Api/V1/Controllers/Models/Attachment/ShowController.php index bb8e267a11..3785d30b35 100644 --- a/app/Api/V1/Controllers/Models/Attachment/ShowController.php +++ b/app/Api/V1/Controllers/Models/Attachment/ShowController.php @@ -120,7 +120,6 @@ class ShowController extends Controller * * Display a listing of the resource. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php b/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php index 1fa1ed692d..c9693643eb 100644 --- a/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php +++ b/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php @@ -68,7 +68,6 @@ class ShowController extends Controller * * Display a listing of the resource. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Bill/ListController.php b/app/Api/V1/Controllers/Models/Bill/ListController.php index e0e21e01cc..24f27edb1e 100644 --- a/app/Api/V1/Controllers/Models/Bill/ListController.php +++ b/app/Api/V1/Controllers/Models/Bill/ListController.php @@ -72,7 +72,6 @@ class ListController extends Controller * * Display a listing of the resource. * - * @throws FireflyException */ public function attachments(Bill $bill): JsonResponse { @@ -103,7 +102,6 @@ class ListController extends Controller * * List all of them. * - * @throws FireflyException */ public function rules(Bill $bill): JsonResponse { @@ -136,7 +134,6 @@ class ListController extends Controller * * Show all transactions. * - * @throws FireflyException */ public function transactions(Request $request, Bill $bill): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Bill/ShowController.php b/app/Api/V1/Controllers/Models/Bill/ShowController.php index 6c767f16a6..380d86ef76 100644 --- a/app/Api/V1/Controllers/Models/Bill/ShowController.php +++ b/app/Api/V1/Controllers/Models/Bill/ShowController.php @@ -66,7 +66,6 @@ class ShowController extends Controller * * Display a listing of the resource. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Budget/ListController.php b/app/Api/V1/Controllers/Models/Budget/ListController.php index 036fa6d4ec..72a9cae8fb 100644 --- a/app/Api/V1/Controllers/Models/Budget/ListController.php +++ b/app/Api/V1/Controllers/Models/Budget/ListController.php @@ -74,7 +74,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listAttachmentByBudget * - * @throws FireflyException */ public function attachments(Budget $budget): JsonResponse { @@ -105,7 +104,6 @@ class ListController extends Controller * * Display a listing of the resource. * - * @throws FireflyException */ public function budgetLimits(Budget $budget): JsonResponse { @@ -141,7 +139,6 @@ class ListController extends Controller * * Show all transactions. * - * @throws FireflyException */ public function transactions(Request $request, Budget $budget): JsonResponse { @@ -203,7 +200,6 @@ class ListController extends Controller * * Show all transactions. * - * @throws FireflyException */ public function withoutBudget(Request $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Budget/ShowController.php b/app/Api/V1/Controllers/Models/Budget/ShowController.php index e5062863b1..8d9314b85f 100644 --- a/app/Api/V1/Controllers/Models/Budget/ShowController.php +++ b/app/Api/V1/Controllers/Models/Budget/ShowController.php @@ -70,7 +70,6 @@ class ShowController extends Controller * * Display a listing of the resource. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php b/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php index ee987eae8a..0b66da5487 100644 --- a/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php +++ b/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php @@ -50,7 +50,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionByBudgetLimit * Show all transactions. * - * @throws FireflyException */ public function transactions(Request $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Category/ListController.php b/app/Api/V1/Controllers/Models/Category/ListController.php index 04af2f2c6c..b89fc38bae 100644 --- a/app/Api/V1/Controllers/Models/Category/ListController.php +++ b/app/Api/V1/Controllers/Models/Category/ListController.php @@ -69,7 +69,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listAttachmentByCategory * - * @throws FireflyException */ public function attachments(Category $category): JsonResponse { @@ -100,7 +99,6 @@ class ListController extends Controller * * Show all transactions. * - * @throws FireflyException */ public function transactions(Request $request, Category $category): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Category/ShowController.php b/app/Api/V1/Controllers/Models/Category/ShowController.php index 9022eed9f9..0d19bb5b77 100644 --- a/app/Api/V1/Controllers/Models/Category/ShowController.php +++ b/app/Api/V1/Controllers/Models/Category/ShowController.php @@ -66,7 +66,6 @@ class ShowController extends Controller * * Display a listing of the resource. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php b/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php index 78dab17658..81fcc0679a 100644 --- a/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php +++ b/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php @@ -69,7 +69,6 @@ class ListController extends Controller * * List all bills in this object group * - * @throws FireflyException */ public function bills(ObjectGroup $objectGroup): JsonResponse { @@ -110,7 +109,6 @@ class ListController extends Controller * * List all piggies under the object group. * - * @throws FireflyException */ public function piggyBanks(ObjectGroup $objectGroup): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/PiggyBank/ListController.php b/app/Api/V1/Controllers/Models/PiggyBank/ListController.php index 558255ceb4..5d4181a425 100644 --- a/app/Api/V1/Controllers/Models/PiggyBank/ListController.php +++ b/app/Api/V1/Controllers/Models/PiggyBank/ListController.php @@ -68,7 +68,6 @@ class ListController extends Controller * * List single resource. * - * @throws FireflyException */ public function accounts(PiggyBank $piggyBank): JsonResponse { @@ -106,7 +105,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAttachmentByPiggyBank * - * @throws FireflyException */ public function attachments(PiggyBank $piggyBank): JsonResponse { @@ -137,7 +135,6 @@ class ListController extends Controller * * List single resource. * - * @throws FireflyException */ public function piggyBankEvents(PiggyBank $piggyBank): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php b/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php index c81d49bea5..570947db73 100644 --- a/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php +++ b/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php @@ -66,7 +66,6 @@ class ShowController extends Controller * * List all of them. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Recurrence/ListController.php b/app/Api/V1/Controllers/Models/Recurrence/ListController.php index 867dc46e33..deb46548a3 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/ListController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/ListController.php @@ -69,7 +69,6 @@ class ListController extends Controller * * Show transactions for this recurrence. * - * @throws FireflyException */ public function transactions(Request $request, Recurrence $recurrence): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Recurrence/ShowController.php b/app/Api/V1/Controllers/Models/Recurrence/ShowController.php index 74f29cface..1be11a85f8 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/ShowController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/ShowController.php @@ -66,7 +66,6 @@ class ShowController extends Controller * * List all of them. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php b/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php index b00aa9767b..e9662efaf1 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php @@ -87,9 +87,7 @@ class TriggerController extends Controller // enrich groups and return them: - if (0 === $groups->count()) { - $paginator = new LengthAwarePaginator(new Collection(), 0, 1); - } + $paginator = new LengthAwarePaginator(new Collection(), 0, 1); if ($groups->count() > 0) { /** @var User $admin */ $admin = auth()->user(); diff --git a/app/Api/V1/Controllers/Models/Rule/ShowController.php b/app/Api/V1/Controllers/Models/Rule/ShowController.php index d6ad0db7a5..e659f2e8c4 100644 --- a/app/Api/V1/Controllers/Models/Rule/ShowController.php +++ b/app/Api/V1/Controllers/Models/Rule/ShowController.php @@ -68,7 +68,6 @@ class ShowController extends Controller * * List all of them. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/RuleGroup/ListController.php b/app/Api/V1/Controllers/Models/RuleGroup/ListController.php index af419528a1..6c7b614c03 100644 --- a/app/Api/V1/Controllers/Models/RuleGroup/ListController.php +++ b/app/Api/V1/Controllers/Models/RuleGroup/ListController.php @@ -65,7 +65,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rule_groups/listRuleByGroup * - * @throws FireflyException */ public function rules(RuleGroup $group): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php b/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php index a906227340..2cf7833853 100644 --- a/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php +++ b/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php @@ -67,7 +67,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rule_groups/listRuleGroup * List all of them. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Tag/ListController.php b/app/Api/V1/Controllers/Models/Tag/ListController.php index 1fc4629b05..a29b3a016b 100644 --- a/app/Api/V1/Controllers/Models/Tag/ListController.php +++ b/app/Api/V1/Controllers/Models/Tag/ListController.php @@ -72,7 +72,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/tags/listAttachmentByTag * - * @throws FireflyException */ public function attachments(Tag $tag): JsonResponse { @@ -103,7 +102,6 @@ class ListController extends Controller * * Show all transactions. * - * @throws FireflyException */ public function transactions(Request $request, Tag $tag): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Tag/ShowController.php b/app/Api/V1/Controllers/Models/Tag/ShowController.php index 5e59c4bf11..b9daf868dc 100644 --- a/app/Api/V1/Controllers/Models/Tag/ShowController.php +++ b/app/Api/V1/Controllers/Models/Tag/ShowController.php @@ -68,7 +68,6 @@ class ShowController extends Controller * * List all of them. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Transaction/ListController.php b/app/Api/V1/Controllers/Models/Transaction/ListController.php index 560324e7ff..a7e0649017 100644 --- a/app/Api/V1/Controllers/Models/Transaction/ListController.php +++ b/app/Api/V1/Controllers/Models/Transaction/ListController.php @@ -70,7 +70,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listAttachmentByTransaction * - * @throws FireflyException */ public function attachments(TransactionGroup $transactionGroup): JsonResponse { @@ -102,7 +101,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listEventByTransaction * - * @throws FireflyException */ public function piggyBankEvents(TransactionGroup $transactionGroup): JsonResponse { @@ -145,7 +143,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listLinksByJournal * - * @throws FireflyException */ public function transactionLinks(TransactionJournal $transactionJournal): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Transaction/ShowController.php b/app/Api/V1/Controllers/Models/Transaction/ShowController.php index b20fab792d..f16b37b81a 100644 --- a/app/Api/V1/Controllers/Models/Transaction/ShowController.php +++ b/app/Api/V1/Controllers/Models/Transaction/ShowController.php @@ -53,7 +53,6 @@ class ShowController extends Controller * * Show all transactions. * - * @throws FireflyException */ public function index(Request $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php index 67a6486487..cd8363c8fe 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php @@ -72,7 +72,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listAccountByCurrency * Display a list of accounts. * - * @throws FireflyException */ public function accounts(Request $request, TransactionCurrency $currency): JsonResponse { @@ -130,7 +129,6 @@ class ListController extends Controller * * Display a listing of the resource. * - * @throws FireflyException */ public function availableBudgets(TransactionCurrency $currency): JsonResponse { @@ -165,7 +163,6 @@ class ListController extends Controller * * List all bills * - * @throws FireflyException */ public function bills(TransactionCurrency $currency): JsonResponse { @@ -212,7 +209,6 @@ class ListController extends Controller * * List all budget limits * - * @throws FireflyException */ public function budgetLimits(TransactionCurrency $currency): JsonResponse { @@ -250,7 +246,6 @@ class ListController extends Controller * * List all recurring transactions. * - * @throws FireflyException */ public function recurrences(TransactionCurrency $currency): JsonResponse { @@ -303,7 +298,6 @@ class ListController extends Controller * * List all of them. * - * @throws FireflyException */ public function rules(TransactionCurrency $currency): JsonResponse { @@ -348,7 +342,6 @@ class ListController extends Controller * * Show all transactions. * - * @throws FireflyException */ public function transactions(Request $request, TransactionCurrency $currency): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php index 481896505c..9fd407ccf4 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php @@ -70,7 +70,6 @@ class ShowController extends Controller * * Display a listing of the resource. * - * @throws FireflyException */ public function index(): JsonResponse { @@ -100,7 +99,6 @@ class ShowController extends Controller * * Show a currency. * - * @throws FireflyException */ public function show(TransactionCurrency $currency): JsonResponse { @@ -124,7 +122,6 @@ class ShowController extends Controller /** * Show a currency. * - * @throws FireflyException */ public function showPrimary(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php index 5e4364043f..01aad04665 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php @@ -67,7 +67,6 @@ class StoreController extends Controller * * Store new currency. * - * @throws FireflyException */ public function store(StoreRequest $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php index f9a45ffdee..eca115a7d8 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php @@ -99,7 +99,6 @@ class UpdateController extends Controller } /** - * @throws FireflyException */ public function makePrimary(TransactionCurrency $currency): JsonResponse { @@ -128,7 +127,6 @@ class UpdateController extends Controller * * Enable a currency. * - * @throws FireflyException */ public function enable(TransactionCurrency $currency): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php b/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php index f5874f90ae..1f812f2b18 100644 --- a/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php @@ -70,7 +70,6 @@ class ShowController extends Controller * * List all transaction links there are. * - * @throws FireflyException */ public function index(Request $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php index 0cbaae2bea..6ba4e25c4c 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php @@ -69,7 +69,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listTransactionByLinkType * - * @throws FireflyException */ public function transactions(Request $request, LinkType $linkType): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php index 9fa5e2e497..ded5d53f8f 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php @@ -68,7 +68,6 @@ class ShowController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listLinkType * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Search/TransactionController.php b/app/Api/V1/Controllers/Search/TransactionController.php index a68f44d8a6..10d754891a 100644 --- a/app/Api/V1/Controllers/Search/TransactionController.php +++ b/app/Api/V1/Controllers/Search/TransactionController.php @@ -43,7 +43,6 @@ class TransactionController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/search/searchTransactions * - * @throws FireflyException */ public function search(Request $request, SearchInterface $searcher): JsonResponse { diff --git a/app/Api/V1/Controllers/System/UserController.php b/app/Api/V1/Controllers/System/UserController.php index 0928c041a9..edffb84c44 100644 --- a/app/Api/V1/Controllers/System/UserController.php +++ b/app/Api/V1/Controllers/System/UserController.php @@ -91,7 +91,6 @@ class UserController extends Controller * * Display a listing of the resource. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/User/PreferencesController.php b/app/Api/V1/Controllers/User/PreferencesController.php index d2040588e3..552d10c8e0 100644 --- a/app/Api/V1/Controllers/User/PreferencesController.php +++ b/app/Api/V1/Controllers/User/PreferencesController.php @@ -50,7 +50,6 @@ class PreferencesController extends Controller * * List all of them. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Webhook/MessageController.php b/app/Api/V1/Controllers/Webhook/MessageController.php index 6e14814f6f..a5426ca91d 100644 --- a/app/Api/V1/Controllers/Webhook/MessageController.php +++ b/app/Api/V1/Controllers/Webhook/MessageController.php @@ -63,7 +63,6 @@ class MessageController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/webhooks/getWebhookMessages * - * @throws FireflyException */ public function index(Webhook $webhook): JsonResponse { diff --git a/app/Api/V1/Controllers/Webhook/ShowController.php b/app/Api/V1/Controllers/Webhook/ShowController.php index 03249281c3..b4728e2dee 100644 --- a/app/Api/V1/Controllers/Webhook/ShowController.php +++ b/app/Api/V1/Controllers/Webhook/ShowController.php @@ -71,7 +71,6 @@ class ShowController extends Controller * * Display a listing of the webhooks of the user. * - * @throws FireflyException */ public function index(): JsonResponse { diff --git a/app/Console/Commands/Correction/ConvertsDatesToUTC.php b/app/Console/Commands/Correction/ConvertsDatesToUTC.php index 63457c65f3..657d8a0a83 100644 --- a/app/Console/Commands/Correction/ConvertsDatesToUTC.php +++ b/app/Console/Commands/Correction/ConvertsDatesToUTC.php @@ -92,7 +92,6 @@ class ConvertsDatesToUTC extends Command $this->friendlyInfo(sprintf('Converting field "%s" of model "%s" to UTC.', $field, $shortModel)); $items->each( function ($item) use ($field, $timezoneField): void { - /** @var Carbon $date */ $date = Carbon::parse($item->{$field}, $item->{$timezoneField}); // @phpstan-ignore-line $date->setTimezone('UTC'); $item->{$field} = $date->format('Y-m-d H:i:s'); // @phpstan-ignore-line diff --git a/app/Console/Commands/Correction/RemovesOrphanedTransactions.php b/app/Console/Commands/Correction/RemovesOrphanedTransactions.php index f44ee5fb0d..86eadad492 100644 --- a/app/Console/Commands/Correction/RemovesOrphanedTransactions.php +++ b/app/Console/Commands/Correction/RemovesOrphanedTransactions.php @@ -135,9 +135,7 @@ class RemovesOrphanedTransactions extends Command // delete journals /** @var null|TransactionJournal $journal */ $journal = TransactionJournal::find($transaction->transaction_journal_id); - if (null !== $journal) { - $journal->delete(); - } + $journal?->delete(); Transaction::where('transaction_journal_id', $transaction->transaction_journal_id)->delete(); $this->friendlyWarning( sprintf( diff --git a/app/Console/Commands/Export/ExportsData.php b/app/Console/Commands/Export/ExportsData.php index cce69d8e45..18b1df5a34 100644 --- a/app/Console/Commands/Export/ExportsData.php +++ b/app/Console/Commands/Export/ExportsData.php @@ -40,6 +40,7 @@ use Exception; use Illuminate\Support\Facades\Log; use InvalidArgumentException; +use Safe\Exceptions\FilesystemException; use function Safe\file_put_contents; class ExportsData extends Command @@ -275,7 +276,11 @@ class ExportsData extends Command } /** + * @param array $options + * @param array $data + * * @throws FireflyException + * @throws FilesystemException */ private function exportData(array $options, array $data): void { diff --git a/app/Console/Commands/System/CallsLaravelPassportKeys.php b/app/Console/Commands/System/CallsLaravelPassportKeys.php index 22e1ebddd3..2d48051fe2 100644 --- a/app/Console/Commands/System/CallsLaravelPassportKeys.php +++ b/app/Console/Commands/System/CallsLaravelPassportKeys.php @@ -42,7 +42,7 @@ class CallsLaravelPassportKeys extends Command */ public function handle(): int { - Artisan::call('passport:keys --no-interaction', []); + Artisan::call('passport:keys --no-interaction'); $result = Artisan::output(); if (str_contains($result, 'Encryption keys already exist')) { $this->friendlyInfo('Encryption keys exist already.'); diff --git a/app/Console/Commands/System/ForcesDecimalSize.php b/app/Console/Commands/System/ForcesDecimalSize.php index b96ace66da..4f1ec2164e 100644 --- a/app/Console/Commands/System/ForcesDecimalSize.php +++ b/app/Console/Commands/System/ForcesDecimalSize.php @@ -156,7 +156,6 @@ class ForcesDecimalSize extends Command */ private function correctAmountsByCurrency(): void { - /** @var Collection $enabled */ $enabled = TransactionCurrency::whereEnabled(1)->get(); /** @var TransactionCurrency $currency */ @@ -301,7 +300,7 @@ class ForcesDecimalSize extends Command } ); - $result = $query->get(['*']); + $result = $query->get(); if (0 === $result->count()) { $this->friendlyPositive(sprintf('All %s in %s are OK', $table, $currency->code)); @@ -533,7 +532,7 @@ class ForcesDecimalSize extends Command DB::raw(sprintf($this->regularExpression, $currency->decimal_places)) ); - $result = $query->get(['*']); + $result = $query->get(); if (0 === $result->count()) { $this->friendlyPositive(sprintf('All transactions in foreign currency %s are OK', $currency->code)); diff --git a/app/Console/Commands/System/VerifySecurityAlerts.php b/app/Console/Commands/System/VerifySecurityAlerts.php index 75b7f85b10..ee739ef9a3 100644 --- a/app/Console/Commands/System/VerifySecurityAlerts.php +++ b/app/Console/Commands/System/VerifySecurityAlerts.php @@ -31,6 +31,7 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use League\Flysystem\FilesystemException; +use Safe\Exceptions\JsonException; use function Safe\json_decode; class VerifySecurityAlerts extends Command @@ -44,7 +45,9 @@ class VerifySecurityAlerts extends Command /** * Execute the console command. * + * @return int * @throws FilesystemException + * @throws JsonException */ public function handle(): int { diff --git a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php index ebcc347d0a..4ffa9a2981 100644 --- a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php +++ b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php @@ -54,7 +54,6 @@ class AddsTransactionIdentifiers extends Command * When either of these are the same amount, FF3 can't keep them apart: +3/-3, +3/-3, +3/-3. This happens more * often than you would think. So each set gets a number (1,2,3) to keep them apart. * - * @throws FireflyException */ public function handle(): int { @@ -101,11 +100,8 @@ class AddsTransactionIdentifiers extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } /** diff --git a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php index 57463c5d8d..22b335f8d2 100644 --- a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php +++ b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php @@ -99,11 +99,8 @@ class RemovesDatabaseDecryption extends Command } catch (FireflyException $e) { Log::error($e->getMessage()); } - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function decryptField(string $table, string $field): void diff --git a/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php b/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php index eef26f8608..c67aae9280 100644 --- a/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php +++ b/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php @@ -100,7 +100,6 @@ class UpgradesAccountCurrencies extends Command } /** - * @throws FireflyException */ private function updateCurrenciesForUser(User $user): void { diff --git a/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php b/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php index d181e41e22..7e8f6168cc 100644 --- a/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php +++ b/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php @@ -83,11 +83,8 @@ class UpgradesAccountMetaData extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function markAsExecuted(): void diff --git a/app/Console/Commands/Upgrade/UpgradesAttachments.php b/app/Console/Commands/Upgrade/UpgradesAttachments.php index 06f8175e08..b9cfea1ed6 100644 --- a/app/Console/Commands/Upgrade/UpgradesAttachments.php +++ b/app/Console/Commands/Upgrade/UpgradesAttachments.php @@ -93,11 +93,8 @@ class UpgradesAttachments extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function markAsExecuted(): void diff --git a/app/Console/Commands/Upgrade/UpgradesBillsToRules.php b/app/Console/Commands/Upgrade/UpgradesBillsToRules.php index b146f11e8b..62d43c1889 100644 --- a/app/Console/Commands/Upgrade/UpgradesBillsToRules.php +++ b/app/Console/Commands/Upgrade/UpgradesBillsToRules.php @@ -99,17 +99,13 @@ class UpgradesBillsToRules extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } /** * Migrate bills to new rule structure for a specific user. * - * @throws FireflyException */ private function migrateUser(User $user): void { diff --git a/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php b/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php index 473247de6f..6430407ea4 100644 --- a/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php +++ b/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php @@ -85,11 +85,8 @@ class UpgradesBudgetLimits extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function markAsExecuted(): void diff --git a/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php b/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php index 6e2527c8f4..ddecd04fef 100644 --- a/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php +++ b/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php @@ -66,11 +66,8 @@ class UpgradesCurrencyPreferences extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool)$configVar->data; - } + return (bool)$configVar?->data; - return false; } private function runUpgrade(): void diff --git a/app/Console/Commands/Upgrade/UpgradesJournalNotes.php b/app/Console/Commands/Upgrade/UpgradesJournalNotes.php index 5a3390e3d6..6ae07abb09 100644 --- a/app/Console/Commands/Upgrade/UpgradesJournalNotes.php +++ b/app/Console/Commands/Upgrade/UpgradesJournalNotes.php @@ -87,11 +87,8 @@ class UpgradesJournalNotes extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function markAsExecuted(): void diff --git a/app/Console/Commands/Upgrade/UpgradesLiabilities.php b/app/Console/Commands/Upgrade/UpgradesLiabilities.php index 4a4074b1fb..aaf5f7b221 100644 --- a/app/Console/Commands/Upgrade/UpgradesLiabilities.php +++ b/app/Console/Commands/Upgrade/UpgradesLiabilities.php @@ -62,11 +62,8 @@ class UpgradesLiabilities extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function upgradeLiabilities(): void diff --git a/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php b/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php index 072c48ca08..571fb94ec8 100644 --- a/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php +++ b/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php @@ -64,11 +64,8 @@ class UpgradesLiabilitiesEight extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function upgradeLiabilities(): void diff --git a/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php b/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php index d155510181..ecceb1a085 100644 --- a/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php +++ b/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php @@ -65,11 +65,8 @@ class UpgradesMultiPiggyBanks extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function upgradePiggyBanks(): void diff --git a/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php b/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php index 9cb26669ee..c233272cba 100644 --- a/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php +++ b/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php @@ -61,11 +61,8 @@ class UpgradesPrimaryCurrencyAmounts extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function markAsExecuted(): void diff --git a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php index d40f566a4c..82dcb3d160 100644 --- a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php +++ b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php @@ -66,11 +66,8 @@ class UpgradesRecurrenceMetaData extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function migrateMetaData(): int diff --git a/app/Console/Commands/Upgrade/UpgradesRuleActions.php b/app/Console/Commands/Upgrade/UpgradesRuleActions.php index c3619be8f9..7baeb2cbe2 100644 --- a/app/Console/Commands/Upgrade/UpgradesRuleActions.php +++ b/app/Console/Commands/Upgrade/UpgradesRuleActions.php @@ -64,11 +64,8 @@ class UpgradesRuleActions extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function replaceEqualSign(): void diff --git a/app/Console/Commands/Upgrade/UpgradesTagLocations.php b/app/Console/Commands/Upgrade/UpgradesTagLocations.php index a6fe336a49..cd60c5b825 100644 --- a/app/Console/Commands/Upgrade/UpgradesTagLocations.php +++ b/app/Console/Commands/Upgrade/UpgradesTagLocations.php @@ -58,11 +58,8 @@ class UpgradesTagLocations extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } private function migrateTagLocations(): void diff --git a/app/Console/Commands/Upgrade/UpgradesToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php index 3ceee64711..875df04cc4 100644 --- a/app/Console/Commands/Upgrade/UpgradesToGroups.php +++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php @@ -98,11 +98,8 @@ class UpgradesToGroups extends Command private function isMigrated(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } /** diff --git a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php index fee9fde03d..1aced94507 100644 --- a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php +++ b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php @@ -106,11 +106,8 @@ class UpgradesTransferCurrencies extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } /** diff --git a/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php b/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php index 648b34ed5e..49c4e0cf28 100644 --- a/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php +++ b/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php @@ -87,11 +87,8 @@ class UpgradesVariousCurrencyInformation extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool) $configVar->data; - } + return (bool)$configVar?->data; - return false; } /** diff --git a/app/Console/Commands/Upgrade/UpgradesWebhooks.php b/app/Console/Commands/Upgrade/UpgradesWebhooks.php index 46e39e11e7..6dd824473a 100644 --- a/app/Console/Commands/Upgrade/UpgradesWebhooks.php +++ b/app/Console/Commands/Upgrade/UpgradesWebhooks.php @@ -64,11 +64,8 @@ class UpgradesWebhooks extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); - if (null !== $configVar) { - return (bool)$configVar->data; - } + return (bool)$configVar?->data; - return false; } private function upgradeWebhooks(): void diff --git a/app/Console/Commands/VerifiesAccessToken.php b/app/Console/Commands/VerifiesAccessToken.php index b591978e4a..2dcb004d35 100644 --- a/app/Console/Commands/VerifiesAccessToken.php +++ b/app/Console/Commands/VerifiesAccessToken.php @@ -65,7 +65,6 @@ trait VerifiesAccessToken /** * Returns false when given token does not match given user token. * - * @throws FireflyException */ protected function verifyAccessToken(): bool { diff --git a/app/Factory/AccountFactory.php b/app/Factory/AccountFactory.php index 3ea9d77a49..ce47fd2e35 100644 --- a/app/Factory/AccountFactory.php +++ b/app/Factory/AccountFactory.php @@ -83,7 +83,6 @@ class AccountFactory if (null === $return) { Log::debug('Found nothing. Will create a new one.'); - /** @var Account $return */ $return = $this->create( [ 'user_id' => $this->user->id, diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index dd2d9e6830..1c7f354c34 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -343,7 +343,11 @@ class TransactionJournalFactory /** * If this transaction already exists, throw an error. * + * @param string $hash + * * @throws DuplicateTransactionException + * @throws JsonException + * @throws \Safe\Exceptions\JsonException */ private function errorIfDuplicate(string $hash): void { @@ -478,7 +482,6 @@ class TransactionJournalFactory } /** - * @throws FireflyException */ private function getCurrency(?TransactionCurrency $currency, Account $account): TransactionCurrency { diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index 991f7751d9..775cdc878e 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -165,7 +165,6 @@ class UserEventHandler /** * Set the demo user back to English. * - * @throws FireflyException */ public function demoUserBackToEnglish(Login $event): void { @@ -183,7 +182,6 @@ class UserEventHandler } /** - * @throws FireflyException */ public function notifyNewIPAddress(DetectedNewIPAddress $event): void { @@ -448,7 +446,6 @@ class UserEventHandler } /** - * @throws FireflyException */ public function storeUserIPAddress(ActuallyLoggedIn $event): void { diff --git a/app/Handlers/Events/VersionCheckEventHandler.php b/app/Handlers/Events/VersionCheckEventHandler.php index a7ac2c62c3..1d663855b0 100644 --- a/app/Handlers/Events/VersionCheckEventHandler.php +++ b/app/Handlers/Events/VersionCheckEventHandler.php @@ -31,6 +31,8 @@ use FireflyIII\Helpers\Update\UpdateTrait; use FireflyIII\Models\Configuration; use FireflyIII\Repositories\User\UserRepositoryInterface; use Illuminate\Support\Facades\Log; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class VersionCheckEventHandler @@ -42,7 +44,11 @@ class VersionCheckEventHandler /** * Checks with GitHub to see if there is a new version. * + * @param RequestedVersionCheckStatus $event + * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ #[Deprecated(message: '?')] public function checkForUpdates(RequestedVersionCheckStatus $event): void @@ -87,7 +93,11 @@ class VersionCheckEventHandler } /** + * @param RequestedVersionCheckStatus $event + * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ protected function warnToCheckForUpdates(RequestedVersionCheckStatus $event): void { diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index 145d39063a..846be0c312 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -37,6 +37,7 @@ use Illuminate\Support\Facades\Storage; use Illuminate\Support\MessageBag; use Safe\Exceptions\FileinfoException; use Safe\Exceptions\FilesystemException; +use Safe\Exceptions\StringsException; use Symfony\Component\HttpFoundation\File\UploadedFile; use function Safe\tmpfile; @@ -222,8 +223,11 @@ class AttachmentHelper implements AttachmentHelperInterface /** * Process the upload of a file. * - * @throws FireflyException - * @throws EncryptException + * @param UploadedFile $file + * @param Model $model + * + * @return Attachment|null + * @throws StringsException */ protected function processFile(UploadedFile $file, Model $model): ?Attachment { diff --git a/app/Helpers/Collector/Extensions/AccountCollection.php b/app/Helpers/Collector/Extensions/AccountCollection.php index 2328b5dabc..d56ee1de4b 100644 --- a/app/Helpers/Collector/Extensions/AccountCollection.php +++ b/app/Helpers/Collector/Extensions/AccountCollection.php @@ -43,7 +43,6 @@ trait AccountCollection Log::warning(sprintf('GroupCollector will be SLOW: accountBalanceIs: "%s" "%s" "%s"', $direction, $operator, $value)); /** - * @param int $index * @param array $object * * @return bool diff --git a/app/Helpers/Collector/Extensions/AttachmentCollection.php b/app/Helpers/Collector/Extensions/AttachmentCollection.php index f4993d2d18..b2b3ed0103 100644 --- a/app/Helpers/Collector/Extensions/AttachmentCollection.php +++ b/app/Helpers/Collector/Extensions/AttachmentCollection.php @@ -41,7 +41,6 @@ trait AttachmentCollection $this->withAttachmentInformation(); /** - * @param int $index * @param array $object * * @return bool @@ -120,7 +119,6 @@ trait AttachmentCollection $this->withAttachmentInformation(); /** - * @param int $index * @param array $object * * @return bool @@ -155,7 +153,6 @@ trait AttachmentCollection $this->withAttachmentInformation(); /** - * @param int $index * @param array $object * * @return bool @@ -190,7 +187,6 @@ trait AttachmentCollection $this->withAttachmentInformation(); /** - * @param int $index * @param array $object * * @return bool diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 0d12819740..0dd40ee445 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -48,6 +48,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Override; +use Safe\Exceptions\JsonException; use function Safe\json_decode; /** @@ -564,7 +565,11 @@ class GroupCollector implements GroupCollectorInterface } /** + * @param TransactionJournal $augumentedJournal + * + * @return array * @throws FireflyException + * @throws JsonException */ private function parseAugmentedJournal(TransactionJournal $augumentedJournal): array { diff --git a/app/Helpers/Fiscal/FiscalHelper.php b/app/Helpers/Fiscal/FiscalHelper.php index 13c9d14bdc..ae7ebc752b 100644 --- a/app/Helpers/Fiscal/FiscalHelper.php +++ b/app/Helpers/Fiscal/FiscalHelper.php @@ -24,6 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Fiscal; use Carbon\Carbon; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class FiscalHelper. @@ -62,7 +64,11 @@ class FiscalHelper implements FiscalHelperInterface } /** + * @param Carbon $date + * * @return Carbon date object + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function startOfFiscalYear(Carbon $date): Carbon { diff --git a/app/Helpers/Webhook/Sha3SignatureGenerator.php b/app/Helpers/Webhook/Sha3SignatureGenerator.php index 6d42a4ac56..06967cff04 100644 --- a/app/Helpers/Webhook/Sha3SignatureGenerator.php +++ b/app/Helpers/Webhook/Sha3SignatureGenerator.php @@ -68,7 +68,7 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface // The actual JSON payload (i.e., the request body) $timestamp = Carbon::now()->getTimestamp(); $payload = sprintf('%s.%s', $timestamp, $json); - $signature = hash_hmac('sha3-256', $payload, (string) $message->webhook->secret, false); + $signature = hash_hmac('sha3-256', $payload, (string) $message->webhook->secret); // signature string: // header included in each signed event contains a timestamp and one or more signatures. diff --git a/app/Http/Controllers/Account/CreateController.php b/app/Http/Controllers/Account/CreateController.php index 743c2fdc7a..e0cb55afc7 100644 --- a/app/Http/Controllers/Account/CreateController.php +++ b/app/Http/Controllers/Account/CreateController.php @@ -37,6 +37,8 @@ use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class CreateController @@ -131,9 +133,12 @@ class CreateController extends Controller /** * Store the new account. * + * @param AccountFormRequest $request + * * @return Redirector|RedirectResponse * - * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function store(AccountFormRequest $request) { diff --git a/app/Http/Controllers/Account/IndexController.php b/app/Http/Controllers/Account/IndexController.php index 1ee5f5cccf..66844d8ad2 100644 --- a/app/Http/Controllers/Account/IndexController.php +++ b/app/Http/Controllers/Account/IndexController.php @@ -35,6 +35,8 @@ use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class IndexController @@ -66,10 +68,14 @@ class IndexController extends Controller } /** + * @param Request $request + * @param string $objectType + * * @return Factory|View * - * @throws FireflyException - * */ + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ public function inactive(Request $request, string $objectType) { $inactivePage = true; @@ -136,10 +142,14 @@ class IndexController extends Controller /** * Show list of accounts. * + * @param Request $request + * @param string $objectType + * * @return Factory|View * - * @throws FireflyException - * */ + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ public function index(Request $request, string $objectType) { app('log')->debug(sprintf('Now at %s', __METHOD__)); diff --git a/app/Http/Controllers/Account/ShowController.php b/app/Http/Controllers/Account/ShowController.php index 8c9ac76727..8181e0ff80 100644 --- a/app/Http/Controllers/Account/ShowController.php +++ b/app/Http/Controllers/Account/ShowController.php @@ -40,6 +40,8 @@ use Illuminate\Routing\Redirector; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** @@ -76,10 +78,17 @@ class ShowController extends Controller /** * Show an account. * + * @param Request $request + * @param Account $account + * @param Carbon|null $start + * @param Carbon|null $end + * * @return Factory|Redirector|RedirectResponse|View * + * @throws ContainerExceptionInterface * @throws FireflyException - * */ + * @throws NotFoundExceptionInterface + */ public function show(Request $request, Account $account, ?Carbon $start = null, ?Carbon $end = null) { if (0 === $account->id) { @@ -193,10 +202,14 @@ class ShowController extends Controller /** * Show an account. * + * @param Request $request + * @param Account $account + * * @return Factory|Redirector|RedirectResponse|View * - * @throws FireflyException - * */ + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ public function showAll(Request $request, Account $account) { if (!$this->isEditableAccount($account)) { diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index 6f4fc059f2..264d79158d 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -28,6 +28,8 @@ use FireflyIII\Http\Middleware\IsDemoUser; use Illuminate\Contracts\View\Factory; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class HomeController. @@ -47,6 +49,8 @@ class HomeController extends Controller * Index of the admin. * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index() { diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 07abf76b4d..54ad535864 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Admin; use FireflyIII\Events\Admin\InvitationCreated; +use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Requests\InviteUserFormRequest; @@ -37,6 +38,8 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Routing\Redirector; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class UserController. @@ -151,6 +154,9 @@ class UserController extends Controller * Show index of user manager. * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function index() { diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index c45b947126..b06fc9a007 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -194,7 +194,6 @@ class AttachmentController extends Controller * View attachment in browser. * * @throws FireflyException - * @throws BindingResolutionException */ public function view(Attachment $attachment): LaravelResponse { diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 78fcc649db..1b3607259c 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -33,6 +33,8 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\UrlException; use function Safe\parse_url; @@ -60,7 +62,11 @@ class ForgotPasswordController extends Controller /** * Send a reset link to the given user. * + * @param Request $request + * @param UserRepositoryInterface $repository + * * @return Factory|RedirectResponse|View + * @throws FireflyException */ public function sendResetLinkEmail(Request $request, UserRepositoryInterface $repository) { @@ -126,6 +132,8 @@ class ForgotPasswordController extends Controller * @return Factory|View * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showLinkRequestForm() { diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index c1566b5ed1..01b25bbd19 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -46,6 +46,8 @@ use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Validation\ValidationException; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Symfony\Component\HttpFoundation\Response as ResponseAlias; /** @@ -151,7 +153,7 @@ class LoginController extends Controller $this->sendFailedLoginResponse($request); // @noinspection PhpUnreachableStatementInspection - return response()->json([]); + return response()->json(); } /** @@ -219,9 +221,13 @@ class LoginController extends Controller /** * Show the application's login form. * + * @param Request $request + * * @return Application|Factory|Redirector|RedirectResponse|View * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showLoginForm(Request $request) { diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 79701fe3f7..4122f3fa5a 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -140,9 +140,14 @@ class RegisterController extends Controller /** * Show the application registration form if the invitation code is valid. * + * @param Request $request + * @param string $code + * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function showInviteForm(Request $request, string $code) { @@ -172,9 +177,13 @@ class RegisterController extends Controller /** * Show the application registration form. * + * @param Request|null $request + * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function showRegistrationForm(?Request $request = null) { diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index 442d4956b4..7ff28e0264 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -34,6 +34,8 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Password; use Illuminate\Validation\ValidationException; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ResetPasswordController @@ -112,11 +114,14 @@ class ResetPasswordController extends Controller * * If no token is present, display the link request form. * - * @param null $token + * @param Request $request + * @param null $token * * @return Factory|View * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showResetForm(Request $request, $token = null) { diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php index 1ebce31552..d9cd52c035 100644 --- a/app/Http/Controllers/Auth/TwoFactorController.php +++ b/app/Http/Controllers/Auth/TwoFactorController.php @@ -37,6 +37,8 @@ use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use PragmaRX\Google2FALaravel\Support\Authenticator; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class TwoFactorController. @@ -59,7 +61,11 @@ class TwoFactorController extends Controller } /** + * @param Request $request + * * @return Redirector|RedirectResponse + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function submitMFA(Request $request) { diff --git a/app/Http/Controllers/Bill/IndexController.php b/app/Http/Controllers/Bill/IndexController.php index 46f8514f14..1725bad953 100644 --- a/app/Http/Controllers/Bill/IndexController.php +++ b/app/Http/Controllers/Bill/IndexController.php @@ -149,7 +149,6 @@ class IndexController extends Controller } /** - * @throws FireflyException */ private function getSums(array $bills): array { diff --git a/app/Http/Controllers/Bill/ShowController.php b/app/Http/Controllers/Bill/ShowController.php index acfb3ab3aa..ef004709f5 100644 --- a/app/Http/Controllers/Bill/ShowController.php +++ b/app/Http/Controllers/Bill/ShowController.php @@ -44,6 +44,8 @@ use Illuminate\View\View; use League\Fractal\Manager; use League\Fractal\Resource\Item; use League\Fractal\Serializer\DataArraySerializer; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Symfony\Component\HttpFoundation\ParameterBag; /** @@ -113,7 +115,12 @@ class ShowController extends Controller /** * Show a bill. * + * @param Request $request + * @param Bill $bill + * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function show(Request $request, Bill $bill) { diff --git a/app/Http/Controllers/Budget/BudgetLimitController.php b/app/Http/Controllers/Budget/BudgetLimitController.php index 63e0c93e7e..81087328c4 100644 --- a/app/Http/Controllers/Budget/BudgetLimitController.php +++ b/app/Http/Controllers/Budget/BudgetLimitController.php @@ -150,7 +150,7 @@ class BudgetLimitController extends Controller $end = Carbon::createFromFormat('Y-m-d', $request->get('end')); if (!$start instanceof Carbon || !$end instanceof Carbon) { - return response()->json([]); + return response()->json(); } $amount = (string) $request->get('amount'); @@ -158,7 +158,7 @@ class BudgetLimitController extends Controller $end->startOfDay(); if ('' === $amount) { - return response()->json([]); + return response()->json(); } app('log')->debug(sprintf('Start: %s, end: %s', $start->format('Y-m-d'), $end->format('Y-m-d'))); @@ -172,7 +172,7 @@ class BudgetLimitController extends Controller } // return empty=ish array: - return response()->json([]); + return response()->json(); } if ((int) $amount > 268435456) { // intentional cast to integer $amount = '268435456'; diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php index 2ba33347a1..08631b6bd3 100644 --- a/app/Http/Controllers/Budget/IndexController.php +++ b/app/Http/Controllers/Budget/IndexController.php @@ -174,7 +174,7 @@ class IndexController extends Controller $array['end_date'] = $entry->end_date; // spent in period: - $spentArr = $this->opsRepository->sumExpenses($entry->start_date, $entry->end_date, null, null, $entry->transactionCurrency, false); + $spentArr = $this->opsRepository->sumExpenses($entry->start_date, $entry->end_date, null, null, $entry->transactionCurrency); $array['spent'] = $spentArr[$entry->transaction_currency_id]['sum'] ?? '0'; $array['pc_spent'] = $this->convertToPrimary && $entry->transaction_currency_id !== $this->primaryCurrency->id ? $converter->convert($entry->transactionCurrency, $this->primaryCurrency, $entry->start_date, $array['spent']) : null; // budgeted in period: @@ -235,7 +235,7 @@ class IndexController extends Controller /** @var TransactionCurrency $currency */ foreach ($currencies as $currency) { - $spentArr = $this->opsRepository->sumExpenses($start, $end, null, new Collection()->push($current), $currency, false); + $spentArr = $this->opsRepository->sumExpenses($start, $end, null, new Collection()->push($current), $currency); if (array_key_exists($currency->id, $spentArr) && array_key_exists('sum', $spentArr[$currency->id])) { $array['spent'][$currency->id]['spent'] = $spentArr[$currency->id]['sum']; $array['spent'][$currency->id]['currency_id'] = $currency->id; diff --git a/app/Http/Controllers/Budget/ShowController.php b/app/Http/Controllers/Budget/ShowController.php index ce344f13e8..c28e7455e8 100644 --- a/app/Http/Controllers/Budget/ShowController.php +++ b/app/Http/Controllers/Budget/ShowController.php @@ -39,6 +39,8 @@ use FireflyIII\Support\Http\Controllers\PeriodOverview; use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ShowController @@ -73,9 +75,15 @@ class ShowController extends Controller /** * Show transactions without a budget. * + * @param Request $request + * @param Carbon|null $start + * @param Carbon|null $end + * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function noBudget(Request $request, ?Carbon $start = null, ?Carbon $end = null) { @@ -110,7 +118,11 @@ class ShowController extends Controller /** * Shows ALL transactions without a budget. * + * @param Request $request + * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function noBudgetAll(Request $request) { @@ -135,7 +147,12 @@ class ShowController extends Controller /** * Show a single budget. * + * @param Request $request + * @param Budget $budget + * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function show(Request $request, Budget $budget) { @@ -166,9 +183,15 @@ class ShowController extends Controller /** * Show a single budget by a budget limit. * + * @param Request $request + * @param Budget $budget + * @param BudgetLimit $budgetLimit + * * @return Factory|View * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showByBudgetLimit(Request $request, Budget $budget, BudgetLimit $budgetLimit) { diff --git a/app/Http/Controllers/Category/IndexController.php b/app/Http/Controllers/Category/IndexController.php index 41b85c87a7..ecd406df91 100644 --- a/app/Http/Controllers/Category/IndexController.php +++ b/app/Http/Controllers/Category/IndexController.php @@ -32,6 +32,8 @@ use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class IndexController @@ -62,7 +64,11 @@ class IndexController extends Controller /** * Show all categories. * + * @param Request $request + * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index(Request $request) { diff --git a/app/Http/Controllers/Category/NoCategoryController.php b/app/Http/Controllers/Category/NoCategoryController.php index 11f6ade3a9..609f351a46 100644 --- a/app/Http/Controllers/Category/NoCategoryController.php +++ b/app/Http/Controllers/Category/NoCategoryController.php @@ -37,6 +37,8 @@ use Illuminate\Http\Request; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class NoCategoryController @@ -69,9 +71,15 @@ class NoCategoryController extends Controller /** * Show transactions without a category. * + * @param Request $request + * @param Carbon|null $start + * @param Carbon|null $end + * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function show(Request $request, ?Carbon $start = null, ?Carbon $end = null) { @@ -106,7 +114,11 @@ class NoCategoryController extends Controller /** * Show all transactions without a category. * + * @param Request $request + * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showAll(Request $request) { diff --git a/app/Http/Controllers/Category/ShowController.php b/app/Http/Controllers/Category/ShowController.php index d9a03f2f4a..c9ca74b93c 100644 --- a/app/Http/Controllers/Category/ShowController.php +++ b/app/Http/Controllers/Category/ShowController.php @@ -35,6 +35,8 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\Support\Collection; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ShowController @@ -68,9 +70,16 @@ class ShowController extends Controller /** * Show a single category. * + * @param Request $request + * @param Category $category + * @param Carbon|null $start + * @param Carbon|null $end + * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function show(Request $request, Category $category, ?Carbon $start = null, ?Carbon $end = null) { @@ -111,7 +120,12 @@ class ShowController extends Controller /** * Show all transactions within a category. * + * @param Request $request + * @param Category $category + * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showAll(Request $request, Category $category) { diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 1e48b0d65f..632589163f 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -45,6 +45,7 @@ use Illuminate\Http\JsonResponse; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; +use Safe\Exceptions\JsonException; use function Safe\json_encode; /** @@ -482,7 +483,13 @@ class AccountController extends Controller /** * Shows overview of account during a single period. * + * @param Account $account + * @param Carbon $start + * @param Carbon $end + * + * @return JsonResponse * @throws FireflyException + * @throws JsonException */ public function period(Account $account, Carbon $start, Carbon $end): JsonResponse { @@ -571,7 +578,7 @@ class AccountController extends Controller $label = $current->isoFormat($format); $return[$key]['entries'][$label] = $amount; } - $current = app('navigation')->addPeriod($current, $step, 0); + $current = app('navigation')->addPeriod($current, $step); // here too, to fix #8041, the data is corrected to the end of the period. $current = app('navigation')->endOfX($current, $step, null); } diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index e22a6bd4d5..d79700c4a2 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -40,6 +40,8 @@ use FireflyIII\Support\Http\Controllers\ChartGeneration; use FireflyIII\Support\Http\Controllers\DateCalculation; use Illuminate\Http\JsonResponse; use Illuminate\Support\Collection; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class CategoryController. @@ -66,7 +68,6 @@ class CategoryController extends Controller * Show an overview for a category for all time, per month/week/year. * TODO test method, for category refactor. * - * @throws FireflyException */ public function all(Category $category): JsonResponse { @@ -256,7 +257,12 @@ class CategoryController extends Controller * Chart for a specific period. * TODO test me, for category refactor. * - * @throws FireflyException + * @param Category $category + * @param Carbon $date + * + * @return JsonResponse + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function specificPeriod(Category $category, Carbon $date): JsonResponse { diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index 920c3a9301..1321de9eea 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -59,7 +59,6 @@ class PiggyBankController extends Controller * * TODO this chart is not multi currency aware. * - * @throws FireflyException */ public function history(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank): JsonResponse { @@ -95,7 +94,7 @@ class PiggyBankController extends Controller $currentSum = $filtered->sum('amount'); $label = $oldest->isoFormat((string) trans('config.month_and_day_js', [], $locale)); $chartData[$label] = $currentSum; - $oldest = app('navigation')->addPeriod($oldest, $step, 0); + $oldest = app('navigation')->addPeriod($oldest, $step); } $finalFiltered = $set->filter( static fn (PiggyBankEvent $event) => $event->date->lte($today) diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 9809c24140..4517b002fc 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -260,7 +260,7 @@ class ReportController extends Controller $expense['entries'][$title] = '0'; } - $currentStart = app('navigation')->addPeriod($currentStart, $preferredRange, 0); + $currentStart = app('navigation')->addPeriod($currentStart, $preferredRange); } Log::debug('End of sub-loop'); diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index 9138daf037..1ed00b4710 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -49,6 +49,7 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Route; use Illuminate\View\View; use Monolog\Handler\RotatingFileHandler; +use Safe\Exceptions\FilesystemException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use function Safe\file_get_contents; @@ -131,7 +132,7 @@ class DebugController extends Controller * * @return Factory|View * - * @throws FireflyException + * @throws FilesystemException */ public function index() { diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php index bccff306d9..94696f0373 100644 --- a/app/Http/Controllers/JavascriptController.php +++ b/app/Http/Controllers/JavascriptController.php @@ -33,6 +33,8 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Support\Http\Controllers\GetConfigurationData; use Illuminate\Http\Request; use Illuminate\Http\Response; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class JavascriptController. @@ -90,8 +92,14 @@ class JavascriptController extends Controller /** * Show some common variables to be used in scripts. * + * @param Request $request + * @param AccountRepositoryInterface $repository + * + * @return Response * @throws FireflyException - * */ + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ public function variables(Request $request, AccountRepositoryInterface $repository): Response { $account = $repository->find((int) $request->get('account')); diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.php index ce5f520180..cd845df963 100644 --- a/app/Http/Controllers/Json/BoxController.php +++ b/app/Http/Controllers/Json/BoxController.php @@ -52,7 +52,7 @@ class BoxController extends Controller #[Deprecated] public function available(): JsonResponse { - return response()->json([]); + return response()->json(); } /** diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.php index f3bd44b660..a08c32b6be 100644 --- a/app/Http/Controllers/Json/IntroController.php +++ b/app/Http/Controllers/Json/IntroController.php @@ -89,7 +89,6 @@ class IntroController extends Controller /** * Enable the boxes for a specific page again. * - * @throws FireflyException */ public function postEnable(string $route, ?string $specialPage = null): JsonResponse { @@ -109,7 +108,6 @@ class IntroController extends Controller /** * Set that you saw them. * - * @throws FireflyException */ public function postFinished(string $route, ?string $specialPage = null): JsonResponse { diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index 271c70e692..8350216064 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -87,7 +87,6 @@ class NewUserController extends Controller * * @return Redirector|RedirectResponse * - * @throws FireflyException */ public function submit(NewUserFormRequest $request, CurrencyRepositoryInterface $currencyRepository) { diff --git a/app/Http/Controllers/ObjectGroup/IndexController.php b/app/Http/Controllers/ObjectGroup/IndexController.php index 6cddb20792..91fc370f35 100644 --- a/app/Http/Controllers/ObjectGroup/IndexController.php +++ b/app/Http/Controllers/ObjectGroup/IndexController.php @@ -80,6 +80,6 @@ class IndexController extends Controller $newOrder = (int) $request->get('order'); $this->repository->setOrder($objectGroup, $newOrder); - return response()->json([]); + return response()->json(); } } diff --git a/app/Http/Controllers/PiggyBank/IndexController.php b/app/Http/Controllers/PiggyBank/IndexController.php index 64cab7c4ed..69bbd38780 100644 --- a/app/Http/Controllers/PiggyBank/IndexController.php +++ b/app/Http/Controllers/PiggyBank/IndexController.php @@ -78,7 +78,6 @@ class IndexController extends Controller * * @return Factory|View * - * @throws FireflyException */ public function index() { diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index d6f0435eed..7a22b91c06 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -43,6 +43,7 @@ use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Safe\Exceptions\FilesystemException; use function Safe\json_decode; use function Safe\file_get_contents; @@ -71,9 +72,12 @@ class PreferencesController extends Controller /** * Show overview of preferences. * + * @param AccountRepositoryInterface $repository + * * @return Factory|View * * @throws FireflyException + * @throws FilesystemException */ public function index(AccountRepositoryInterface $repository) { diff --git a/app/Http/Controllers/Profile/MfaController.php b/app/Http/Controllers/Profile/MfaController.php index 333801c380..69537bd12f 100644 --- a/app/Http/Controllers/Profile/MfaController.php +++ b/app/Http/Controllers/Profile/MfaController.php @@ -44,6 +44,8 @@ use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use Illuminate\View\View; use PragmaRX\Recovery\Recovery; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class MfaController @@ -84,7 +86,6 @@ class MfaController extends Controller } /** - * @throws FireflyException */ public function backupCodes(Request $request): Factory|RedirectResponse|View { @@ -230,9 +231,12 @@ class MfaController extends Controller /** * Submit 2FA for the first time. * + * @param TokenFormRequest $request + * * @return Redirector|RedirectResponse * - * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function enableMFAPost(TokenFormRequest $request) { @@ -290,7 +294,10 @@ class MfaController extends Controller /** * TODO duplicate code. * - * @throws FireflyException + * @param string $mfaCode + * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ private function addToMFAHistory(string $mfaCode): void { diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index b63ab5d86b..7eb2e745cf 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -48,6 +48,8 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Illuminate\View\View; use Laravel\Passport\ClientRepository; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ProfileController. @@ -136,7 +138,9 @@ class ProfileController extends Controller /** * Index for profile. * - * @throws FireflyException + * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index(): Factory|View { diff --git a/app/Http/Controllers/Recurring/IndexController.php b/app/Http/Controllers/Recurring/IndexController.php index d6c7e41d7f..9923a42d0a 100644 --- a/app/Http/Controllers/Recurring/IndexController.php +++ b/app/Http/Controllers/Recurring/IndexController.php @@ -36,6 +36,8 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Symfony\Component\HttpFoundation\ParameterBag; /** @@ -71,9 +73,13 @@ class IndexController extends Controller * TODO the notes of a recurrence are pretty pointless at this moment. * Show all recurring transactions. * + * @param Request $request + * * @return Factory|View * * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index(Request $request) { diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 017aa4d9fe..126d312f71 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -39,6 +39,8 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Routing\Redirector; use Illuminate\Support\Collection; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ReportController. @@ -225,7 +227,11 @@ class ReportController extends Controller /** * Show index. * + * @param AccountRepositoryInterface $repository + * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index(AccountRepositoryInterface $repository) { diff --git a/app/Http/Controllers/Rule/IndexController.php b/app/Http/Controllers/Rule/IndexController.php index 5d53c38e9c..7273a72e56 100644 --- a/app/Http/Controllers/Rule/IndexController.php +++ b/app/Http/Controllers/Rule/IndexController.php @@ -82,7 +82,7 @@ class IndexController extends Controller $order = (int) $request->get('order'); $this->ruleRepos->moveRule($rule, $ruleGroup, $order); - return response()->json([]); + return response()->json(); } public function search(Rule $rule): RedirectResponse diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index f69cd62c24..0fd2ef0336 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -37,6 +37,8 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class TagController. @@ -218,9 +220,16 @@ class TagController extends Controller /** * Show a single tag. * + * @param Request $request + * @param Tag $tag + * @param Carbon|null $start + * @param Carbon|null $end + * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function show(Request $request, Tag $tag, ?Carbon $start = null, ?Carbon $end = null) { @@ -261,7 +270,12 @@ class TagController extends Controller /** * Show a single tag over all time. * + * @param Request $request + * @param Tag $tag + * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function showAll(Request $request, Tag $tag) { diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php index c69ddfc2ce..1fc030e5e9 100644 --- a/app/Http/Controllers/Transaction/CreateController.php +++ b/app/Http/Controllers/Transaction/CreateController.php @@ -37,6 +37,9 @@ use Illuminate\Contracts\View\View; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; +use Safe\Exceptions\UrlException; use function Safe\parse_url; /** @@ -98,10 +101,14 @@ class CreateController extends Controller /** * Create a new transaction group. * + * @param string|null $objectType + * * @return Factory|View * - * @throws FireflyException - * */ + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + * @throws UrlException + */ public function create(?string $objectType) { Preferences::mark(); diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php index 5b30ec7a9f..2fa41b6de9 100644 --- a/app/Http/Controllers/Transaction/EditController.php +++ b/app/Http/Controllers/Transaction/EditController.php @@ -35,6 +35,9 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Routing\Redirector; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; +use Safe\Exceptions\UrlException; use function Safe\parse_url; /** @@ -65,7 +68,12 @@ class EditController extends Controller } /** + * @param TransactionGroup $transactionGroup + * * @return Factory|Redirector|RedirectResponse|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + * @throws UrlException */ public function edit(TransactionGroup $transactionGroup) { diff --git a/app/Http/Controllers/Transaction/IndexController.php b/app/Http/Controllers/Transaction/IndexController.php index 54e6a6e967..92f67137c6 100644 --- a/app/Http/Controllers/Transaction/IndexController.php +++ b/app/Http/Controllers/Transaction/IndexController.php @@ -34,6 +34,8 @@ use FireflyIII\Support\Http\Controllers\PeriodOverview; use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class IndexController @@ -67,9 +69,16 @@ class IndexController extends Controller /** * Index for a range of transactions. * + * @param Request $request + * @param string $objectType + * @param Carbon|null $start + * @param Carbon|null $end + * * @return Factory|View * + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function index(Request $request, string $objectType, ?Carbon $start = null, ?Carbon $end = null) { @@ -123,7 +132,12 @@ class IndexController extends Controller /** * Index for ALL transactions. * + * @param Request $request + * @param string $objectType + * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function indexAll(Request $request, string $objectType) { diff --git a/app/Http/Controllers/TransactionCurrency/DeleteController.php b/app/Http/Controllers/TransactionCurrency/DeleteController.php index c7cc7fb83a..ca25c9c2e5 100644 --- a/app/Http/Controllers/TransactionCurrency/DeleteController.php +++ b/app/Http/Controllers/TransactionCurrency/DeleteController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\TransactionCurrency; +use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; @@ -66,7 +67,11 @@ class DeleteController extends Controller /** * Deletes a currency. * + * @param Request $request + * @param TransactionCurrency $currency + * * @return Factory|Redirector|RedirectResponse|View + * @throws FireflyException */ public function delete(Request $request, TransactionCurrency $currency) { @@ -99,7 +104,11 @@ class DeleteController extends Controller /** * Destroys a currency. * + * @param Request $request + * @param TransactionCurrency $currency + * * @return Redirector|RedirectResponse + * @throws FireflyException */ public function destroy(Request $request, TransactionCurrency $currency) { diff --git a/app/Http/Controllers/TransactionCurrency/EditController.php b/app/Http/Controllers/TransactionCurrency/EditController.php index 926e973f44..092b5c623f 100644 --- a/app/Http/Controllers/TransactionCurrency/EditController.php +++ b/app/Http/Controllers/TransactionCurrency/EditController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\TransactionCurrency; +use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\CurrencyFormRequest; use FireflyIII\Models\TransactionCurrency; @@ -106,7 +107,11 @@ class EditController extends Controller /** * Updates a currency. * + * @param CurrencyFormRequest $request + * @param TransactionCurrency $currency + * * @return Redirector|RedirectResponse + * @throws FireflyException */ public function update(CurrencyFormRequest $request, TransactionCurrency $currency) { diff --git a/app/Http/Controllers/TransactionCurrency/IndexController.php b/app/Http/Controllers/TransactionCurrency/IndexController.php index d63ffe5897..62566bbd3b 100644 --- a/app/Http/Controllers/TransactionCurrency/IndexController.php +++ b/app/Http/Controllers/TransactionCurrency/IndexController.php @@ -33,6 +33,8 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\Request; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\View\View; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; class IndexController extends Controller { @@ -61,7 +63,11 @@ class IndexController extends Controller /** * Show overview of currencies. * + * @param Request $request + * * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index(Request $request) { diff --git a/app/Http/Middleware/AcceptHeaders.php b/app/Http/Middleware/AcceptHeaders.php index 0f797dea01..d8884aebf3 100644 --- a/app/Http/Middleware/AcceptHeaders.php +++ b/app/Http/Middleware/AcceptHeaders.php @@ -27,6 +27,7 @@ namespace FireflyIII\Http\Middleware; use FireflyIII\Exceptions\BadHttpHeaderException; use Illuminate\Http\Request; use Illuminate\Http\Response; +use Safe\Exceptions\PcreException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use function Safe\preg_match; @@ -36,9 +37,13 @@ class AcceptHeaders /** * Handle the incoming requests. * + * @param Request $request + * @param callable $next + * * @return Response * * @throws BadHttpHeaderException + * @throws PcreException */ public function handle(Request $request, callable $next): mixed { diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index 7a4fcd3cf9..0061ca310a 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -36,6 +36,7 @@ use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; +use Safe\Exceptions\PcreException; use function Safe\preg_match; /** @@ -133,7 +134,9 @@ class ReportFormRequest extends FormRequest /** * Validate end date. * + * @return Carbon * @throws FireflyException + * @throws PcreException */ public function getEndDate(): Carbon { @@ -171,7 +174,9 @@ class ReportFormRequest extends FormRequest /** * Validate start date. * + * @return Carbon * @throws FireflyException + * @throws PcreException */ public function getStartDate(): Carbon { diff --git a/app/Jobs/DownloadExchangeRates.php b/app/Jobs/DownloadExchangeRates.php index 8d22837468..1bbb3ee10e 100644 --- a/app/Jobs/DownloadExchangeRates.php +++ b/app/Jobs/DownloadExchangeRates.php @@ -41,6 +41,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; +use Safe\Exceptions\JsonException; use function Safe\json_decode; /** @@ -94,7 +95,10 @@ class DownloadExchangeRates implements ShouldQueue } /** + * @param TransactionCurrency $currency + * * @throws GuzzleException + * @throws JsonException */ private function downloadRates(TransactionCurrency $currency): void { diff --git a/app/Mail/ReportNewJournalsMail.php b/app/Mail/ReportNewJournalsMail.php index e0a492fa47..0fd9ac7127 100644 --- a/app/Mail/ReportNewJournalsMail.php +++ b/app/Mail/ReportNewJournalsMail.php @@ -52,6 +52,7 @@ class ReportNewJournalsMail extends Mailable * Build the message. * * @return $this + * @throws FireflyException */ public function build(): self { diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php index 1b3b7ff1ee..a9ca59cb65 100644 --- a/app/Repositories/Account/AccountTasker.php +++ b/app/Repositories/Account/AccountTasker.php @@ -144,7 +144,6 @@ class AccountTasker implements AccountTaskerInterface, UserGroupInterface } /** - * @throws FireflyException */ private function groupExpenseByDestination(array $array): array { @@ -232,7 +231,6 @@ class AccountTasker implements AccountTaskerInterface, UserGroupInterface } /** - * @throws FireflyException */ private function groupIncomeBySource(array $array): array { diff --git a/app/Repositories/Budget/AvailableBudgetRepository.php b/app/Repositories/Budget/AvailableBudgetRepository.php index 177900d154..ee9db0ca62 100644 --- a/app/Repositories/Budget/AvailableBudgetRepository.php +++ b/app/Repositories/Budget/AvailableBudgetRepository.php @@ -113,6 +113,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface, U ; } + #[\Deprecated] public function getAvailableBudget(TransactionCurrency $currency, Carbon $start, Carbon $end): string { $amount = '0'; diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 8aaaa40b8a..23cc13e273 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -377,9 +377,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface return; } - if (null !== $dbNote) { - $dbNote->delete(); - } + $dbNote?->delete(); } public function getAutoBudget(Budget $budget): ?AutoBudget @@ -389,7 +387,6 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface } /** - * @throws FireflyException */ private function updateAutoBudget(Budget $budget, array $data): void { @@ -527,11 +524,8 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface public function firstUseDate(Budget $budget): ?Carbon { $journal = $budget->transactionJournals()->orderBy('date', 'ASC')->first(); - if (null !== $journal) { - return $journal->date; - } + return $journal?->date; - return null; } public function getAttachments(Budget $budget): Collection @@ -570,11 +564,8 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface public function getNoteText(Budget $budget): ?string { $note = $budget->notes()->first(); - if (null === $note) { - return null; - } + return $note?->text; - return $note->text; } public function searchBudget(string $query, int $limit): Collection diff --git a/app/Repositories/Budget/NoBudgetRepository.php b/app/Repositories/Budget/NoBudgetRepository.php index f48176ab9a..8ae96cb192 100644 --- a/app/Repositories/Budget/NoBudgetRepository.php +++ b/app/Repositories/Budget/NoBudgetRepository.php @@ -41,6 +41,7 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface, UserGroupInterf { use UserGroupTrait; + #[\Deprecated] public function getNoBudgetPeriodReport(Collection $accounts, Carbon $start, Carbon $end): array { $carbonFormat = app('navigation')->preferredCarbonFormat($start, $end); diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 894690e9e6..6856e3552a 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -213,11 +213,8 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf $query = $category->transactionJournals()->orderBy('date', 'ASC'); $result = $query->first(['transaction_journals.*']); - if (null !== $result) { - return $result->date; - } + return $result?->date; - return null; } private function getFirstTransactionDate(Category $category): ?Carbon @@ -264,11 +261,8 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf public function getNoteText(Category $category): ?string { $dbNote = $category->notes()->first(); - if (null === $dbNote) { - return null; - } + return $dbNote?->text; - return $dbNote->text; } /** @@ -307,11 +301,8 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf $result = $query->first(['transaction_journals.*']); - if (null !== $result) { - return $result->date; - } + return $result?->date; - return null; } /** diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index cb5e24858b..c76b5badfb 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -45,6 +45,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Override; +use Safe\Exceptions\JsonException; use function Safe\json_encode; /** @@ -65,7 +66,10 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf } /** - * @throws FireflyException + * @param TransactionCurrency $currency + * + * @return string|null + * @throws JsonException */ public function currencyInUseAt(TransactionCurrency $currency): ?string { @@ -234,7 +238,6 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf /** * Find by object, ID or code. Returns user default or system default. * - * @throws FireflyException */ public function findCurrency(?int $currencyId, ?string $currencyCode): TransactionCurrency { diff --git a/app/Repositories/Journal/JournalCLIRepository.php b/app/Repositories/Journal/JournalCLIRepository.php index ea923bfffc..dd47a39323 100644 --- a/app/Repositories/Journal/JournalCLIRepository.php +++ b/app/Repositories/Journal/JournalCLIRepository.php @@ -166,11 +166,8 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface, UserGroupIn public function getNoteText(TransactionJournal $journal): ?string { $note = $journal->notes()->first(); - if (null === $note) { - return null; - } + return $note?->text; - return $note->text; } /** diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.php index c8ee7b89c1..f131b3d1f6 100644 --- a/app/Repositories/Recurring/RecurringRepository.php +++ b/app/Repositories/Recurring/RecurringRepository.php @@ -431,7 +431,6 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte /** * Parse the repetition in a string that is user readable. * - * @throws FireflyException */ public function repetitionDescription(RecurrenceRepetition $repetition): string { diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php index c8c03b7a38..78acf6d253 100644 --- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php +++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php @@ -177,11 +177,8 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface, ->where('noteable_type', TransactionJournal::class) ->first() ; - if (null === $note) { - return null; - } + return $note?->text; - return $note->text; } /** diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index e6dbb7ec52..e00b15ba9d 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -161,11 +161,8 @@ class UserRepository implements UserRepositoryInterface { /** @var null|Role $role */ $role = $user->roles()->first(); - if (null !== $role) { - return $role->name; - } + return $role?->name; - return null; } /** @@ -379,7 +376,6 @@ class UserRepository implements UserRepositoryInterface * This updates the users email address. Same as changeEmail just without most logging. This makes sure that the * undo/confirm routine can't catch this one. The user is NOT blocked. * - * @throws FireflyException * * @see changeEmail */ diff --git a/app/Repositories/UserGroup/UserGroupRepository.php b/app/Repositories/UserGroup/UserGroupRepository.php index 3f9bcdace1..691807110c 100644 --- a/app/Repositories/UserGroup/UserGroupRepository.php +++ b/app/Repositories/UserGroup/UserGroupRepository.php @@ -97,7 +97,6 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte /** * Returns all groups the user is member in. * - * {@inheritDoc} */ public function get(): Collection { @@ -137,7 +136,6 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte if (!$existingGroup instanceof UserGroup) { $exists = false; - /** @var UserGroup $existingGroup */ $existingGroup = $this->store(['user' => $user, 'title' => $groupName]); } $groupName = sprintf('%s-%s', $user->email, substr(sha1(random_int(1000, 9999).microtime()), 0, 4)); @@ -168,7 +166,6 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte /** * Returns all groups. * - * {@inheritDoc} */ public function getAll(): Collection { diff --git a/app/Rules/Account/IsValidAccountType.php b/app/Rules/Account/IsValidAccountType.php index 52042572f1..d2287ff702 100644 --- a/app/Rules/Account/IsValidAccountType.php +++ b/app/Rules/Account/IsValidAccountType.php @@ -46,7 +46,6 @@ class IsValidAccountType implements ValidationRule $filtered = []; $keys = array_keys($this->types); - /** @var mixed $entry */ foreach ($value as $entry) { $entry = (string) $entry; if (!in_array($entry, $keys, true)) { diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php index f3225155c7..5525181b97 100644 --- a/app/Services/Internal/Support/AccountServiceTrait.php +++ b/app/Services/Internal/Support/AccountServiceTrait.php @@ -155,9 +155,7 @@ trait AccountServiceTrait { $dbNote = $account->notes()->first(); if ('' === $note) { - if (null !== $dbNote) { - $dbNote->delete(); - } + $dbNote?->delete(); return true; } @@ -342,7 +340,6 @@ trait AccountServiceTrait } /** - * @throws FireflyException */ protected function getCurrency(int $currencyId, string $currencyCode): TransactionCurrency { @@ -377,7 +374,7 @@ trait AccountServiceTrait throw new FireflyException('Amount for update liability credit/debit was unexpectedly 0.'); } - // if direction is "debit" (i owe this debt), amount is negative. + // if direction is "debit" (I owe this debt), amount is negative. // which means the liability will have a negative balance which the user must fill. $openingBalance = app('steam')->negative($openingBalance); diff --git a/app/Services/Internal/Support/BillServiceTrait.php b/app/Services/Internal/Support/BillServiceTrait.php index c3a73b1e83..a9217f347d 100644 --- a/app/Services/Internal/Support/BillServiceTrait.php +++ b/app/Services/Internal/Support/BillServiceTrait.php @@ -56,9 +56,7 @@ trait BillServiceTrait { if ('' === $note) { $dbNote = $bill->notes()->first(); - if (null !== $dbNote) { - $dbNote->delete(); - } + $dbNote?->delete(); return true; } diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index 8cd15203ca..abe783365f 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -39,6 +39,7 @@ use FireflyIII\Rules\UniqueIban; use FireflyIII\Support\NullArrayObject; use Illuminate\Support\Facades\Log; +use Safe\Exceptions\JsonException; use function Safe\json_encode; /** @@ -265,7 +266,13 @@ trait JournalServiceTrait } /** + * @param Account|null $account + * @param array $data + * @param string $preferredType + * + * @return Account|null * @throws FireflyException + * @throws JsonException */ private function createAccount(?Account $account, array $data, string $preferredType): ?Account { diff --git a/app/Services/Internal/Support/RecurringTransactionTrait.php b/app/Services/Internal/Support/RecurringTransactionTrait.php index 6ac399f6e5..ebb7aad99f 100644 --- a/app/Services/Internal/Support/RecurringTransactionTrait.php +++ b/app/Services/Internal/Support/RecurringTransactionTrait.php @@ -54,9 +54,7 @@ trait RecurringTransactionTrait { if ('' === $note) { $dbNote = $recurrence->notes()->first(); - if (null !== $dbNote) { - $dbNote->delete(); - } + $dbNote?->delete(); return true; } diff --git a/app/Services/Internal/Update/AccountUpdateService.php b/app/Services/Internal/Update/AccountUpdateService.php index 5e1f230b4d..341e72b33a 100644 --- a/app/Services/Internal/Update/AccountUpdateService.php +++ b/app/Services/Internal/Update/AccountUpdateService.php @@ -285,7 +285,6 @@ class AccountUpdateService } /** - * @throws FireflyException */ private function updatePreferences(Account $account): void { diff --git a/app/Services/Internal/Update/BillUpdateService.php b/app/Services/Internal/Update/BillUpdateService.php index a4aca38ce4..d71d82a524 100644 --- a/app/Services/Internal/Update/BillUpdateService.php +++ b/app/Services/Internal/Update/BillUpdateService.php @@ -47,7 +47,6 @@ class BillUpdateService protected User $user; /** - * @throws FireflyException */ public function update(Bill $bill, array $data): Bill { diff --git a/app/Services/Internal/Update/CategoryUpdateService.php b/app/Services/Internal/Update/CategoryUpdateService.php index 28b5f36f00..193a5957b2 100644 --- a/app/Services/Internal/Update/CategoryUpdateService.php +++ b/app/Services/Internal/Update/CategoryUpdateService.php @@ -139,9 +139,7 @@ class CategoryUpdateService } if ('' === $note) { $dbNote = $category->notes()->first(); - if (null !== $dbNote) { - $dbNote->delete(); - } + $dbNote?->delete(); return; } diff --git a/app/Support/Binder/CLIToken.php b/app/Support/Binder/CLIToken.php index d55e5dceca..b57ae19261 100644 --- a/app/Support/Binder/CLIToken.php +++ b/app/Support/Binder/CLIToken.php @@ -37,7 +37,6 @@ class CLIToken implements BinderInterface /** * @return mixed * - * @throws FireflyException */ public static function routeBinder(string $value, Route $route) { diff --git a/app/Support/Chart/Category/WholePeriodChartGenerator.php b/app/Support/Chart/Category/WholePeriodChartGenerator.php index ce43b1d16e..27d6026c2f 100644 --- a/app/Support/Chart/Category/WholePeriodChartGenerator.php +++ b/app/Support/Chart/Category/WholePeriodChartGenerator.php @@ -62,7 +62,7 @@ class WholePeriodChartGenerator $currentEnd = app('navigation')->endOfPeriod($current, $step); $spent[$key] = $opsRepository->sumExpenses($current, $currentEnd, $accounts, $collection); $earned[$key] = $opsRepository->sumIncome($current, $currentEnd, $accounts, $collection); - $current = app('navigation')->addPeriod($current, $step, 0); + $current = app('navigation')->addPeriod($current, $step); } $currencies = $this->extractCurrencies($spent) + $this->extractCurrencies($earned); @@ -104,7 +104,7 @@ class WholePeriodChartGenerator $chartData[$spentInfoKey]['entries'][$label] = app('steam')->bcround($spentAmount, $currency['currency_decimal_places']); $chartData[$earnedInfoKey]['entries'][$label] = app('steam')->bcround($earnedAmount, $currency['currency_decimal_places']); } - $current = app('navigation')->addPeriod($current, $step, 0); + $current = app('navigation')->addPeriod($current, $step); } return $chartData; diff --git a/app/Support/Export/ExportDataGenerator.php b/app/Support/Export/ExportDataGenerator.php index 926f371108..d1b19bf7e4 100644 --- a/app/Support/Export/ExportDataGenerator.php +++ b/app/Support/Export/ExportDataGenerator.php @@ -62,6 +62,8 @@ use Illuminate\Support\Facades\Log; use League\Csv\CannotInsertRecord; use League\Csv\Exception; use League\Csv\Writer; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; /** * Class ExportDataGenerator @@ -105,7 +107,12 @@ class ExportDataGenerator } /** + * @return array + * @throws CannotInsertRecord + * @throws ContainerExceptionInterface + * @throws Exception * @throws FireflyException + * @throws NotFoundExceptionInterface */ public function export(): array { @@ -747,9 +754,12 @@ class ExportDataGenerator } /** + * @return string * @throws CannotInsertRecord * @throws Exception * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ private function exportTags(): string { diff --git a/app/Support/Form/CurrencyForm.php b/app/Support/Form/CurrencyForm.php index bf748c6097..5bf2e0ba77 100644 --- a/app/Support/Form/CurrencyForm.php +++ b/app/Support/Form/CurrencyForm.php @@ -165,8 +165,6 @@ class CurrencyForm } /** - * @phpstan-param view-string $view - * * @throws FireflyException */ protected function currencyField(string $name, string $view, mixed $value = null, ?array $options = null): string diff --git a/app/Support/Http/Api/ExchangeRateConverter.php b/app/Support/Http/Api/ExchangeRateConverter.php index d92313907a..6f6728e825 100644 --- a/app/Support/Http/Api/ExchangeRateConverter.php +++ b/app/Support/Http/Api/ExchangeRateConverter.php @@ -243,7 +243,7 @@ class ExchangeRateConverter private function getRate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): string { $key = $this->getCacheKey($from, $to, $date); - $res = Cache::get($key, null); + $res = Cache::get($key); // find in cache if (null !== $res) { diff --git a/app/Support/Http/Controllers/AugumentData.php b/app/Support/Http/Controllers/AugumentData.php index 2046b7e5b2..d7422f34c2 100644 --- a/app/Support/Http/Controllers/AugumentData.php +++ b/app/Support/Http/Controllers/AugumentData.php @@ -219,7 +219,7 @@ trait AugumentData $entry->pc_spent = $spent; // normal amount: - $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, false); + $expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency); $spent = $expenses[$entry->transactionCurrency->id]['sum'] ?? '0'; $entry->spent = $spent; diff --git a/app/Support/Http/Controllers/GetConfigurationData.php b/app/Support/Http/Controllers/GetConfigurationData.php index b0bb16b3f1..097204bd83 100644 --- a/app/Support/Http/Controllers/GetConfigurationData.php +++ b/app/Support/Http/Controllers/GetConfigurationData.php @@ -118,7 +118,7 @@ trait GetConfigurationData $previousEnd = app('navigation')->endOfPeriod($previousStart, $viewRange); $ranges[$index] = [$previousStart, $previousEnd]; - $nextDate = app('navigation')->addPeriod($start, $viewRange, 0); + $nextDate = app('navigation')->addPeriod($start, $viewRange); $index = app('navigation')->periodShow($nextDate, $viewRange); $nextStart = app('navigation')->startOfPeriod($nextDate, $viewRange); $nextEnd = app('navigation')->endOfPeriod($nextStart, $viewRange); diff --git a/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php b/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php index a6a8823368..b794275706 100644 --- a/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php +++ b/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php @@ -153,8 +153,8 @@ class AvailableBudgetEnrichment implements EnrichmentInterface $id = (int)$availableBudget->id; $currencyId = $this->currencyIds[$id]; $currency = $this->currencies[$currencyId]; - $filteredSpentInBudgets = $this->opsRepository->sumCollectedExpenses($spentInBudgets, $availableBudget->start_date, $availableBudget->end_date, $currency, false); - $filteredSpentOutsideBudgets = $this->opsRepository->sumCollectedExpenses($spentOutsideBudgets, $availableBudget->start_date, $availableBudget->end_date, $currency, false); + $filteredSpentInBudgets = $this->opsRepository->sumCollectedExpenses($spentInBudgets, $availableBudget->start_date, $availableBudget->end_date, $currency); + $filteredSpentOutsideBudgets = $this->opsRepository->sumCollectedExpenses($spentOutsideBudgets, $availableBudget->start_date, $availableBudget->end_date, $currency); $this->spentInBudgets[$id] = array_values($filteredSpentInBudgets); $this->spentOutsideBudgets[$id] = array_values($filteredSpentOutsideBudgets); diff --git a/app/Support/JsonApi/Enrichments/BudgetEnrichment.php b/app/Support/JsonApi/Enrichments/BudgetEnrichment.php index cb875aca78..8d548405d2 100644 --- a/app/Support/JsonApi/Enrichments/BudgetEnrichment.php +++ b/app/Support/JsonApi/Enrichments/BudgetEnrichment.php @@ -156,10 +156,10 @@ class BudgetEnrichment implements EnrichmentInterface $opsRepository->setUserGroup($this->userGroup); // $spent = $this->beautify(); // $set = $this->opsRepository->sumExpenses($start, $end, null, new Collection()->push($budget)) - $expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection, null); + $expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection); foreach ($this->collection as $item) { $id = (int)$item->id; - $this->spent[$id] = array_values($opsRepository->sumCollectedExpensesByBudget($expenses, $item, false)); + $this->spent[$id] = array_values($opsRepository->sumCollectedExpensesByBudget($expenses, $item)); $this->pcSpent[$id] = array_values($opsRepository->sumCollectedExpensesByBudget($expenses, $item, true)); } } diff --git a/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php b/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php index db1e248708..0df7aea164 100644 --- a/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php +++ b/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php @@ -41,7 +41,7 @@ use Illuminate\Support\Facades\Log; class BudgetLimitEnrichment implements EnrichmentInterface { private Collection $collection; - private bool $convertToPrimary = true; // @phpstan-ignore-line + private bool $convertToPrimary; // @phpstan-ignore-line private array $currencies = []; private array $currencyIds = []; private Carbon $end; @@ -120,14 +120,14 @@ class BudgetLimitEnrichment implements EnrichmentInterface $repository = app(OperationsRepository::class); $repository->setUser($this->user); - $expenses = $repository->collectExpenses($this->start, $this->end, null, $budgets, null); + $expenses = $repository->collectExpenses($this->start, $this->end, null, $budgets); /** @var BudgetLimit $budgetLimit */ foreach ($this->collection as $budgetLimit) { Log::debug(sprintf('Filtering expenses for budget limit #%d (budget #%d)', $budgetLimit->id, $budgetLimit->budget_id)); $id = (int)$budgetLimit->id; $filteredExpenses = $this->filterToBudget($expenses, $budgetLimit->budget_id); - $filteredExpenses = $repository->sumCollectedExpenses($filteredExpenses, $budgetLimit->start_date, $budgetLimit->end_date, $budgetLimit->transactionCurrency, false); + $filteredExpenses = $repository->sumCollectedExpenses($filteredExpenses, $budgetLimit->start_date, $budgetLimit->end_date, $budgetLimit->transactionCurrency); $this->expenses[$id] = array_values($filteredExpenses); if (true === $this->convertToPrimary && $budgetLimit->transactionCurrency->id !== $this->primaryCurrency->id) { diff --git a/app/Support/JsonApi/Enrichments/CategoryEnrichment.php b/app/Support/JsonApi/Enrichments/CategoryEnrichment.php index b5ddd22c52..f470e1c111 100644 --- a/app/Support/JsonApi/Enrichments/CategoryEnrichment.php +++ b/app/Support/JsonApi/Enrichments/CategoryEnrichment.php @@ -145,11 +145,11 @@ class CategoryEnrichment implements EnrichmentInterface $transfers = $opsRepository->collectTransfers($this->start, $this->end, null, $this->collection); foreach ($this->collection as $item) { $id = (int)$item->id; - $this->spent[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($expenses, $item, 'negative', false)); + $this->spent[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($expenses, $item, 'negative')); $this->pcSpent[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($expenses, $item, 'negative', true)); - $this->earned[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($income, $item, 'positive', false)); + $this->earned[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($income, $item, 'positive')); $this->pcEarned[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($income, $item, 'positive', true)); - $this->transfers[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($transfers, $item, 'positive', false)); + $this->transfers[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($transfers, $item, 'positive')); $this->pcTransfers[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($transfers, $item, 'positive', true)); } } diff --git a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php index f1a79ad0fc..e51c110078 100644 --- a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php +++ b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php @@ -159,7 +159,9 @@ class PiggyBankEnrichment implements EnrichmentInterface // get suggested per month. $meta['save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['target_amount'], $meta['current_amount']), $currency->decimal_places); - $meta['pc_save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['pc_target_amount'], $meta['pc_current_amount']), $currency->decimal_places); + if(null !== $meta['pc_current_amount']) { + $meta['pc_save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['pc_target_amount'], $meta['pc_current_amount']), $currency->decimal_places); + } $item->meta = $meta; diff --git a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php index 7fdfc1c5dc..1ea71f1dc4 100644 --- a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php +++ b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php @@ -60,8 +60,8 @@ class RecurringEnrichment implements EnrichmentInterface private Collection $collection; // private array $transactionTypeIds = []; // private array $transactionTypes = []; - private bool $convertToPrimary = false; - private array $currencies = []; + private bool $convertToPrimary; + private array $currencies = []; private array $currencyIds = []; private array $destinationAccountIds = []; private array $foreignCurrencyIds = []; diff --git a/app/Support/Models/BillDateCalculator.php b/app/Support/Models/BillDateCalculator.php index 3d49c867a3..6b7cbd2243 100644 --- a/app/Support/Models/BillDateCalculator.php +++ b/app/Support/Models/BillDateCalculator.php @@ -98,7 +98,7 @@ class BillDateCalculator $diffEOM = $daysUntilEOM - $nextUntilEOM; if ($diffEOM > 0) { Log::debug(sprintf('Bill start is %d days from the end of the month. nextExceptedMatch is %d days from the end of the month.', $daysUntilEOM, $nextUntilEOM)); - $nextExpectedMatch->subDays(1); + $nextExpectedMatch->subDays(); Log::debug(sprintf('Subtract %d days from next expected match, which is now %s', $diffEOM, $nextExpectedMatch->format('Y-m-d'))); } } diff --git a/app/Support/Observers/RecalculatesAvailableBudgetsTrait.php b/app/Support/Observers/RecalculatesAvailableBudgetsTrait.php index 0c77493667..b4a774ea95 100644 --- a/app/Support/Observers/RecalculatesAvailableBudgetsTrait.php +++ b/app/Support/Observers/RecalculatesAvailableBudgetsTrait.php @@ -227,7 +227,7 @@ trait RecalculatesAvailableBudgetsTrait } // prep for next loop - $current = app('navigation')->addPeriod($current, $viewRange, 0); + $current = app('navigation')->addPeriod($current, $viewRange); } } } diff --git a/app/Support/ParseDateString.php b/app/Support/ParseDateString.php index df60be3d1d..45404e1952 100644 --- a/app/Support/ParseDateString.php +++ b/app/Support/ParseDateString.php @@ -30,6 +30,7 @@ use Carbon\Exceptions\InvalidFormatException; use FireflyIII\Exceptions\FireflyException; use Illuminate\Support\Facades\Log; +use Safe\Exceptions\PcreException; use function Safe\preg_match; /** @@ -72,8 +73,11 @@ class ParseDateString } /** - * @throws FireflyException + * @param string $date * + * @return Carbon + * @throws FireflyException + * @throws PcreException * @SuppressWarnings("PHPMD.NPathComplexity") */ public function parseDate(string $date): Carbon diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index d622f1f66f..5f00a32036 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -231,7 +231,6 @@ class Preferences } /** - * @throws FireflyException */ public function lastActivity(): string { diff --git a/app/Support/Report/Budget/BudgetReportGenerator.php b/app/Support/Report/Budget/BudgetReportGenerator.php index 4de1c9d9a6..1bf9c81b3e 100644 --- a/app/Support/Report/Budget/BudgetReportGenerator.php +++ b/app/Support/Report/Budget/BudgetReportGenerator.php @@ -133,7 +133,6 @@ class BudgetReportGenerator } /** - * @throws FireflyException */ public function setUser(User $user): void { diff --git a/app/Support/Repositories/Recurring/CalculateXOccurrencesSince.php b/app/Support/Repositories/Recurring/CalculateXOccurrencesSince.php index 2fc216493d..9587ccc0f7 100644 --- a/app/Support/Repositories/Recurring/CalculateXOccurrencesSince.php +++ b/app/Support/Repositories/Recurring/CalculateXOccurrencesSince.php @@ -80,7 +80,7 @@ trait CalculateXOccurrencesSince while ($total < $count) { $domCorrected = min($dayOfMonth, $mutator->daysInMonth); $mutator->day = $domCorrected; - $mutator->setTime(0, 0, 0); + $mutator->setTime(0, 0); if (0 === $attempts % $skipMod && $mutator->gte($afterDate)) { Log::debug(sprintf('Mutator is now %s and is added to the list.', $mutator->toAtomString())); $return[] = clone $mutator; diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 5b2cc0776c..c9368d74af 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -370,7 +370,6 @@ class OperatorQuerySearch implements SearchInterface } /** - * @throws FireflyException */ private function parseDateRange(string $type, string $value): array { diff --git a/app/Support/Search/QueryParser/GdbotsQueryParser.php b/app/Support/Search/QueryParser/GdbotsQueryParser.php index e532901696..127dc475b5 100644 --- a/app/Support/Search/QueryParser/GdbotsQueryParser.php +++ b/app/Support/Search/QueryParser/GdbotsQueryParser.php @@ -31,6 +31,7 @@ use Gdbots\QueryParser\Node as GdbotsNode; use Gdbots\QueryParser\QueryParser as BaseQueryParser; use Illuminate\Support\Facades\Log; use LogicException; +use Safe\Exceptions\FilesystemException; use TypeError; use function Safe\fwrite; @@ -45,7 +46,11 @@ class GdbotsQueryParser implements QueryParserInterface } /** + * @param string $query + * + * @return NodeGroup * @throws FireflyException + * @throws FilesystemException */ public function parse(string $query): NodeGroup { diff --git a/app/Support/Steam.php b/app/Support/Steam.php index 71d5e788f3..9488fe36fb 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -37,6 +37,8 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Support\Str; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use ValueError; use function Safe\parse_url; @@ -534,7 +536,6 @@ class Steam } /** - * @throws FireflyException */ public function getHostName(string $ipAddress): string { @@ -557,7 +558,10 @@ class Steam /** * Get user's language. * + * @return string * @throws FireflyException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function getLanguage(): string // get preference { diff --git a/app/Support/System/OAuthKeys.php b/app/Support/System/OAuthKeys.php index 97bd74bd19..e4878d01cf 100644 --- a/app/Support/System/OAuthKeys.php +++ b/app/Support/System/OAuthKeys.php @@ -32,6 +32,7 @@ use Laravel\Passport\Console\KeysCommand; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; +use Safe\Exceptions\FilesystemException; use function Safe\file_get_contents; use function Safe\file_put_contents; @@ -79,7 +80,11 @@ class OAuthKeys } /** + * @return bool + * @throws ContainerExceptionInterface * @throws FireflyException + * @throws NotFoundExceptionInterface + * @throws FilesystemException */ public static function restoreKeysFromDB(): bool { diff --git a/app/Transformers/PiggyBankEventTransformer.php b/app/Transformers/PiggyBankEventTransformer.php index a0a43ecc59..d5097b6136 100644 --- a/app/Transformers/PiggyBankEventTransformer.php +++ b/app/Transformers/PiggyBankEventTransformer.php @@ -36,7 +36,7 @@ use FireflyIII\Support\Facades\Steam; class PiggyBankEventTransformer extends AbstractTransformer { private readonly TransactionCurrency $primaryCurrency; - private bool $convertToPrimary = false; + private bool $convertToPrimary; /** * PiggyBankEventTransformer constructor. diff --git a/app/Transformers/PiggyBankTransformer.php b/app/Transformers/PiggyBankTransformer.php index 10c3379441..ccc7e70b00 100644 --- a/app/Transformers/PiggyBankTransformer.php +++ b/app/Transformers/PiggyBankTransformer.php @@ -47,7 +47,6 @@ class PiggyBankTransformer extends AbstractTransformer /** * Transform the piggy bank. * - * @throws FireflyException */ public function transform(PiggyBank $piggyBank): array { diff --git a/app/Transformers/RecurrenceTransformer.php b/app/Transformers/RecurrenceTransformer.php index 9f3ce0c5f0..00c388fdcb 100644 --- a/app/Transformers/RecurrenceTransformer.php +++ b/app/Transformers/RecurrenceTransformer.php @@ -41,7 +41,6 @@ class RecurrenceTransformer extends AbstractTransformer /** * Transform the recurring transaction. * - * @throws FireflyException */ public function transform(Recurrence $recurrence): array { diff --git a/app/Transformers/UserTransformer.php b/app/Transformers/UserTransformer.php index 18dc74d4b6..cff73173c2 100644 --- a/app/Transformers/UserTransformer.php +++ b/app/Transformers/UserTransformer.php @@ -38,7 +38,6 @@ class UserTransformer extends AbstractTransformer /** * Transform user. * - * @throws FireflyException */ public function transform(User $user): array { diff --git a/app/User.php b/app/User.php index 3e2eccddf0..cc9e4b7d07 100644 --- a/app/User.php +++ b/app/User.php @@ -259,7 +259,6 @@ class User extends Authenticatable $dbRolesIds = $dbRoles->pluck('id')->toArray(); $dbRolesTitles = $dbRoles->pluck('title')->toArray(); - /** @var Collection $groupMemberships */ $groupMemberships = $this->groupMemberships()->whereIn('user_role_id', $dbRolesIds)->where('user_group_id', $userGroup->id)->get(); if (0 === $groupMemberships->count()) { app('log')->error(sprintf( diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index bb9bbd3198..e3d25b33f8 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -46,6 +46,9 @@ use PragmaRX\Google2FA\Exceptions\InvalidCharactersException; use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException; use PragmaRX\Google2FALaravel\Facade; use Config; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; +use Safe\Exceptions\JsonException; use ValueError; use function Safe\preg_match; @@ -62,10 +65,12 @@ class FireflyValidator extends Validator * @param mixed $attribute * @param mixed $value * + * @return bool * @throws IncompatibleWithGoogleAuthenticatorException * @throws InvalidCharactersException * @throws SecretKeyTooShortException - * + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function validate2faCode($attribute, $value): bool @@ -628,6 +633,8 @@ class FireflyValidator extends Validator * @param mixed $value * @param mixed $parameters * + * @return bool + * @throws JsonException * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function validateUniqueAccountNumberForUser($attribute, $value, $parameters): bool From 50279d623c997fc30c3ea504c0508b55cc045fc0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 5 Oct 2025 12:59:43 +0200 Subject: [PATCH 21/26] More code cleanup --- .../Controllers/Autocomplete/TransactionController.php | 2 +- app/Api/V1/Controllers/Data/Export/ExportController.php | 1 - app/Api/V1/Controllers/Models/Account/ListController.php | 1 - app/Api/V1/Controllers/Models/Account/ShowController.php | 1 - .../Models/AvailableBudget/ShowController.php | 1 - app/Api/V1/Controllers/Models/Bill/ListController.php | 1 - app/Api/V1/Controllers/Models/Bill/ShowController.php | 1 - app/Api/V1/Controllers/Models/Budget/ListController.php | 1 - app/Api/V1/Controllers/Models/Budget/ShowController.php | 1 - .../V1/Controllers/Models/BudgetLimit/ListController.php | 1 - .../V1/Controllers/Models/Category/ListController.php | 1 - .../V1/Controllers/Models/Category/ShowController.php | 1 - .../V1/Controllers/Models/ObjectGroup/ListController.php | 1 - .../V1/Controllers/Models/PiggyBank/ListController.php | 1 - .../V1/Controllers/Models/PiggyBank/ShowController.php | 1 - .../V1/Controllers/Models/Recurrence/ListController.php | 1 - .../V1/Controllers/Models/Recurrence/ShowController.php | 1 - app/Api/V1/Controllers/Models/Rule/ShowController.php | 1 - .../V1/Controllers/Models/RuleGroup/ListController.php | 1 - .../V1/Controllers/Models/RuleGroup/ShowController.php | 1 - app/Api/V1/Controllers/Models/Tag/ListController.php | 1 - app/Api/V1/Controllers/Models/Tag/ShowController.php | 1 - .../V1/Controllers/Models/Transaction/ListController.php | 1 - .../V1/Controllers/Models/Transaction/ShowController.php | 1 - .../Models/TransactionCurrency/DestroyController.php | 2 +- .../Models/TransactionCurrency/ListController.php | 1 - .../Models/TransactionCurrency/ShowController.php | 1 - .../Models/TransactionCurrency/StoreController.php | 1 - .../Models/TransactionLink/ShowController.php | 1 - .../Models/TransactionLink/StoreController.php | 2 +- .../Models/TransactionLinkType/ListController.php | 1 - .../Models/TransactionLinkType/ShowController.php | 1 - .../Models/TransactionLinkType/StoreController.php | 2 +- .../Models/TransactionLinkType/UpdateController.php | 2 +- app/Api/V1/Controllers/Search/TransactionController.php | 1 - app/Api/V1/Controllers/Summary/BasicController.php | 2 +- app/Api/V1/Controllers/Webhook/ShowController.php | 1 - app/Api/V1/Requests/Chart/ChartRequest.php | 2 +- .../V1/Requests/Data/Bulk/MoveTransactionsRequest.php | 2 +- app/Api/V1/Requests/Data/Bulk/TransactionRequest.php | 5 ++--- app/Api/V1/Requests/Models/Account/ShowRequest.php | 2 +- app/Api/V1/Requests/Models/Account/UpdateRequest.php | 2 +- app/Api/V1/Requests/Models/AvailableBudget/Request.php | 2 +- app/Api/V1/Requests/Models/Bill/StoreRequest.php | 6 +++--- app/Api/V1/Requests/Models/Bill/UpdateRequest.php | 2 +- app/Api/V1/Requests/Models/Budget/StoreRequest.php | 2 +- app/Api/V1/Requests/Models/Budget/UpdateRequest.php | 2 +- app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php | 4 ++-- .../CurrencyExchangeRate/StoreByCurrenciesRequest.php | 2 +- .../Models/CurrencyExchangeRate/StoreByDateRequest.php | 2 +- app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php | 4 ++-- app/Api/V1/Requests/Models/Recurrence/StoreRequest.php | 2 +- app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php | 2 +- app/Api/V1/Requests/Models/Rule/StoreRequest.php | 2 +- app/Api/V1/Requests/Models/Rule/UpdateRequest.php | 2 +- app/Api/V1/Requests/Models/Transaction/StoreRequest.php | 2 +- app/Api/V1/Requests/Models/Transaction/UpdateRequest.php | 2 +- .../V1/Requests/Models/TransactionLink/StoreRequest.php | 2 +- .../V1/Requests/Models/TransactionLink/UpdateRequest.php | 2 +- app/Api/V1/Requests/System/UserUpdateRequest.php | 2 +- app/Console/Commands/Correction/CorrectsUnevenAmount.php | 2 +- app/Console/Commands/Correction/CreatesAccessTokens.php | 2 +- app/Console/Commands/Correction/RemovesEmptyGroups.php | 2 +- .../Commands/Correction/RemovesOrphanedTransactions.php | 2 +- app/Console/Commands/Export/ExportsData.php | 5 ++--- app/Console/Commands/System/ForcesDecimalSize.php | 4 +--- app/Console/Commands/System/ResetsErrorMailLimit.php | 1 - app/Console/Commands/System/ScansAttachments.php | 1 - app/Console/Commands/System/VerifySecurityAlerts.php | 1 - .../Commands/Upgrade/AddsTransactionIdentifiers.php | 1 - .../Commands/Upgrade/RemovesDatabaseDecryption.php | 1 - .../Commands/Upgrade/UpgradesAccountCurrencies.php | 3 +-- app/Console/Commands/Upgrade/UpgradesDatabase.php | 6 ++---- .../Commands/Upgrade/UpgradesRecurrenceMetaData.php | 1 - app/Console/Commands/Upgrade/UpgradesToGroups.php | 2 +- app/Exceptions/GracefulNotFoundHandler.php | 2 +- app/Exceptions/Handler.php | 7 +++---- app/Exceptions/IntervalException.php | 2 +- app/Factory/BillFactory.php | 2 +- app/Factory/PiggyBankFactory.php | 5 ++--- app/Factory/TransactionJournalFactory.php | 7 +++---- app/Handlers/Events/APIEventHandler.php | 2 +- app/Handlers/Events/AdminEventHandler.php | 2 +- app/Handlers/Events/AutomationHandler.php | 2 +- app/Handlers/Events/BillEventHandler.php | 1 - app/Handlers/Events/Model/PiggyBankEventHandler.php | 4 ++-- app/Handlers/Events/Security/MFAHandler.php | 2 +- app/Handlers/Events/UserEventHandler.php | 2 +- app/Handlers/Events/VersionCheckEventHandler.php | 2 +- app/Helpers/Attachments/AttachmentHelper.php | 9 +++------ app/Helpers/Collector/Extensions/MetaCollection.php | 1 - app/Helpers/Collector/GroupCollector.php | 1 - app/Helpers/Report/NetWorth.php | 2 +- app/Helpers/Report/NetWorthInterface.php | 2 +- app/Helpers/Webhook/Sha3SignatureGenerator.php | 1 - app/Http/Controllers/Account/CreateController.php | 1 - app/Http/Controllers/Account/EditController.php | 2 +- app/Http/Controllers/Account/IndexController.php | 1 - app/Http/Controllers/AttachmentController.php | 1 - app/Http/Controllers/Auth/ForgotPasswordController.php | 1 - app/Http/Controllers/Auth/LoginController.php | 4 ++-- app/Http/Controllers/Bill/IndexController.php | 1 - app/Http/Controllers/Budget/EditController.php | 2 +- app/Http/Controllers/Budget/ShowController.php | 2 +- app/Http/Controllers/Category/NoCategoryController.php | 2 +- app/Http/Controllers/Chart/AccountController.php | 1 - app/Http/Controllers/Chart/CategoryController.php | 1 - app/Http/Controllers/Chart/PiggyBankController.php | 1 - app/Http/Controllers/Controller.php | 5 ++--- app/Http/Controllers/DebugController.php | 2 -- app/Http/Controllers/Export/IndexController.php | 2 +- app/Http/Controllers/HomeController.php | 2 +- app/Http/Controllers/Json/BoxController.php | 2 +- app/Http/Controllers/Json/BudgetController.php | 2 +- app/Http/Controllers/Json/FrontpageController.php | 2 +- app/Http/Controllers/Json/IntroController.php | 1 - app/Http/Controllers/Json/ReconcileController.php | 2 +- app/Http/Controllers/Json/RuleController.php | 2 +- app/Http/Controllers/NewUserController.php | 3 +-- app/Http/Controllers/PiggyBank/IndexController.php | 1 - app/Http/Controllers/PreferencesController.php | 7 +++---- app/Http/Controllers/Profile/MfaController.php | 5 ++--- app/Http/Controllers/ProfileController.php | 4 ++-- app/Http/Controllers/Report/AccountController.php | 2 +- app/Http/Controllers/Report/BalanceController.php | 2 +- app/Http/Controllers/Report/BillController.php | 2 +- app/Http/Controllers/Report/BudgetController.php | 4 ++-- app/Http/Controllers/Report/CategoryController.php | 2 +- app/Http/Controllers/Report/DoubleController.php | 2 +- app/Http/Controllers/Report/OperationsController.php | 2 +- app/Http/Controllers/Report/TagController.php | 2 +- app/Http/Controllers/Rule/CreateController.php | 2 +- app/Http/Controllers/Rule/EditController.php | 2 +- app/Http/Controllers/Rule/SelectController.php | 2 +- app/Http/Controllers/SearchController.php | 2 +- app/Http/Controllers/System/InstallController.php | 7 +++---- app/Http/Controllers/TagController.php | 2 +- app/Http/Controllers/Transaction/ConvertController.php | 4 ++-- app/Http/Controllers/Transaction/CreateController.php | 4 +--- app/Http/Controllers/Transaction/EditController.php | 1 - app/Http/Controllers/Transaction/IndexController.php | 2 +- app/Http/Controllers/Transaction/MassController.php | 2 +- .../Controllers/TransactionCurrency/CreateController.php | 2 +- app/Http/Middleware/AcceptHeaders.php | 1 - app/Http/Middleware/Range.php | 6 +++--- app/Http/Middleware/SecureHeaders.php | 2 +- app/Http/Middleware/StartFireflySession.php | 2 +- app/Http/Middleware/TrustHosts.php | 2 +- app/Http/Requests/AccountFormRequest.php | 2 +- app/Http/Requests/AttachmentFormRequest.php | 2 +- app/Http/Requests/BillStoreRequest.php | 2 +- app/Http/Requests/BillUpdateRequest.php | 2 +- app/Http/Requests/BudgetFormStoreRequest.php | 2 +- app/Http/Requests/BudgetFormUpdateRequest.php | 2 +- app/Http/Requests/BudgetIncomeRequest.php | 2 +- app/Http/Requests/BulkEditJournalRequest.php | 2 +- app/Http/Requests/CategoryFormRequest.php | 2 +- app/Http/Requests/ConfigurationRequest.php | 2 +- app/Http/Requests/CurrencyFormRequest.php | 2 +- app/Http/Requests/DeleteAccountFormRequest.php | 2 +- app/Http/Requests/EmailFormRequest.php | 2 +- app/Http/Requests/ExistingTokenFormRequest.php | 2 +- app/Http/Requests/InviteUserFormRequest.php | 2 +- app/Http/Requests/JournalLinkRequest.php | 2 +- app/Http/Requests/LinkTypeFormRequest.php | 2 +- app/Http/Requests/MassDeleteJournalRequest.php | 2 +- app/Http/Requests/MassEditJournalRequest.php | 2 +- app/Http/Requests/NewUserFormRequest.php | 2 +- app/Http/Requests/ObjectGroupFormRequest.php | 2 +- app/Http/Requests/PiggyBankStoreRequest.php | 2 +- app/Http/Requests/PiggyBankUpdateRequest.php | 2 +- app/Http/Requests/ProfileFormRequest.php | 2 +- app/Http/Requests/ReconciliationStoreRequest.php | 2 +- app/Http/Requests/RecurrenceFormRequest.php | 2 +- app/Http/Requests/ReportFormRequest.php | 3 +-- app/Http/Requests/RuleFormRequest.php | 2 +- app/Http/Requests/RuleGroupFormRequest.php | 2 +- app/Http/Requests/SelectTransactionsRequest.php | 2 +- app/Http/Requests/TagFormRequest.php | 2 +- app/Http/Requests/TestRuleFormRequest.php | 2 +- app/Http/Requests/TokenFormRequest.php | 2 +- app/Http/Requests/TriggerRecurrenceRequest.php | 2 +- app/Http/Requests/UserFormRequest.php | 2 +- app/Http/Requests/UserRegistrationRequest.php | 2 +- app/Jobs/DownloadExchangeRates.php | 3 +-- app/Jobs/MailError.php | 7 +++---- app/Mail/InvitationMail.php | 1 - app/Models/AccountMeta.php | 1 - app/Models/Configuration.php | 1 - app/Models/TransactionJournalMeta.php | 1 - app/Providers/AppServiceProvider.php | 1 - app/Providers/FireflyServiceProvider.php | 2 +- app/Repositories/Account/AccountRepository.php | 1 - app/Repositories/Attachment/AttachmentRepository.php | 2 +- app/Repositories/Bill/BillRepository.php | 2 +- app/Repositories/Budget/AvailableBudgetRepository.php | 2 +- .../Budget/AvailableBudgetRepositoryInterface.php | 2 +- app/Repositories/Budget/NoBudgetRepositoryInterface.php | 2 +- app/Repositories/Category/CategoryRepository.php | 2 +- app/Repositories/Currency/CurrencyRepository.php | 1 - app/Repositories/PiggyBank/PiggyBankRepository.php | 4 ++-- app/Repositories/Recurring/RecurringRepository.php | 3 +-- app/Repositories/Rule/RuleRepository.php | 2 +- app/Repositories/RuleGroup/RuleGroupRepository.php | 2 +- app/Repositories/Tag/TagRepository.php | 4 ++-- .../TransactionGroup/TransactionGroupRepository.php | 1 - app/Repositories/User/UserRepository.php | 2 +- app/Rules/Account/IsValidAccountType.php | 2 +- app/Rules/Admin/IsValidDiscordUrl.php | 2 +- app/Rules/Admin/IsValidSlackOrDiscordUrl.php | 2 +- app/Rules/Admin/IsValidSlackUrl.php | 2 +- app/Rules/BelongsUser.php | 2 +- app/Rules/BelongsUserGroup.php | 2 +- app/Rules/IsAllowedGroupAction.php | 2 +- app/Rules/IsAssetAccountId.php | 2 +- app/Rules/IsBoolean.php | 2 +- app/Rules/IsDateOrTime.php | 2 +- app/Rules/IsDefaultUserGroupName.php | 2 +- app/Rules/IsDuplicateTransaction.php | 2 +- app/Rules/IsFilterValueIn.php | 2 +- app/Rules/IsTransferAccount.php | 2 +- app/Rules/IsValidActionExpression.php | 2 +- app/Rules/IsValidAmount.php | 2 +- app/Rules/IsValidAttachmentModel.php | 2 +- app/Rules/IsValidBulkClause.php | 3 +-- app/Rules/IsValidDateRange.php | 2 +- app/Rules/IsValidPositiveAmount.php | 3 +-- app/Rules/IsValidZeroOrMoreAmount.php | 2 +- app/Rules/LessThanPiggyTarget.php | 2 +- app/Rules/UniqueAccountNumber.php | 3 +-- app/Rules/UniqueIban.php | 2 +- app/Rules/ValidJournals.php | 2 +- app/Rules/ValidRecurrenceRepetitionType.php | 2 +- app/Rules/ValidRecurrenceRepetitionValue.php | 2 +- app/Services/FireflyIIIOrg/Update/UpdateRequest.php | 1 - app/Services/Internal/Support/AccountServiceTrait.php | 2 +- app/Services/Internal/Support/JournalServiceTrait.php | 1 - .../Internal/Support/RecurringTransactionTrait.php | 1 - app/Services/Internal/Update/BillUpdateService.php | 3 +-- app/Services/Internal/Update/CategoryUpdateService.php | 2 +- app/Services/Webhook/StandardWebhookSender.php | 1 - app/Support/Binder/CLIToken.php | 1 - app/Support/CacheProperties.php | 1 - app/Support/Http/Controllers/CreateStuff.php | 1 - app/Support/Http/Controllers/RequestInformation.php | 1 - app/Support/JsonApi/Enrichments/RecurringEnrichment.php | 1 - app/Support/ParseDateString.php | 1 - app/Support/Report/Budget/BudgetReportGenerator.php | 1 - app/Support/Request/ConvertsDataTypes.php | 1 - app/Support/Search/AccountSearch.php | 1 - app/Support/Search/QueryParser/GdbotsQueryParser.php | 1 - app/Support/Steam.php | 1 - app/Support/System/OAuthKeys.php | 1 - app/Support/Twig/General.php | 1 - app/Support/Twig/TransactionGroupTwig.php | 1 - app/Transformers/PiggyBankTransformer.php | 1 - app/Transformers/RecurrenceTransformer.php | 1 - app/Transformers/UserTransformer.php | 1 - app/Transformers/WebhookMessageTransformer.php | 1 - app/User.php | 2 +- .../Api/Data/Bulk/ValidatesBulkTransactionQuery.php | 3 +-- app/Validation/CurrencyValidation.php | 2 +- app/Validation/FireflyValidator.php | 5 ++--- app/Validation/GroupValidation.php | 2 +- app/Validation/RecurrenceValidation.php | 2 +- app/Validation/TransactionValidation.php | 2 +- 266 files changed, 214 insertions(+), 329 deletions(-) diff --git a/app/Api/V1/Controllers/Autocomplete/TransactionController.php b/app/Api/V1/Controllers/Autocomplete/TransactionController.php index 4321479d26..d088427937 100644 --- a/app/Api/V1/Controllers/Autocomplete/TransactionController.php +++ b/app/Api/V1/Controllers/Autocomplete/TransactionController.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Autocomplete; -use FireflyIII\Models\TransactionGroup; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest; use FireflyIII\Enums\UserRoleEnum; +use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface; diff --git a/app/Api/V1/Controllers/Data/Export/ExportController.php b/app/Api/V1/Controllers/Data/Export/ExportController.php index f578b7b050..685217f769 100644 --- a/app/Api/V1/Controllers/Data/Export/ExportController.php +++ b/app/Api/V1/Controllers/Data/Export/ExportController.php @@ -31,7 +31,6 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Support\Export\ExportDataGenerator; use Illuminate\Http\Response as LaravelResponse; use Safe\Exceptions\DatetimeException; - use function Safe\date; /** diff --git a/app/Api/V1/Controllers/Models/Account/ListController.php b/app/Api/V1/Controllers/Models/Account/ListController.php index 1d646a0388..6ea2908f76 100644 --- a/app/Api/V1/Controllers/Models/Account/ListController.php +++ b/app/Api/V1/Controllers/Models/Account/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Account; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; diff --git a/app/Api/V1/Controllers/Models/Account/ShowController.php b/app/Api/V1/Controllers/Models/Account/ShowController.php index 5ef0363961..74c5fba684 100644 --- a/app/Api/V1/Controllers/Models/Account/ShowController.php +++ b/app/Api/V1/Controllers/Models/Account/ShowController.php @@ -26,7 +26,6 @@ namespace FireflyIII\Api\V1\Controllers\Models\Account; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\Account\ShowRequest; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Http\Api\AccountFilter; diff --git a/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php b/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php index c9693643eb..9ee8b50278 100644 --- a/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php +++ b/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\AvailableBudget; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\AvailableBudget; use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\AvailableBudgetEnrichment; diff --git a/app/Api/V1/Controllers/Models/Bill/ListController.php b/app/Api/V1/Controllers/Models/Bill/ListController.php index 24f27edb1e..e6a98f6716 100644 --- a/app/Api/V1/Controllers/Models/Bill/ListController.php +++ b/app/Api/V1/Controllers/Models/Bill/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Bill; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Bill; use FireflyIII\Repositories\Bill\BillRepositoryInterface; diff --git a/app/Api/V1/Controllers/Models/Bill/ShowController.php b/app/Api/V1/Controllers/Models/Bill/ShowController.php index 380d86ef76..7ca52a322e 100644 --- a/app/Api/V1/Controllers/Models/Bill/ShowController.php +++ b/app/Api/V1/Controllers/Models/Bill/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Bill; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Bill; use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\SubscriptionEnrichment; diff --git a/app/Api/V1/Controllers/Models/Budget/ListController.php b/app/Api/V1/Controllers/Models/Budget/ListController.php index 72a9cae8fb..17b3f95a94 100644 --- a/app/Api/V1/Controllers/Models/Budget/ListController.php +++ b/app/Api/V1/Controllers/Models/Budget/ListController.php @@ -26,7 +26,6 @@ namespace FireflyIII\Api\V1\Controllers\Models\Budget; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Enums\TransactionTypeEnum; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface; diff --git a/app/Api/V1/Controllers/Models/Budget/ShowController.php b/app/Api/V1/Controllers/Models/Budget/ShowController.php index 8d9314b85f..55994b1fc0 100644 --- a/app/Api/V1/Controllers/Models/Budget/ShowController.php +++ b/app/Api/V1/Controllers/Models/Budget/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Budget; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; diff --git a/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php b/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php index 0b66da5487..0e8d707900 100644 --- a/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php +++ b/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\BudgetLimit; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Budget; use FireflyIII\Models\BudgetLimit; diff --git a/app/Api/V1/Controllers/Models/Category/ListController.php b/app/Api/V1/Controllers/Models/Category/ListController.php index b89fc38bae..fbadd0c42a 100644 --- a/app/Api/V1/Controllers/Models/Category/ListController.php +++ b/app/Api/V1/Controllers/Models/Category/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Category; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Category; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; diff --git a/app/Api/V1/Controllers/Models/Category/ShowController.php b/app/Api/V1/Controllers/Models/Category/ShowController.php index 0d19bb5b77..0f827ed175 100644 --- a/app/Api/V1/Controllers/Models/Category/ShowController.php +++ b/app/Api/V1/Controllers/Models/Category/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Category; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Category; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\CategoryEnrichment; diff --git a/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php b/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php index 81fcc0679a..cac0aa7cc5 100644 --- a/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php +++ b/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\ObjectGroup; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\ObjectGroup; use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\PiggyBankEnrichment; diff --git a/app/Api/V1/Controllers/Models/PiggyBank/ListController.php b/app/Api/V1/Controllers/Models/PiggyBank/ListController.php index 5d4181a425..2eff6ea53c 100644 --- a/app/Api/V1/Controllers/Models/PiggyBank/ListController.php +++ b/app/Api/V1/Controllers/Models/PiggyBank/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\PiggyBank; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\PiggyBank; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\AccountEnrichment; diff --git a/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php b/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php index 570947db73..5f6274e14e 100644 --- a/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php +++ b/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\PiggyBank; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\PiggyBank; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\PiggyBankEnrichment; diff --git a/app/Api/V1/Controllers/Models/Recurrence/ListController.php b/app/Api/V1/Controllers/Models/Recurrence/ListController.php index deb46548a3..ea5ed5786d 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/ListController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Recurrence; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Recurrence; use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface; diff --git a/app/Api/V1/Controllers/Models/Recurrence/ShowController.php b/app/Api/V1/Controllers/Models/Recurrence/ShowController.php index 1be11a85f8..d08117d869 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/ShowController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Recurrence; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Recurrence; use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface; use FireflyIII\Support\JsonApi\Enrichments\RecurringEnrichment; diff --git a/app/Api/V1/Controllers/Models/Rule/ShowController.php b/app/Api/V1/Controllers/Models/Rule/ShowController.php index e659f2e8c4..d18599802c 100644 --- a/app/Api/V1/Controllers/Models/Rule/ShowController.php +++ b/app/Api/V1/Controllers/Models/Rule/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Rule; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Rule; use FireflyIII\Repositories\Rule\RuleRepositoryInterface; use FireflyIII\Transformers\RuleTransformer; diff --git a/app/Api/V1/Controllers/Models/RuleGroup/ListController.php b/app/Api/V1/Controllers/Models/RuleGroup/ListController.php index 6c7b614c03..d39590f831 100644 --- a/app/Api/V1/Controllers/Models/RuleGroup/ListController.php +++ b/app/Api/V1/Controllers/Models/RuleGroup/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\RuleGroup; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\RuleGroup; use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use FireflyIII\Transformers\RuleTransformer; diff --git a/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php b/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php index 2cf7833853..cd9d42c2d3 100644 --- a/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php +++ b/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\RuleGroup; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\RuleGroup; use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use FireflyIII\Transformers\RuleGroupTransformer; diff --git a/app/Api/V1/Controllers/Models/Tag/ListController.php b/app/Api/V1/Controllers/Models/Tag/ListController.php index a29b3a016b..49899a4eec 100644 --- a/app/Api/V1/Controllers/Models/Tag/ListController.php +++ b/app/Api/V1/Controllers/Models/Tag/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Tag; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Tag; use FireflyIII\Repositories\Tag\TagRepositoryInterface; diff --git a/app/Api/V1/Controllers/Models/Tag/ShowController.php b/app/Api/V1/Controllers/Models/Tag/ShowController.php index b9daf868dc..f69d050ddc 100644 --- a/app/Api/V1/Controllers/Models/Tag/ShowController.php +++ b/app/Api/V1/Controllers/Models/Tag/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Tag; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Tag; use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Transformers\TagTransformer; diff --git a/app/Api/V1/Controllers/Models/Transaction/ListController.php b/app/Api/V1/Controllers/Models/Transaction/ListController.php index a7e0649017..fbc68db891 100644 --- a/app/Api/V1/Controllers/Models/Transaction/ListController.php +++ b/app/Api/V1/Controllers/Models/Transaction/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Transaction; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalAPIRepositoryInterface; diff --git a/app/Api/V1/Controllers/Models/Transaction/ShowController.php b/app/Api/V1/Controllers/Models/Transaction/ShowController.php index f16b37b81a..90942fff14 100644 --- a/app/Api/V1/Controllers/Models/Transaction/ShowController.php +++ b/app/Api/V1/Controllers/Models/Transaction/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\Transaction; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php index b7c7e69a34..b4aca8b763 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/DestroyController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; -use Illuminate\Support\Facades\Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; @@ -32,6 +31,7 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Facades\Validator; use Illuminate\Validation\ValidationException; /** diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php index cd8363c8fe..02bec34c6a 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php index 9fd407ccf4..8f4168ae1e 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Support\Http\Api\AccountFilter; diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php index 01aad04665..bbead26e16 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php @@ -26,7 +26,6 @@ namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionCurrency\StoreRequest; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Support\Http\Api\AccountFilter; use FireflyIII\Support\Http\Api\TransactionFilter; diff --git a/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php b/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php index 1f812f2b18..a45be78c09 100644 --- a/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLink; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionJournalLink; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use FireflyIII\Transformers\TransactionLinkTransformer; diff --git a/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php b/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php index 89219ff30a..2d0b04cba8 100644 --- a/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionLink/StoreController.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLink; -use FireflyIII\Models\TransactionJournal; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLink\StoreRequest; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use FireflyIII\Support\Http\Api\TransactionFilter; diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php index 6ba4e25c4c..a71cfa46e9 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Models\LinkType; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php index ded5d53f8f..65af2aa929 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\LinkType; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use FireflyIII\Support\Http\Api\TransactionFilter; diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php index 7e534e3993..7901c88ec0 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/StoreController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; -use Illuminate\Support\Facades\Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\StoreRequest; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; @@ -33,6 +32,7 @@ use FireflyIII\Support\Http\Api\TransactionFilter; use FireflyIII\Transformers\LinkTypeTransformer; use FireflyIII\User; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Facades\Validator; use Illuminate\Validation\ValidationException; use League\Fractal\Resource\Item; diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php index 2b43fa81df..cf964f259d 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/UpdateController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Models\TransactionLinkType; -use Illuminate\Support\Facades\Validator; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Models\TransactionLinkType\UpdateRequest; use FireflyIII\Exceptions\FireflyException; @@ -35,6 +34,7 @@ use FireflyIII\Support\Http\Api\TransactionFilter; use FireflyIII\Transformers\LinkTypeTransformer; use FireflyIII\User; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Facades\Validator; use Illuminate\Validation\ValidationException; use League\Fractal\Resource\Item; diff --git a/app/Api/V1/Controllers/Search/TransactionController.php b/app/Api/V1/Controllers/Search/TransactionController.php index 10d754891a..040e672934 100644 --- a/app/Api/V1/Controllers/Search/TransactionController.php +++ b/app/Api/V1/Controllers/Search/TransactionController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Search; use FireflyIII\Api\V1\Controllers\Controller; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Support\JsonApi\Enrichments\TransactionGroupEnrichment; use FireflyIII\Support\Search\SearchInterface; use FireflyIII\Transformers\TransactionGroupTransformer; diff --git a/app/Api/V1/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php index 7550d63fb7..6b2acc86eb 100644 --- a/app/Api/V1/Controllers/Summary/BasicController.php +++ b/app/Api/V1/Controllers/Summary/BasicController.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Controllers\Summary; -use Exception; use Carbon\Carbon; +use Exception; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Requests\Data\DateRequest; use FireflyIII\Enums\AccountTypeEnum; diff --git a/app/Api/V1/Controllers/Webhook/ShowController.php b/app/Api/V1/Controllers/Webhook/ShowController.php index b4728e2dee..466f0e8a90 100644 --- a/app/Api/V1/Controllers/Webhook/ShowController.php +++ b/app/Api/V1/Controllers/Webhook/ShowController.php @@ -27,7 +27,6 @@ namespace FireflyIII\Api\V1\Controllers\Webhook; use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Enums\WebhookTrigger; use FireflyIII\Events\RequestedSendWebhookMessages; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Generator\Webhook\MessageGeneratorInterface; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\Webhook; diff --git a/app/Api/V1/Requests/Chart/ChartRequest.php b/app/Api/V1/Requests/Chart/ChartRequest.php index d298a89116..bf43fe47c2 100644 --- a/app/Api/V1/Requests/Chart/ChartRequest.php +++ b/app/Api/V1/Requests/Chart/ChartRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Chart; -use Illuminate\Validation\Validator; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ChartRequest diff --git a/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php b/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php index 6e8f9b285c..3ada80f591 100644 --- a/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/MoveTransactionsRequest.php @@ -24,12 +24,12 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Data\Bulk; -use Illuminate\Validation\Validator; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class MoveTransactionsRequest diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index 46aea15783..14b660d7fe 100644 --- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php @@ -24,8 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Data\Bulk; -use Illuminate\Validation\Validator; -use JsonException; use FireflyIII\Enums\ClauseType; use FireflyIII\Rules\IsValidBulkClause; use FireflyIII\Support\Request\ChecksLogin; @@ -33,7 +31,8 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\Api\Data\Bulk\ValidatesBulkTransactionQuery; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; - +use Illuminate\Validation\Validator; +use JsonException; use function Safe\json_decode; /** diff --git a/app/Api/V1/Requests/Models/Account/ShowRequest.php b/app/Api/V1/Requests/Models/Account/ShowRequest.php index 6d6dcb71c5..f4f7d73332 100644 --- a/app/Api/V1/Requests/Models/Account/ShowRequest.php +++ b/app/Api/V1/Requests/Models/Account/ShowRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Account; -use Illuminate\Validation\Validator; use Carbon\Carbon; use FireflyIII\Models\Account; use FireflyIII\Rules\IsValidSortInstruction; @@ -32,6 +31,7 @@ use FireflyIII\Support\Http\Api\AccountFilter; use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\User; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Validation\Validator; class ShowRequest extends FormRequest { diff --git a/app/Api/V1/Requests/Models/Account/UpdateRequest.php b/app/Api/V1/Requests/Models/Account/UpdateRequest.php index 473e5b8714..dbe30eab1b 100644 --- a/app/Api/V1/Requests/Models/Account/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Account/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Account; -use Illuminate\Validation\Validator; use FireflyIII\Models\Account; use FireflyIII\Models\Location; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -36,6 +35,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/AvailableBudget/Request.php b/app/Api/V1/Requests/Models/AvailableBudget/Request.php index 02cbf088e6..c2ddea145c 100644 --- a/app/Api/V1/Requests/Models/AvailableBudget/Request.php +++ b/app/Api/V1/Requests/Models/AvailableBudget/Request.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\AvailableBudget; -use Illuminate\Validation\Validator; use Carbon\Carbon; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class Request diff --git a/app/Api/V1/Requests/Models/Bill/StoreRequest.php b/app/Api/V1/Requests/Models/Bill/StoreRequest.php index 4b35c5bb2e..393ff54ca3 100644 --- a/app/Api/V1/Requests/Models/Bill/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Bill/StoreRequest.php @@ -24,15 +24,15 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Bill; -use Illuminate\Validation\Validator; -use ValueError; -use TypeError; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; +use TypeError; +use ValueError; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Bill/UpdateRequest.php b/app/Api/V1/Requests/Models/Bill/UpdateRequest.php index f4dd92f9df..8b16cce5e3 100644 --- a/app/Api/V1/Requests/Models/Bill/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Bill/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Bill; -use Illuminate\Validation\Validator; use FireflyIII\Models\Bill; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; @@ -32,6 +31,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/Budget/StoreRequest.php b/app/Api/V1/Requests/Models/Budget/StoreRequest.php index fd36873cbb..9d3a9bc883 100644 --- a/app/Api/V1/Requests/Models/Budget/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Budget/StoreRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Budget; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; @@ -32,6 +31,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Budget/UpdateRequest.php b/app/Api/V1/Requests/Models/Budget/UpdateRequest.php index 870cc3294f..d028906aa4 100644 --- a/app/Api/V1/Requests/Models/Budget/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Budget/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Budget; -use Illuminate\Validation\Validator; use FireflyIII\Models\Budget; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; @@ -33,6 +32,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php b/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php index 5262ab4427..f4ecfa9ac4 100644 --- a/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/BudgetLimit/UpdateRequest.php @@ -24,14 +24,14 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\BudgetLimit; -use FireflyIII\Rules\IsBoolean; -use Illuminate\Validation\Validator; use Carbon\Carbon; +use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByCurrenciesRequest.php b/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByCurrenciesRequest.php index be2bfe8584..b7a8d00159 100644 --- a/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByCurrenciesRequest.php +++ b/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByCurrenciesRequest.php @@ -28,8 +28,8 @@ use Carbon\Carbon; use Carbon\Exceptions\InvalidFormatException; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; -use Illuminate\Validation\Validator; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Validation\Validator; class StoreByCurrenciesRequest extends FormRequest { diff --git a/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByDateRequest.php b/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByDateRequest.php index aa1eb2a5b7..de5dbe94c9 100644 --- a/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByDateRequest.php +++ b/app/Api/V1/Requests/Models/CurrencyExchangeRate/StoreByDateRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate; -use Illuminate\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Support\Facades\Amount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Validation\Validator; class StoreByDateRequest extends FormRequest { diff --git a/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php b/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php index 0810b4ce4b..81acd25bd7 100644 --- a/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php +++ b/app/Api/V1/Requests/Models/PiggyBank/StoreRequest.php @@ -24,15 +24,15 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\PiggyBank; -use Illuminate\Validation\Validator; -use FireflyIII\Support\Facades\Amount; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Rules\IsValidZeroOrMoreAmount; +use FireflyIII\Support\Facades\Amount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php b/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php index 98b15ae55b..387f28f930 100644 --- a/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Recurrence/StoreRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Recurrence; -use Illuminate\Validation\Validator; use FireflyIII\Rules\BelongsUser; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidPositiveAmount; @@ -36,6 +35,7 @@ use FireflyIII\Validation\RecurrenceValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php b/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php index 1b5c1590a4..ea5cbd0f9a 100644 --- a/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Recurrence/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Recurrence; -use Illuminate\Validation\Validator; use FireflyIII\Models\Recurrence; use FireflyIII\Rules\BelongsUser; use FireflyIII\Rules\IsBoolean; @@ -37,6 +36,7 @@ use FireflyIII\Validation\RecurrenceValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/Rule/StoreRequest.php b/app/Api/V1/Requests/Models/Rule/StoreRequest.php index 5f9e0126c8..dd65d648a0 100644 --- a/app/Api/V1/Requests/Models/Rule/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Rule/StoreRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Rule; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidActionExpression; use FireflyIII\Support\Request\ChecksLogin; @@ -32,6 +31,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Rule/UpdateRequest.php b/app/Api/V1/Requests/Models/Rule/UpdateRequest.php index 22880b581a..13a8a97676 100644 --- a/app/Api/V1/Requests/Models/Rule/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Rule/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Rule; -use Illuminate\Validation\Validator; use FireflyIII\Models\Rule; use FireflyIII\Rules\IsBoolean; use FireflyIII\Rules\IsValidActionExpression; @@ -33,6 +32,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/Transaction/StoreRequest.php b/app/Api/V1/Requests/Models/Transaction/StoreRequest.php index 4ad8a851cb..2b54cb977c 100644 --- a/app/Api/V1/Requests/Models/Transaction/StoreRequest.php +++ b/app/Api/V1/Requests/Models/Transaction/StoreRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Transaction; -use Illuminate\Validation\Validator; use FireflyIII\Models\Location; use FireflyIII\Rules\BelongsUser; use FireflyIII\Rules\IsBoolean; @@ -40,6 +39,7 @@ use FireflyIII\Validation\GroupValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php b/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php index 023a48169e..af1b57cb29 100644 --- a/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/Transaction/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\Transaction; -use Illuminate\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionGroup; use FireflyIII\Rules\BelongsUser; @@ -38,6 +37,7 @@ use FireflyIII\Validation\GroupValidation; use FireflyIII\Validation\TransactionValidation; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php b/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php index 693c109d5d..638bda8306 100644 --- a/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php +++ b/app/Api/V1/Requests/Models/TransactionLink/StoreRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\TransactionLink; -use Illuminate\Validation\Validator; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use FireflyIII\Support\Request\ChecksLogin; @@ -32,6 +31,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\User; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class StoreRequest diff --git a/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php b/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php index 71a8090810..0ab51bccd0 100644 --- a/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php +++ b/app/Api/V1/Requests/Models/TransactionLink/UpdateRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\Models\TransactionLink; -use Illuminate\Validation\Validator; use FireflyIII\Models\TransactionJournalLink; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; @@ -32,6 +31,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UpdateRequest diff --git a/app/Api/V1/Requests/System/UserUpdateRequest.php b/app/Api/V1/Requests/System/UserUpdateRequest.php index 03b201b6ad..553f8e54e4 100644 --- a/app/Api/V1/Requests/System/UserUpdateRequest.php +++ b/app/Api/V1/Requests/System/UserUpdateRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests\System; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsBoolean; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\User; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UserUpdateRequest diff --git a/app/Console/Commands/Correction/CorrectsUnevenAmount.php b/app/Console/Commands/Correction/CorrectsUnevenAmount.php index cc34405706..4f6519951c 100644 --- a/app/Console/Commands/Correction/CorrectsUnevenAmount.php +++ b/app/Console/Commands/Correction/CorrectsUnevenAmount.php @@ -35,8 +35,8 @@ use FireflyIII\Support\Models\AccountBalanceCalculator; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; -use ValueError; use stdClass; +use ValueError; class CorrectsUnevenAmount extends Command { diff --git a/app/Console/Commands/Correction/CreatesAccessTokens.php b/app/Console/Commands/Correction/CreatesAccessTokens.php index f73e8d2258..92603c83a6 100644 --- a/app/Console/Commands/Correction/CreatesAccessTokens.php +++ b/app/Console/Commands/Correction/CreatesAccessTokens.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Correction; +use Exception; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Console\Command; -use Exception; class CreatesAccessTokens extends Command { diff --git a/app/Console/Commands/Correction/RemovesEmptyGroups.php b/app/Console/Commands/Correction/RemovesEmptyGroups.php index 2fac48e95b..9058b2f2ab 100644 --- a/app/Console/Commands/Correction/RemovesEmptyGroups.php +++ b/app/Console/Commands/Correction/RemovesEmptyGroups.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Correction; +use Exception; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Models\TransactionGroup; use Illuminate\Console\Command; -use Exception; class RemovesEmptyGroups extends Command { diff --git a/app/Console/Commands/Correction/RemovesOrphanedTransactions.php b/app/Console/Commands/Correction/RemovesOrphanedTransactions.php index 86eadad492..2fd8e94dd2 100644 --- a/app/Console/Commands/Correction/RemovesOrphanedTransactions.php +++ b/app/Console/Commands/Correction/RemovesOrphanedTransactions.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Correction; +use Exception; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use Illuminate\Console\Command; -use Exception; use stdClass; /** diff --git a/app/Console/Commands/Export/ExportsData.php b/app/Console/Commands/Export/ExportsData.php index 18b1df5a34..cd1d53e9f5 100644 --- a/app/Console/Commands/Export/ExportsData.php +++ b/app/Console/Commands/Export/ExportsData.php @@ -24,22 +24,21 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Export; -use FireflyIII\Models\TransactionJournal; use Carbon\Carbon; +use Exception; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Console\Commands\VerifiesAccessToken; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Export\ExportDataGenerator; use Illuminate\Console\Command; use Illuminate\Support\Collection; -use Exception; use Illuminate\Support\Facades\Log; use InvalidArgumentException; - use Safe\Exceptions\FilesystemException; use function Safe\file_put_contents; diff --git a/app/Console/Commands/System/ForcesDecimalSize.php b/app/Console/Commands/System/ForcesDecimalSize.php index 4f1ec2164e..c92183b8c3 100644 --- a/app/Console/Commands/System/ForcesDecimalSize.php +++ b/app/Console/Commands/System/ForcesDecimalSize.php @@ -40,12 +40,10 @@ use FireflyIII\Models\TransactionCurrency; use Illuminate\Console\Command; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; - use Illuminate\Support\Facades\Log; -use function Safe\mb_regex_encoding; use function Safe\json_encode; +use function Safe\mb_regex_encoding; /** * This command was inspired by https://github.com/elliot-gh. It will check all amount fields diff --git a/app/Console/Commands/System/ResetsErrorMailLimit.php b/app/Console/Commands/System/ResetsErrorMailLimit.php index ffba1aad82..c896842a17 100644 --- a/app/Console/Commands/System/ResetsErrorMailLimit.php +++ b/app/Console/Commands/System/ResetsErrorMailLimit.php @@ -28,7 +28,6 @@ namespace FireflyIII\Console\Commands\System; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use Illuminate\Console\Command; use Symfony\Component\Console\Command\Command as CommandAlias; - use function Safe\file_put_contents; use function Safe\json_encode; diff --git a/app/Console/Commands/System/ScansAttachments.php b/app/Console/Commands/System/ScansAttachments.php index 0225cf0008..0e9b8c8128 100644 --- a/app/Console/Commands/System/ScansAttachments.php +++ b/app/Console/Commands/System/ScansAttachments.php @@ -34,7 +34,6 @@ use Illuminate\Support\Facades\Storage; use Safe\Exceptions\FileinfoException; use Safe\Exceptions\FilesystemException; use Safe\Exceptions\StringsException; - use function Safe\file_put_contents; use function Safe\md5_file; use function Safe\mime_content_type; diff --git a/app/Console/Commands/System/VerifySecurityAlerts.php b/app/Console/Commands/System/VerifySecurityAlerts.php index ee739ef9a3..878f762711 100644 --- a/app/Console/Commands/System/VerifySecurityAlerts.php +++ b/app/Console/Commands/System/VerifySecurityAlerts.php @@ -30,7 +30,6 @@ use Illuminate\Database\QueryException; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use League\Flysystem\FilesystemException; - use Safe\Exceptions\JsonException; use function Safe\json_decode; diff --git a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php index 4ffa9a2981..79a8f0bfaf 100644 --- a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php +++ b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; use FireflyIII\Console\Commands\ShowsFriendlyMessages; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface; diff --git a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php index 22b335f8d2..cf66e8cc06 100644 --- a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php +++ b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php @@ -34,7 +34,6 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use JsonException; use stdClass; - use function Safe\json_decode; class RemovesDatabaseDecryption extends Command diff --git a/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php b/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php index c67aae9280..50a9fc71c1 100644 --- a/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php +++ b/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php @@ -24,14 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; -use FireflyIII\Models\TransactionJournal; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Enums\AccountTypeEnum; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; use FireflyIII\Models\AccountMeta; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionCurrency; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; diff --git a/app/Console/Commands/Upgrade/UpgradesDatabase.php b/app/Console/Commands/Upgrade/UpgradesDatabase.php index c2f6912b5a..bbc6c8ee68 100644 --- a/app/Console/Commands/Upgrade/UpgradesDatabase.php +++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php @@ -24,10 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; +use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Support\Facades\FireflyConfig; +use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; use Safe\Exceptions\InfoException; - use function Safe\set_time_limit; try { @@ -36,9 +37,6 @@ try { Log::warning('set_time_limit returned false. This could be an issue, unless you also run XDebug.'); } -use FireflyIII\Console\Commands\ShowsFriendlyMessages; -use Illuminate\Console\Command; - class UpgradesDatabase extends Command { use ShowsFriendlyMessages; diff --git a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php index 82dcb3d160..7ffd859065 100644 --- a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php +++ b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php @@ -29,7 +29,6 @@ use FireflyIII\Models\Recurrence; use FireflyIII\Models\RecurrenceMeta; use FireflyIII\Models\RecurrenceTransactionMeta; use Illuminate\Console\Command; - use function Safe\json_encode; class UpgradesRecurrenceMetaData extends Command diff --git a/app/Console/Commands/Upgrade/UpgradesToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php index 875df04cc4..95fbcf339b 100644 --- a/app/Console/Commands/Upgrade/UpgradesToGroups.php +++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php @@ -25,6 +25,7 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; use Carbon\Carbon; +use Exception; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use FireflyIII\Factory\TransactionGroupFactory; use FireflyIII\Models\Budget; @@ -37,7 +38,6 @@ use FireflyIII\Services\Internal\Destroy\JournalDestroyService; use Illuminate\Console\Command; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; -use Exception; use Illuminate\Support\Facades\Log; class UpgradesToGroups extends Command diff --git a/app/Exceptions/GracefulNotFoundHandler.php b/app/Exceptions/GracefulNotFoundHandler.php index 762da63c55..6f905adb22 100644 --- a/app/Exceptions/GracefulNotFoundHandler.php +++ b/app/Exceptions/GracefulNotFoundHandler.php @@ -34,8 +34,8 @@ use FireflyIII\User; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; -use Symfony\Component\HttpFoundation\Response; use Override; +use Symfony\Component\HttpFoundation\Response; use Throwable; /** diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 3bde465581..f160030059 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -24,8 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Exceptions; -use Carbon\Carbon; use Brick\Math\Exception\NumberFormatException; +use Carbon\Carbon; +use ErrorException; use FireflyIII\Jobs\MailError; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Auth\AuthenticationException; @@ -40,16 +41,14 @@ use Illuminate\Support\Facades\Log; use Illuminate\Validation\ValidationException as LaravelValidationException; use Laravel\Passport\Exceptions\OAuthServerException as LaravelOAuthException; use League\OAuth2\Server\Exception\OAuthServerException; +use Override; use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use ErrorException; -use Override; use Throwable; - use function Safe\json_encode; use function Safe\parse_url; diff --git a/app/Exceptions/IntervalException.php b/app/Exceptions/IntervalException.php index 45fe7cddfb..4b6396ad19 100644 --- a/app/Exceptions/IntervalException.php +++ b/app/Exceptions/IntervalException.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Exceptions; -use FireflyIII\Support\Calendar\Periodicity; use Exception; +use FireflyIII\Support\Calendar\Periodicity; use Throwable; /** diff --git a/app/Factory/BillFactory.php b/app/Factory/BillFactory.php index 1fe4567134..fb284ae921 100644 --- a/app/Factory/BillFactory.php +++ b/app/Factory/BillFactory.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Factory; -use FireflyIII\Models\ObjectGroup; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Bill; +use FireflyIII\Models\ObjectGroup; use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups; use FireflyIII\Services\Internal\Support\BillServiceTrait; use FireflyIII\User; diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.php index b31056b10f..2cf4d35a68 100644 --- a/app/Factory/PiggyBankFactory.php +++ b/app/Factory/PiggyBankFactory.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Factory; -use FireflyIII\Models\ObjectGroup; -use FireflyIII\Models\Account; use FireflyIII\Events\Model\PiggyBank\ChangedAmount; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\Account; +use FireflyIII\Models\ObjectGroup; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -36,7 +36,6 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\User; use Illuminate\Database\QueryException; use Illuminate\Support\Facades\Log; - use function Safe\json_encode; /** diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index 1c7f354c34..5f218c5d3f 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -24,15 +24,16 @@ declare(strict_types=1); namespace FireflyIII\Factory; -use FireflyIII\Models\Bill; -use FireflyIII\Models\PiggyBank; use Carbon\Carbon; +use Exception; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\DuplicateTransactionException; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; +use FireflyIII\Models\Bill; use FireflyIII\Models\Location; +use FireflyIII\Models\PiggyBank; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionJournal; @@ -53,9 +54,7 @@ use FireflyIII\User; use FireflyIII\Validation\AccountValidator; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; -use Exception; use JsonException; - use function Safe\json_encode; /** diff --git a/app/Handlers/Events/APIEventHandler.php b/app/Handlers/Events/APIEventHandler.php index 7d59a4b636..de67afd8e8 100644 --- a/app/Handlers/Events/APIEventHandler.php +++ b/app/Handlers/Events/APIEventHandler.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; +use Exception; use FireflyIII\Notifications\User\NewAccessToken; use FireflyIII\Repositories\User\UserRepositoryInterface; use Illuminate\Support\Facades\Notification; use Laravel\Passport\Events\AccessTokenCreated; -use Exception; /** * Class APIEventHandler diff --git a/app/Handlers/Events/AdminEventHandler.php b/app/Handlers/Events/AdminEventHandler.php index 6619763806..d3a9a1e73e 100644 --- a/app/Handlers/Events/AdminEventHandler.php +++ b/app/Handlers/Events/AdminEventHandler.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; +use Exception; use FireflyIII\Events\Admin\InvitationCreated; use FireflyIII\Events\NewVersionAvailable; use FireflyIII\Events\Security\UnknownUserAttemptedLogin; @@ -36,7 +37,6 @@ use FireflyIII\Notifications\Test\OwnerTestNotificationPushover; use FireflyIII\Notifications\Test\OwnerTestNotificationSlack; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Notification; -use Exception; /** * Class AdminEventHandler. diff --git a/app/Handlers/Events/AutomationHandler.php b/app/Handlers/Events/AutomationHandler.php index 11b11a7b65..7a59a78a10 100644 --- a/app/Handlers/Events/AutomationHandler.php +++ b/app/Handlers/Events/AutomationHandler.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; +use Exception; use FireflyIII\Events\RequestedReportOnJournals; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionGroup; @@ -31,7 +32,6 @@ use FireflyIII\Notifications\User\TransactionCreation; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Transformers\TransactionGroupTransformer; use Illuminate\Support\Facades\Notification; -use Exception; /** * Class AutomationHandler diff --git a/app/Handlers/Events/BillEventHandler.php b/app/Handlers/Events/BillEventHandler.php index 9969bfbf1c..aef9cb49d2 100644 --- a/app/Handlers/Events/BillEventHandler.php +++ b/app/Handlers/Events/BillEventHandler.php @@ -33,7 +33,6 @@ use FireflyIII\Notifications\User\SubscriptionsOverdueReminder; use FireflyIII\Support\Facades\Preferences; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Notification; - use function Safe\json_encode; /** diff --git a/app/Handlers/Events/Model/PiggyBankEventHandler.php b/app/Handlers/Events/Model/PiggyBankEventHandler.php index cea67d76b0..b44c9e4741 100644 --- a/app/Handlers/Events/Model/PiggyBankEventHandler.php +++ b/app/Handlers/Events/Model/PiggyBankEventHandler.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events\Model; +use FireflyIII\Events\Model\PiggyBank\ChangedAmount; use FireflyIII\Events\Model\PiggyBank\ChangedName; use FireflyIII\Models\Account; +use FireflyIII\Models\PiggyBankEvent; use FireflyIII\Models\Rule; use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionGroup; -use FireflyIII\Events\Model\PiggyBank\ChangedAmount; -use FireflyIII\Models\PiggyBankEvent; /** * Class PiggyBankEventHandler diff --git a/app/Handlers/Events/Security/MFAHandler.php b/app/Handlers/Events/Security/MFAHandler.php index a259a742e2..f3b6dab533 100644 --- a/app/Handlers/Events/Security/MFAHandler.php +++ b/app/Handlers/Events/Security/MFAHandler.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events\Security; +use Exception; use FireflyIII\Events\Security\DisabledMFA; use FireflyIII\Events\Security\EnabledMFA; use FireflyIII\Events\Security\MFABackupFewLeft; @@ -39,7 +40,6 @@ use FireflyIII\Notifications\Security\MFAManyFailedAttemptsNotification; use FireflyIII\Notifications\Security\MFAUsedBackupCodeNotification; use FireflyIII\Notifications\Security\NewBackupCodesNotification; use Illuminate\Support\Facades\Notification; -use Exception; class MFAHandler { diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index 775cdc878e..39271d86a2 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -25,6 +25,7 @@ namespace FireflyIII\Handlers\Events; use Carbon\Carbon; use Database\Seeders\ExchangeRateSeeder; +use Exception; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Events\ActuallyLoggedIn; use FireflyIII\Events\Admin\InvitationCreated; @@ -55,7 +56,6 @@ use Illuminate\Auth\Events\Login; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Notification; -use Exception; /** * Class UserEventHandler. diff --git a/app/Handlers/Events/VersionCheckEventHandler.php b/app/Handlers/Events/VersionCheckEventHandler.php index 1d663855b0..2087d37f76 100644 --- a/app/Handlers/Events/VersionCheckEventHandler.php +++ b/app/Handlers/Events/VersionCheckEventHandler.php @@ -23,8 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Events\RequestedVersionCheckStatus; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Update\UpdateTrait; diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index 846be0c312..ef0cf558d2 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -27,7 +27,6 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Attachment; use FireflyIII\Models\PiggyBank; use Illuminate\Contracts\Encryption\DecryptException; -use Illuminate\Contracts\Encryption\EncryptException; use Illuminate\Contracts\Filesystem\Filesystem; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; @@ -39,13 +38,11 @@ use Safe\Exceptions\FileinfoException; use Safe\Exceptions\FilesystemException; use Safe\Exceptions\StringsException; use Symfony\Component\HttpFoundation\File\UploadedFile; - -use function Safe\tmpfile; -use function Safe\fwrite; -use function Safe\finfo_open; use function Safe\fclose; +use function Safe\finfo_open; +use function Safe\fwrite; use function Safe\md5_file; - +use function Safe\tmpfile; use const DIRECTORY_SEPARATOR; /** diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php index 11a15ef799..40185ef81c 100644 --- a/app/Helpers/Collector/Extensions/MetaCollection.php +++ b/app/Helpers/Collector/Extensions/MetaCollection.php @@ -36,7 +36,6 @@ use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; - use function Safe\json_encode; /** diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 0dd40ee445..db4834fbf2 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -47,7 +47,6 @@ use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Override; - use Safe\Exceptions\JsonException; use function Safe\json_decode; diff --git a/app/Helpers/Report/NetWorth.php b/app/Helpers/Report/NetWorth.php index bb58b8761b..0ea1ce6cfe 100644 --- a/app/Helpers/Report/NetWorth.php +++ b/app/Helpers/Report/NetWorth.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Report; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; diff --git a/app/Helpers/Report/NetWorthInterface.php b/app/Helpers/Report/NetWorthInterface.php index 466a055a4c..421caa9a74 100644 --- a/app/Helpers/Report/NetWorthInterface.php +++ b/app/Helpers/Report/NetWorthInterface.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Report; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Models\UserGroup; use FireflyIII\User; use Illuminate\Contracts\Auth\Authenticatable; diff --git a/app/Helpers/Webhook/Sha3SignatureGenerator.php b/app/Helpers/Webhook/Sha3SignatureGenerator.php index 06967cff04..ce6a0680f7 100644 --- a/app/Helpers/Webhook/Sha3SignatureGenerator.php +++ b/app/Helpers/Webhook/Sha3SignatureGenerator.php @@ -28,7 +28,6 @@ use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\WebhookMessage; use JsonException; - use function Safe\json_encode; /** diff --git a/app/Http/Controllers/Account/CreateController.php b/app/Http/Controllers/Account/CreateController.php index e0cb55afc7..e884c7c5cc 100644 --- a/app/Http/Controllers/Account/CreateController.php +++ b/app/Http/Controllers/Account/CreateController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Account; use FireflyIII\Enums\AccountTypeEnum; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\AccountFormRequest; diff --git a/app/Http/Controllers/Account/EditController.php b/app/Http/Controllers/Account/EditController.php index 7d172bead1..8c2d083b13 100644 --- a/app/Http/Controllers/Account/EditController.php +++ b/app/Http/Controllers/Account/EditController.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Account; -use FireflyIII\Models\Location; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\AccountFormRequest; use FireflyIII\Models\Account; +use FireflyIII\Models\Location; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Http\Controllers\ModelInformation; use Illuminate\Contracts\View\Factory; diff --git a/app/Http/Controllers/Account/IndexController.php b/app/Http/Controllers/Account/IndexController.php index 66844d8ad2..8d35f6b56e 100644 --- a/app/Http/Controllers/Account/IndexController.php +++ b/app/Http/Controllers/Account/IndexController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Account; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index b06fc9a007..2741d94812 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -27,7 +27,6 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Requests\AttachmentFormRequest; use FireflyIII\Models\Attachment; use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; -use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\Contracts\View\Factory; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 1b3607259c..c9d54c0982 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -36,7 +36,6 @@ use Illuminate\View\View; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\UrlException; - use function Safe\parse_url; /** diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 01b25bbd19..6e4bba5669 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -24,8 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Auth; use Carbon\Carbon; -use FireflyIII\User; -use Illuminate\Support\Facades\Cookie; use FireflyIII\Events\ActuallyLoggedIn; use FireflyIII\Events\Security\UnknownUserAttemptedLogin; use FireflyIII\Events\Security\UserAttemptedLogin; @@ -33,6 +31,7 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Providers\RouteServiceProvider; use FireflyIII\Repositories\User\UserRepositoryInterface; +use FireflyIII\User; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\View; @@ -43,6 +42,7 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Routing\Redirector; +use Illuminate\Support\Facades\Cookie; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Validation\ValidationException; diff --git a/app/Http/Controllers/Bill/IndexController.php b/app/Http/Controllers/Bill/IndexController.php index 1725bad953..3896db77af 100644 --- a/app/Http/Controllers/Bill/IndexController.php +++ b/app/Http/Controllers/Bill/IndexController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Bill; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Bill; use FireflyIII\Repositories\Bill\BillRepositoryInterface; diff --git a/app/Http/Controllers/Budget/EditController.php b/app/Http/Controllers/Budget/EditController.php index a3969e6d7d..6b0f820e20 100644 --- a/app/Http/Controllers/Budget/EditController.php +++ b/app/Http/Controllers/Budget/EditController.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Budget; -use FireflyIII\Models\AutoBudget; use FireflyIII\Enums\AutoBudgetType; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\BudgetFormUpdateRequest; +use FireflyIII\Models\AutoBudget; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use Illuminate\Contracts\View\Factory; diff --git a/app/Http/Controllers/Budget/ShowController.php b/app/Http/Controllers/Budget/ShowController.php index c28e7455e8..77158fb699 100644 --- a/app/Http/Controllers/Budget/ShowController.php +++ b/app/Http/Controllers/Budget/ShowController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Budget; -use FireflyIII\Models\TransactionJournal; use Carbon\Carbon; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -32,6 +31,7 @@ use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Budget; use FireflyIII\Models\BudgetLimit; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Http\Controllers\AugumentData; diff --git a/app/Http/Controllers/Category/NoCategoryController.php b/app/Http/Controllers/Category/NoCategoryController.php index 609f351a46..065214b856 100644 --- a/app/Http/Controllers/Category/NoCategoryController.php +++ b/app/Http/Controllers/Category/NoCategoryController.php @@ -24,12 +24,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Category; -use FireflyIII\Models\TransactionJournal; use Carbon\Carbon; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Http\Controllers\PeriodOverview; use Illuminate\Contracts\View\Factory; diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 632589163f..9e0e34851c 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -44,7 +44,6 @@ use FireflyIII\Support\Http\Controllers\DateCalculation; use Illuminate\Http\JsonResponse; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; - use Safe\Exceptions\JsonException; use function Safe\json_encode; diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index d79700c4a2..1d3665b548 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Generator\Chart\Basic\GeneratorInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Category; diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index 1321de9eea..065cc16f49 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Chart; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Generator\Chart\Basic\GeneratorInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\PiggyBank; diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 0919f8c199..daba3dbeae 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -36,11 +36,10 @@ use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Log; -use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\Route; - -use function Safe\realpath; +use Illuminate\Support\Facades\View; use function Safe\ini_get; +use function Safe\realpath; /** * Class Controller. diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index 1ed00b4710..f83dfb0f37 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -51,10 +51,8 @@ use Illuminate\View\View; use Monolog\Handler\RotatingFileHandler; use Safe\Exceptions\FilesystemException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; - use function Safe\file_get_contents; use function Safe\ini_get; - use const PHP_INT_SIZE; use const PHP_SAPI; diff --git a/app/Http/Controllers/Export/IndexController.php b/app/Http/Controllers/Export/IndexController.php index 3167f65525..3089c4ac35 100644 --- a/app/Http/Controllers/Export/IndexController.php +++ b/app/Http/Controllers/Export/IndexController.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Export; use Carbon\Carbon; -use FireflyIII\Models\TransactionJournal; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Middleware\IsDemoUser; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Export\ExportDataGenerator; use Illuminate\Contracts\View\Factory; diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 3ab394545e..e72c691d41 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -23,9 +23,9 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use Exception; use Carbon\Carbon; use Carbon\Exceptions\InvalidFormatException; +use Exception; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Events\RequestedVersionCheckStatus; use FireflyIII\Exceptions\FireflyException; diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.php index cd845df963..d202a80af0 100644 --- a/app/Http/Controllers/Json/BoxController.php +++ b/app/Http/Controllers/Json/BoxController.php @@ -23,8 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Helpers\Collector\GroupCollectorInterface; diff --git a/app/Http/Controllers/Json/BudgetController.php b/app/Http/Controllers/Json/BudgetController.php index 23a687ed46..6a0b494194 100644 --- a/app/Http/Controllers/Json/BudgetController.php +++ b/app/Http/Controllers/Json/BudgetController.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use FireflyIII\Models\AvailableBudget; use Carbon\Carbon; use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\AvailableBudget; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface; diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php index f66864866b..a51499cfc2 100644 --- a/app/Http/Controllers/Json/FrontpageController.php +++ b/app/Http/Controllers/Json/FrontpageController.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\PiggyBank; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Illuminate\Http\JsonResponse; +use Throwable; /** * Class FrontpageController. diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.php index a08c32b6be..8d1aa947a8 100644 --- a/app/Http/Controllers/Json/IntroController.php +++ b/app/Http/Controllers/Json/IntroController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Support\Http\Controllers\GetConfigurationData; use Illuminate\Http\JsonResponse; diff --git a/app/Http/Controllers/Json/ReconcileController.php b/app/Http/Controllers/Json/ReconcileController.php index a1208182e8..3d88bb0a88 100644 --- a/app/Http/Controllers/Json/ReconcileController.php +++ b/app/Http/Controllers/Json/ReconcileController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Throwable; use Carbon\Carbon; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -38,6 +37,7 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; +use Throwable; /** * Class ReconcileController diff --git a/app/Http/Controllers/Json/RuleController.php b/app/Http/Controllers/Json/RuleController.php index a555015150..1826cd0a80 100644 --- a/app/Http/Controllers/Json/RuleController.php +++ b/app/Http/Controllers/Json/RuleController.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Json; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; +use Throwable; /** * Class RuleController diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index 8350216064..e1c70c78f4 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -23,10 +23,9 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use FireflyIII\Models\TransactionCurrency; use FireflyIII\Enums\AccountTypeEnum; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Requests\NewUserFormRequest; +use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Support\Http\Controllers\CreateStuff; diff --git a/app/Http/Controllers/PiggyBank/IndexController.php b/app/Http/Controllers/PiggyBank/IndexController.php index 69bbd38780..199d90a3a8 100644 --- a/app/Http/Controllers/PiggyBank/IndexController.php +++ b/app/Http/Controllers/PiggyBank/IndexController.php @@ -25,7 +25,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\PiggyBank; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Account; use FireflyIII\Models\PiggyBank; diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 7a22b91c06..723998cd3f 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -23,8 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use FireflyIII\Support\Singleton\PreferencesSingleton; -use JsonException; use Carbon\Carbon; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Events\Preferences\UserGroupChangedPrimaryCurrency; @@ -35,6 +33,7 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Preference; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Facades\Preferences; +use FireflyIII\Support\Singleton\PreferencesSingleton; use FireflyIII\User; use Illuminate\Contracts\View\Factory; use Illuminate\Http\RedirectResponse; @@ -42,10 +41,10 @@ use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use Illuminate\View\View; - +use JsonException; use Safe\Exceptions\FilesystemException; -use function Safe\json_decode; use function Safe\file_get_contents; +use function Safe\json_decode; /** * Class PreferencesController. diff --git a/app/Http/Controllers/Profile/MfaController.php b/app/Http/Controllers/Profile/MfaController.php index 69537bd12f..7959f1cd54 100644 --- a/app/Http/Controllers/Profile/MfaController.php +++ b/app/Http/Controllers/Profile/MfaController.php @@ -24,13 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Profile; -use Illuminate\Support\Facades\Cookie; -use PragmaRX\Google2FALaravel\Facade as Google2FA; use Carbon\Carbon; use FireflyIII\Events\Security\DisabledMFA; use FireflyIII\Events\Security\EnabledMFA; use FireflyIII\Events\Security\MFANewBackupCodes; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Requests\ExistingTokenFormRequest; @@ -41,8 +38,10 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Routing\Redirector; +use Illuminate\Support\Facades\Cookie; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use PragmaRX\Google2FALaravel\Facade as Google2FA; use PragmaRX\Recovery\Recovery; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 7eb2e745cf..33f8b41866 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -24,8 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; use Exception; -use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Facades\Hash; use FireflyIII\Events\UserChangedEmail; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\ValidationException; @@ -45,7 +43,9 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Hash; use Illuminate\View\View; use Laravel\Passport\ClientRepository; use Psr\Container\ContainerExceptionInterface; diff --git a/app/Http/Controllers/Report/AccountController.php b/app/Http/Controllers/Report/AccountController.php index dcd9464ce3..c6818cd9c6 100644 --- a/app/Http/Controllers/Report/AccountController.php +++ b/app/Http/Controllers/Report/AccountController.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; +use Throwable; /** * Class AccountController. diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php index 41b3010a4a..3764008f2a 100644 --- a/app/Http/Controllers/Report/BalanceController.php +++ b/app/Http/Controllers/Report/BalanceController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -33,6 +32,7 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use Illuminate\Support\Collection; +use Throwable; /** * Class BalanceController. diff --git a/app/Http/Controllers/Report/BillController.php b/app/Http/Controllers/Report/BillController.php index 1fd70e3c48..9cea9f5edd 100644 --- a/app/Http/Controllers/Report/BillController.php +++ b/app/Http/Controllers/Report/BillController.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Report\ReportHelperInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; +use Throwable; /** * Class BillController diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php index a59076ab9a..29c802bb96 100644 --- a/app/Http/Controllers/Report/BudgetController.php +++ b/app/Http/Controllers/Report/BudgetController.php @@ -23,8 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use FireflyIII\Support\Facades\Navigation; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -32,11 +30,13 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Budget; use FireflyIII\Repositories\Budget\OperationsRepositoryInterface; use FireflyIII\Support\CacheProperties; +use FireflyIII\Support\Facades\Navigation; use FireflyIII\Support\Http\Controllers\BasicDataSupport; use FireflyIII\Support\Report\Budget\BudgetReportGenerator; use Illuminate\Contracts\View\Factory; use Illuminate\Support\Collection; use Illuminate\View\View; +use Throwable; /** * Class BudgetController. diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php index fc8d17421a..1ae30d59e8 100644 --- a/app/Http/Controllers/Report/CategoryController.php +++ b/app/Http/Controllers/Report/CategoryController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -37,6 +36,7 @@ use FireflyIII\Support\Report\Category\CategoryReportGenerator; use Illuminate\Contracts\View\Factory; use Illuminate\Support\Collection; use Illuminate\View\View; +use Throwable; /** * Class CategoryController. diff --git a/app/Http/Controllers/Report/DoubleController.php b/app/Http/Controllers/Report/DoubleController.php index 32a1736844..ffe0545273 100644 --- a/app/Http/Controllers/Report/DoubleController.php +++ b/app/Http/Controllers/Report/DoubleController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -34,6 +33,7 @@ use FireflyIII\Support\Http\Controllers\AugumentData; use Illuminate\Contracts\View\Factory; use Illuminate\Support\Collection; use Illuminate\View\View; +use Throwable; /** * Class DoubleController diff --git a/app/Http/Controllers/Report/OperationsController.php b/app/Http/Controllers/Report/OperationsController.php index d2aaeaa3dd..e4f10fc574 100644 --- a/app/Http/Controllers/Report/OperationsController.php +++ b/app/Http/Controllers/Report/OperationsController.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; +use Throwable; /** * Class OperationsController. diff --git a/app/Http/Controllers/Report/TagController.php b/app/Http/Controllers/Report/TagController.php index 22bca3fd99..4eaeb46e90 100644 --- a/app/Http/Controllers/Report/TagController.php +++ b/app/Http/Controllers/Report/TagController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Report; -use Throwable; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; @@ -34,6 +33,7 @@ use FireflyIII\Repositories\Tag\OperationsRepositoryInterface; use Illuminate\Contracts\View\Factory; use Illuminate\Support\Collection; use Illuminate\View\View; +use Throwable; /** * Class TagController diff --git a/app/Http/Controllers/Rule/CreateController.php b/app/Http/Controllers/Rule/CreateController.php index 107042d458..24c9c8bd64 100644 --- a/app/Http/Controllers/Rule/CreateController.php +++ b/app/Http/Controllers/Rule/CreateController.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Rule; -use FireflyIII\Models\Rule; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\RuleFormRequest; use FireflyIII\Models\Bill; +use FireflyIII\Models\Rule; use FireflyIII\Models\RuleGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Rule\RuleRepositoryInterface; diff --git a/app/Http/Controllers/Rule/EditController.php b/app/Http/Controllers/Rule/EditController.php index 848fa259a3..f1888c425d 100644 --- a/app/Http/Controllers/Rule/EditController.php +++ b/app/Http/Controllers/Rule/EditController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Rule; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\RuleFormRequest; @@ -39,6 +38,7 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\View\View; +use Throwable; /** * Class EditController diff --git a/app/Http/Controllers/Rule/SelectController.php b/app/Http/Controllers/Rule/SelectController.php index 4d85f8ae3d..1084a9f2c8 100644 --- a/app/Http/Controllers/Rule/SelectController.php +++ b/app/Http/Controllers/Rule/SelectController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Rule; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\SelectTransactionsRequest; @@ -39,6 +38,7 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Collection; use Illuminate\View\View; +use Throwable; /** * Class SelectController. diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index b30d1eefad..39fa3cea10 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use Throwable; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\Rule\RuleRepositoryInterface; use FireflyIII\Support\Search\SearchInterface; @@ -31,6 +30,7 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\View\View; +use Throwable; /** * Class SearchController. diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index cd800053d4..48ff8a64b0 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -24,20 +24,19 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\System; -use FireflyIII\Support\Facades\FireflyConfig; -use Illuminate\Support\Facades\Artisan; -use Illuminate\Support\Facades\Cache; use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Support\Facades\FireflyConfig; use FireflyIII\Support\Http\Controllers\GetConfigurationData; use Illuminate\Contracts\View\Factory; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Artisan; +use Illuminate\Support\Facades\Cache; use Illuminate\View\View; use Laravel\Passport\Passport; use phpseclib3\Crypt\RSA; - use function Safe\file_put_contents; /** diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 0fd2ef0336..d062801d47 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; -use FireflyIII\Models\Location; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Http\Requests\TagFormRequest; +use FireflyIII\Models\Location; use FireflyIII\Models\Tag; use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Support\Http\Controllers\PeriodOverview; diff --git a/app/Http/Controllers/Transaction/ConvertController.php b/app/Http/Controllers/Transaction/ConvertController.php index ec211a9b0d..bb5aa6f7d6 100644 --- a/app/Http/Controllers/Transaction/ConvertController.php +++ b/app/Http/Controllers/Transaction/ConvertController.php @@ -23,8 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; -use FireflyIII\Models\Transaction; -use FireflyIII\Models\TransactionCurrency; use Exception; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; @@ -32,6 +30,8 @@ use FireflyIII\Events\UpdatedTransactionGroup; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Account; +use FireflyIII\Models\Transaction; +use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php index 1fc030e5e9..71012d3565 100644 --- a/app/Http/Controllers/Transaction/CreateController.php +++ b/app/Http/Controllers/Transaction/CreateController.php @@ -24,10 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; -use FireflyIII\Models\TransactionGroup; use FireflyIII\Events\StoredTransactionGroup; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\TransactionGroup; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface; use FireflyIII\Services\Internal\Update\GroupCloneService; @@ -36,7 +35,6 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\View; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; - use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\UrlException; diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php index 2fa41b6de9..dcf9e36ca3 100644 --- a/app/Http/Controllers/Transaction/EditController.php +++ b/app/Http/Controllers/Transaction/EditController.php @@ -34,7 +34,6 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Routing\Redirector; use Illuminate\View\View; - use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\UrlException; diff --git a/app/Http/Controllers/Transaction/IndexController.php b/app/Http/Controllers/Transaction/IndexController.php index 92f67137c6..e0d2c83359 100644 --- a/app/Http/Controllers/Transaction/IndexController.php +++ b/app/Http/Controllers/Transaction/IndexController.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; -use FireflyIII\Models\TransactionJournal; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Http\Controllers\PeriodOverview; use Illuminate\Contracts\View\Factory; diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php index bb7f4609ae..7fde459a35 100644 --- a/app/Http/Controllers/Transaction/MassController.php +++ b/app/Http/Controllers/Transaction/MassController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; -use InvalidArgumentException; use Carbon\Carbon; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; @@ -42,6 +41,7 @@ use Illuminate\Http\RedirectResponse; use Illuminate\Routing\Redirector; use Illuminate\Support\Facades\Log; use Illuminate\View\View as IlluminateView; +use InvalidArgumentException; /** * Class MassController. diff --git a/app/Http/Controllers/TransactionCurrency/CreateController.php b/app/Http/Controllers/TransactionCurrency/CreateController.php index 2e7372b213..89febb82b5 100644 --- a/app/Http/Controllers/TransactionCurrency/CreateController.php +++ b/app/Http/Controllers/TransactionCurrency/CreateController.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\TransactionCurrency; -use FireflyIII\Models\TransactionCurrency; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\CurrencyFormRequest; +use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; diff --git a/app/Http/Middleware/AcceptHeaders.php b/app/Http/Middleware/AcceptHeaders.php index d8884aebf3..c8b8749ad8 100644 --- a/app/Http/Middleware/AcceptHeaders.php +++ b/app/Http/Middleware/AcceptHeaders.php @@ -29,7 +29,6 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; use Safe\Exceptions\PcreException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; - use function Safe\preg_match; class AcceptHeaders diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index a9e7a705cd..47bcf126e2 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -23,14 +23,14 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Closure; -use FireflyIII\Support\Facades\Steam; -use Illuminate\Support\Facades\App; use Carbon\Carbon; +use Closure; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Facades\Amount; +use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Http\Controllers\RequestInformation; use Illuminate\Http\Request; +use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Log; /** diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php index 5f8b104992..246a9bf4a3 100644 --- a/app/Http/Middleware/SecureHeaders.php +++ b/app/Http/Middleware/SecureHeaders.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; +use Barryvdh\Debugbar\Facades\Debugbar; use Closure; use Exception; -use Barryvdh\Debugbar\Facades\Debugbar; use Illuminate\Http\Request; use Illuminate\Support\Facades\Vite; diff --git a/app/Http/Middleware/StartFireflySession.php b/app/Http/Middleware/StartFireflySession.php index 922bc3ad8c..02aab37b34 100644 --- a/app/Http/Middleware/StartFireflySession.php +++ b/app/Http/Middleware/StartFireflySession.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Override; use Illuminate\Contracts\Session\Session; use Illuminate\Http\Request; use Illuminate\Session\Middleware\StartSession; +use Override; /** * Class StartFireflySession. diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php index 4446201045..e41086a8db 100644 --- a/app/Http/Middleware/TrustHosts.php +++ b/app/Http/Middleware/TrustHosts.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Http\Middleware; -use Override; use Illuminate\Http\Middleware\TrustHosts as Middleware; +use Override; class TrustHosts extends Middleware { diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index ced11547e0..9cd8d51163 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Models\Account; use FireflyIII\Models\Location; @@ -34,6 +33,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class AccountFormRequest. diff --git a/app/Http/Requests/AttachmentFormRequest.php b/app/Http/Requests/AttachmentFormRequest.php index f2b4beb568..f481510ee6 100644 --- a/app/Http/Requests/AttachmentFormRequest.php +++ b/app/Http/Requests/AttachmentFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class AttachmentFormRequest. diff --git a/app/Http/Requests/BillStoreRequest.php b/app/Http/Requests/BillStoreRequest.php index 46436a7c9d..37e9f7ef02 100644 --- a/app/Http/Requests/BillStoreRequest.php +++ b/app/Http/Requests/BillStoreRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class BillStoreRequest. diff --git a/app/Http/Requests/BillUpdateRequest.php b/app/Http/Requests/BillUpdateRequest.php index 2f70b26df3..cde6978364 100644 --- a/app/Http/Requests/BillUpdateRequest.php +++ b/app/Http/Requests/BillUpdateRequest.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\Bill; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class BillUpdateRequest. diff --git a/app/Http/Requests/BudgetFormStoreRequest.php b/app/Http/Requests/BudgetFormStoreRequest.php index ac4edf6e69..86779d3794 100644 --- a/app/Http/Requests/BudgetFormStoreRequest.php +++ b/app/Http/Requests/BudgetFormStoreRequest.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class BudgetFormStoreRequest diff --git a/app/Http/Requests/BudgetFormUpdateRequest.php b/app/Http/Requests/BudgetFormUpdateRequest.php index 539e613fff..cdebd759e7 100644 --- a/app/Http/Requests/BudgetFormUpdateRequest.php +++ b/app/Http/Requests/BudgetFormUpdateRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\Budget; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; @@ -31,6 +30,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class BudgetFormUpdateRequest diff --git a/app/Http/Requests/BudgetIncomeRequest.php b/app/Http/Requests/BudgetIncomeRequest.php index 49ed18de14..d75f81faa9 100644 --- a/app/Http/Requests/BudgetIncomeRequest.php +++ b/app/Http/Requests/BudgetIncomeRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsValidPositiveAmount; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class BudgetIncomeRequest. diff --git a/app/Http/Requests/BulkEditJournalRequest.php b/app/Http/Requests/BulkEditJournalRequest.php index 169d1bc6ce..4bbaafa77b 100644 --- a/app/Http/Requests/BulkEditJournalRequest.php +++ b/app/Http/Requests/BulkEditJournalRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class MassEditBulkJournalRequest. diff --git a/app/Http/Requests/CategoryFormRequest.php b/app/Http/Requests/CategoryFormRequest.php index a4e5112669..8ca3455168 100644 --- a/app/Http/Requests/CategoryFormRequest.php +++ b/app/Http/Requests/CategoryFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\Category; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class CategoryFormRequest. diff --git a/app/Http/Requests/ConfigurationRequest.php b/app/Http/Requests/ConfigurationRequest.php index 712d2be5a4..57f8a969b4 100644 --- a/app/Http/Requests/ConfigurationRequest.php +++ b/app/Http/Requests/ConfigurationRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ConfigurationRequest. diff --git a/app/Http/Requests/CurrencyFormRequest.php b/app/Http/Requests/CurrencyFormRequest.php index 60ce09cbba..959678e64c 100644 --- a/app/Http/Requests/CurrencyFormRequest.php +++ b/app/Http/Requests/CurrencyFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class CurrencyFormRequest. diff --git a/app/Http/Requests/DeleteAccountFormRequest.php b/app/Http/Requests/DeleteAccountFormRequest.php index eb36622b3a..31222e084a 100644 --- a/app/Http/Requests/DeleteAccountFormRequest.php +++ b/app/Http/Requests/DeleteAccountFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class DeleteAccountFormRequest. diff --git a/app/Http/Requests/EmailFormRequest.php b/app/Http/Requests/EmailFormRequest.php index 1f499245eb..cd4369f3ec 100644 --- a/app/Http/Requests/EmailFormRequest.php +++ b/app/Http/Requests/EmailFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class EmailFormRequest. diff --git a/app/Http/Requests/ExistingTokenFormRequest.php b/app/Http/Requests/ExistingTokenFormRequest.php index f3222a8d57..b843012fba 100644 --- a/app/Http/Requests/ExistingTokenFormRequest.php +++ b/app/Http/Requests/ExistingTokenFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ExistingTokenFormRequest. diff --git a/app/Http/Requests/InviteUserFormRequest.php b/app/Http/Requests/InviteUserFormRequest.php index 70ebad1f19..2c31d965ce 100644 --- a/app/Http/Requests/InviteUserFormRequest.php +++ b/app/Http/Requests/InviteUserFormRequest.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class InviteUserFormRequest diff --git a/app/Http/Requests/JournalLinkRequest.php b/app/Http/Requests/JournalLinkRequest.php index 487b47f91c..185aaea191 100644 --- a/app/Http/Requests/JournalLinkRequest.php +++ b/app/Http/Requests/JournalLinkRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\LinkType; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class JournalLink. diff --git a/app/Http/Requests/LinkTypeFormRequest.php b/app/Http/Requests/LinkTypeFormRequest.php index bc0a56c933..3fb7511c6a 100644 --- a/app/Http/Requests/LinkTypeFormRequest.php +++ b/app/Http/Requests/LinkTypeFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class LinkTypeFormRequest. diff --git a/app/Http/Requests/MassDeleteJournalRequest.php b/app/Http/Requests/MassDeleteJournalRequest.php index fc1c5e93f8..603e8a7d51 100644 --- a/app/Http/Requests/MassDeleteJournalRequest.php +++ b/app/Http/Requests/MassDeleteJournalRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class MassDeleteJournalRequest. diff --git a/app/Http/Requests/MassEditJournalRequest.php b/app/Http/Requests/MassEditJournalRequest.php index ccf00f8988..7f217aaf67 100644 --- a/app/Http/Requests/MassEditJournalRequest.php +++ b/app/Http/Requests/MassEditJournalRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class MassEditJournalRequest. diff --git a/app/Http/Requests/NewUserFormRequest.php b/app/Http/Requests/NewUserFormRequest.php index 967d7fe461..bed1e3def7 100644 --- a/app/Http/Requests/NewUserFormRequest.php +++ b/app/Http/Requests/NewUserFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsValidAmount; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class NewUserFormRequest. diff --git a/app/Http/Requests/ObjectGroupFormRequest.php b/app/Http/Requests/ObjectGroupFormRequest.php index ccc0cf24f5..8d8dcb1b8a 100644 --- a/app/Http/Requests/ObjectGroupFormRequest.php +++ b/app/Http/Requests/ObjectGroupFormRequest.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\ObjectGroup; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ObjectGroupFormRequest. diff --git a/app/Http/Requests/PiggyBankStoreRequest.php b/app/Http/Requests/PiggyBankStoreRequest.php index 868b1cc4bd..87a13140da 100644 --- a/app/Http/Requests/PiggyBankStoreRequest.php +++ b/app/Http/Requests/PiggyBankStoreRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -33,6 +32,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class PiggyBankStoreRequest. diff --git a/app/Http/Requests/PiggyBankUpdateRequest.php b/app/Http/Requests/PiggyBankUpdateRequest.php index e0ecaf9614..a93fcada2f 100644 --- a/app/Http/Requests/PiggyBankUpdateRequest.php +++ b/app/Http/Requests/PiggyBankUpdateRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionCurrency; @@ -34,6 +33,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class PiggyBankFormRequest. diff --git a/app/Http/Requests/ProfileFormRequest.php b/app/Http/Requests/ProfileFormRequest.php index 1a7956d647..bf741778e6 100644 --- a/app/Http/Requests/ProfileFormRequest.php +++ b/app/Http/Requests/ProfileFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ProfileFormRequest. diff --git a/app/Http/Requests/ReconciliationStoreRequest.php b/app/Http/Requests/ReconciliationStoreRequest.php index e8c8b1a9be..75a1a6d8e3 100644 --- a/app/Http/Requests/ReconciliationStoreRequest.php +++ b/app/Http/Requests/ReconciliationStoreRequest.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Rules\IsValidAmount; use FireflyIII\Rules\ValidJournals; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class ReconciliationStoreRequest diff --git a/app/Http/Requests/RecurrenceFormRequest.php b/app/Http/Requests/RecurrenceFormRequest.php index a4f9014078..d7340dd793 100644 --- a/app/Http/Requests/RecurrenceFormRequest.php +++ b/app/Http/Requests/RecurrenceFormRequest.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\CategoryFactory; @@ -37,6 +36,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Validation\AccountValidator; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class RecurrenceFormRequest diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index 0061ca310a..fd11a32096 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use Carbon\Carbon; use Exception; use FireflyIII\Exceptions\FireflyException; @@ -35,7 +34,7 @@ use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; - +use Illuminate\Validation\Validator; use Safe\Exceptions\PcreException; use function Safe\preg_match; diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.php index f47f4b7c3f..8b7d9ca061 100644 --- a/app/Http/Requests/RuleFormRequest.php +++ b/app/Http/Requests/RuleFormRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\Rule; use FireflyIII\Rules\IsValidActionExpression; use FireflyIII\Support\Request\ChecksLogin; @@ -31,6 +30,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class RuleFormRequest. diff --git a/app/Http/Requests/RuleGroupFormRequest.php b/app/Http/Requests/RuleGroupFormRequest.php index 6ebc1a6233..8f5c4af01b 100644 --- a/app/Http/Requests/RuleGroupFormRequest.php +++ b/app/Http/Requests/RuleGroupFormRequest.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\RuleGroup; use FireflyIII\Rules\IsBoolean; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class RuleGroupFormRequest. diff --git a/app/Http/Requests/SelectTransactionsRequest.php b/app/Http/Requests/SelectTransactionsRequest.php index 6b27652abc..fdd9e0ecf8 100644 --- a/app/Http/Requests/SelectTransactionsRequest.php +++ b/app/Http/Requests/SelectTransactionsRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class SelectTransactionsRequest. diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php index 28a733b78c..a156257b78 100644 --- a/app/Http/Requests/TagFormRequest.php +++ b/app/Http/Requests/TagFormRequest.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Models\Location; use FireflyIII\Models\Tag; use FireflyIII\Support\Request\AppendsLocationData; @@ -31,6 +30,7 @@ use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class TagFormRequest. diff --git a/app/Http/Requests/TestRuleFormRequest.php b/app/Http/Requests/TestRuleFormRequest.php index 880c45625e..0cf0524667 100644 --- a/app/Http/Requests/TestRuleFormRequest.php +++ b/app/Http/Requests/TestRuleFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\GetRuleConfiguration; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class TestRuleFormRequest. diff --git a/app/Http/Requests/TokenFormRequest.php b/app/Http/Requests/TokenFormRequest.php index a54a1e786b..3a53cbe7ab 100644 --- a/app/Http/Requests/TokenFormRequest.php +++ b/app/Http/Requests/TokenFormRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class TokenFormRequest. diff --git a/app/Http/Requests/TriggerRecurrenceRequest.php b/app/Http/Requests/TriggerRecurrenceRequest.php index 4b929adaa7..c03e531a00 100644 --- a/app/Http/Requests/TriggerRecurrenceRequest.php +++ b/app/Http/Requests/TriggerRecurrenceRequest.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class TriggerRecurrenceRequest diff --git a/app/Http/Requests/UserFormRequest.php b/app/Http/Requests/UserFormRequest.php index b53be02934..409cfba453 100644 --- a/app/Http/Requests/UserFormRequest.php +++ b/app/Http/Requests/UserFormRequest.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ConvertsDataTypes; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UserFormRequest. diff --git a/app/Http/Requests/UserRegistrationRequest.php b/app/Http/Requests/UserRegistrationRequest.php index 64df7a021b..6e26763831 100644 --- a/app/Http/Requests/UserRegistrationRequest.php +++ b/app/Http/Requests/UserRegistrationRequest.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Http\Requests; -use Illuminate\Validation\Validator; use FireflyIII\Support\Request\ChecksLogin; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Class UserRegistrationRequest. diff --git a/app/Jobs/DownloadExchangeRates.php b/app/Jobs/DownloadExchangeRates.php index 1bbb3ee10e..9b29bcaac5 100644 --- a/app/Jobs/DownloadExchangeRates.php +++ b/app/Jobs/DownloadExchangeRates.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Jobs; -use FireflyIII\Models\CurrencyExchangeRate; use Carbon\Carbon; +use FireflyIII\Models\CurrencyExchangeRate; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface; @@ -40,7 +40,6 @@ use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; - use Safe\Exceptions\JsonException; use function Safe\json_decode; diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 57cfaf7feb..70c7f407b4 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Jobs; use Carbon\Carbon; +use Exception; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Message; use Illuminate\Queue\InteractsWithQueue; @@ -31,12 +32,10 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; use Symfony\Component\Mailer\Exception\TransportException; -use Exception; - -use function Safe\json_encode; +use function Safe\file_get_contents; use function Safe\file_put_contents; use function Safe\json_decode; -use function Safe\file_get_contents; +use function Safe\json_encode; /** * Class MailError. diff --git a/app/Mail/InvitationMail.php b/app/Mail/InvitationMail.php index 14ad8821b5..0c886bc21e 100644 --- a/app/Mail/InvitationMail.php +++ b/app/Mail/InvitationMail.php @@ -27,7 +27,6 @@ namespace FireflyIII\Mail; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; - use function Safe\parse_url; /** diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index a91e5eb778..ff42cb44f7 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -27,7 +27,6 @@ use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; - use function Safe\json_decode; use function Safe\json_encode; diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 3fd2d82a19..e1fe1be20f 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -27,7 +27,6 @@ use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; - use function Safe\json_decode; use function Safe\json_encode; diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index 4a748bfb8b..8c2c02ad72 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -28,7 +28,6 @@ use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; - use function Safe\json_decode; use function Safe\json_encode; diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 263342b753..e28f83d871 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -30,7 +30,6 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; use Laravel\Passport\Passport; use Override; - use function Safe\preg_match; /** diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index e900b72f9e..cb9bebbbf4 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -77,8 +77,8 @@ use FireflyIII\Validation\FireflyValidator; use Illuminate\Foundation\Application; use Illuminate\Support\Facades\Validator; use Illuminate\Support\ServiceProvider; -use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use Override; +use Symfony\Component\ExpressionLanguage\ExpressionLanguage; /** * Class FireflyServiceProvider. diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 8eacb438b4..4b0278de7d 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -48,7 +48,6 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use Override; - use function Safe\json_encode; /** diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php index 0e41c59cf4..cd0d3ea249 100644 --- a/app/Repositories/Attachment/AttachmentRepository.php +++ b/app/Repositories/Attachment/AttachmentRepository.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Attachment; +use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\AttachmentFactory; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; @@ -35,7 +36,6 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\Storage; use League\Flysystem\UnableToDeleteFile; -use Exception; use LogicException; /** diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 99c484f4a8..daa88a5a65 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Bill; -use FireflyIII\Models\ObjectGroup; use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\BillFactory; use FireflyIII\Models\Attachment; use FireflyIII\Models\Bill; use FireflyIII\Models\Note; +use FireflyIII\Models\ObjectGroup; use FireflyIII\Models\Rule; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; diff --git a/app/Repositories/Budget/AvailableBudgetRepository.php b/app/Repositories/Budget/AvailableBudgetRepository.php index ee9db0ca62..cc2916cb92 100644 --- a/app/Repositories/Budget/AvailableBudgetRepository.php +++ b/app/Repositories/Budget/AvailableBudgetRepository.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Budget; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Models\AvailableBudget; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Support\Facades\Amount; diff --git a/app/Repositories/Budget/AvailableBudgetRepositoryInterface.php b/app/Repositories/Budget/AvailableBudgetRepositoryInterface.php index 3d54e3f20b..46251e79d2 100644 --- a/app/Repositories/Budget/AvailableBudgetRepositoryInterface.php +++ b/app/Repositories/Budget/AvailableBudgetRepositoryInterface.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Budget; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Models\AvailableBudget; use FireflyIII\Models\TransactionCurrency; diff --git a/app/Repositories/Budget/NoBudgetRepositoryInterface.php b/app/Repositories/Budget/NoBudgetRepositoryInterface.php index 01b42c3396..13d12a1122 100644 --- a/app/Repositories/Budget/NoBudgetRepositoryInterface.php +++ b/app/Repositories/Budget/NoBudgetRepositoryInterface.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Budget; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\UserGroup; diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 6856e3552a..7e46ff30d9 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Category; use Carbon\Carbon; +use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\CategoryFactory; use FireflyIII\Models\Attachment; @@ -39,7 +40,6 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; -use Exception; /** * Class CategoryRepository. diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index c76b5badfb..a3f673f108 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -44,7 +44,6 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Override; - use Safe\Exceptions\JsonException; use function Safe\json_encode; diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index 8ca1f14723..056825e7d8 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -23,9 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Repositories\PiggyBank; -use FireflyIII\Events\Model\PiggyBank\ChangedAmount; -use FireflyIII\User; use Carbon\Carbon; +use FireflyIII\Events\Model\PiggyBank\ChangedAmount; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\PiggyBankFactory; use FireflyIII\Models\Account; @@ -40,6 +39,7 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface; use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; +use FireflyIII\User; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.php index f131b3d1f6..c519ab397f 100644 --- a/app/Repositories/Recurring/RecurringRepository.php +++ b/app/Repositories/Recurring/RecurringRepository.php @@ -50,9 +50,8 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; - -use function Safe\json_encode; use function Safe\json_decode; +use function Safe\json_encode; /** * Class RecurringRepository diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index 5774e84e9e..e8435dc6c2 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Rule; +use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Rule; use FireflyIII\Models\RuleAction; @@ -33,7 +34,6 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface; use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use FireflyIII\Support\Search\OperatorQuerySearch; use Illuminate\Support\Collection; -use Exception; /** * Class RuleRepository. diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index 3e1694baee..a3256ccf50 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\RuleGroup; +use Exception; use FireflyIII\Models\Rule; use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleGroup; @@ -32,7 +33,6 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; -use Exception; /** * Class RuleGroupRepository. diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index eb50e2ef8f..b900e9143a 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -23,8 +23,8 @@ declare(strict_types=1); namespace FireflyIII\Repositories\Tag; -use Override; use Carbon\Carbon; +use Exception; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Factory\TagFactory; use FireflyIII\Helpers\Collector\GroupCollectorInterface; @@ -39,7 +39,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; -use Exception; +use Override; /** * Class TagRepository. diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php index 78acf6d253..8e8eac95e3 100644 --- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php +++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php @@ -49,7 +49,6 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; - use function Safe\json_decode; /** diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index e00b15ba9d..d2e5c3fa81 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Repositories\User; use Carbon\Carbon; +use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\GroupMembership; @@ -35,7 +36,6 @@ use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Database\QueryException; use Illuminate\Support\Collection; use Illuminate\Support\Str; -use Exception; use Override; /** diff --git a/app/Rules/Account/IsValidAccountType.php b/app/Rules/Account/IsValidAccountType.php index d2287ff702..d2ac0603cf 100644 --- a/app/Rules/Account/IsValidAccountType.php +++ b/app/Rules/Account/IsValidAccountType.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Rules\Account; +use Closure; use FireflyIII\Support\Http\Api\AccountFilter; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; use Override; class IsValidAccountType implements ValidationRule diff --git a/app/Rules/Admin/IsValidDiscordUrl.php b/app/Rules/Admin/IsValidDiscordUrl.php index ccb4800935..a45bb12a4f 100644 --- a/app/Rules/Admin/IsValidDiscordUrl.php +++ b/app/Rules/Admin/IsValidDiscordUrl.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules\Admin; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; class IsValidDiscordUrl implements ValidationRule { diff --git a/app/Rules/Admin/IsValidSlackOrDiscordUrl.php b/app/Rules/Admin/IsValidSlackOrDiscordUrl.php index 5b9f6063da..8efbf682c9 100644 --- a/app/Rules/Admin/IsValidSlackOrDiscordUrl.php +++ b/app/Rules/Admin/IsValidSlackOrDiscordUrl.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules\Admin; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; class IsValidSlackOrDiscordUrl implements ValidationRule { diff --git a/app/Rules/Admin/IsValidSlackUrl.php b/app/Rules/Admin/IsValidSlackUrl.php index 90fc1dafcd..0355b03f97 100644 --- a/app/Rules/Admin/IsValidSlackUrl.php +++ b/app/Rules/Admin/IsValidSlackUrl.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules\Admin; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; class IsValidSlackUrl implements ValidationRule { diff --git a/app/Rules/BelongsUser.php b/app/Rules/BelongsUser.php index 2e1fa3a9c2..48e44ddcbc 100644 --- a/app/Rules/BelongsUser.php +++ b/app/Rules/BelongsUser.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; @@ -32,7 +33,6 @@ use FireflyIII\Models\Category; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionJournal; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class BelongsUser diff --git a/app/Rules/BelongsUserGroup.php b/app/Rules/BelongsUserGroup.php index fe29b1fbef..488080a176 100644 --- a/app/Rules/BelongsUserGroup.php +++ b/app/Rules/BelongsUserGroup.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; @@ -33,7 +34,6 @@ use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\UserGroup; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class BelongsUserGroup diff --git a/app/Rules/IsAllowedGroupAction.php b/app/Rules/IsAllowedGroupAction.php index f3a197f113..7e30cd30ec 100644 --- a/app/Rules/IsAllowedGroupAction.php +++ b/app/Rules/IsAllowedGroupAction.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Models\Account; use FireflyIII\Repositories\UserGroup\UserGroupRepositoryInterface; @@ -31,7 +32,6 @@ use FireflyIII\User; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; use Override; class IsAllowedGroupAction implements ValidationRule diff --git a/app/Rules/IsAssetAccountId.php b/app/Rules/IsAssetAccountId.php index e8d26937fd..eadc485442 100644 --- a/app/Rules/IsAssetAccountId.php +++ b/app/Rules/IsAssetAccountId.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Models\Account; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class IsAssetAccountId diff --git a/app/Rules/IsBoolean.php b/app/Rules/IsBoolean.php index 28c1ca3781..7c2b31c99f 100644 --- a/app/Rules/IsBoolean.php +++ b/app/Rules/IsBoolean.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; /** * Class IsBoolean diff --git a/app/Rules/IsDateOrTime.php b/app/Rules/IsDateOrTime.php index 64d711ec99..ae732d0ab3 100644 --- a/app/Rules/IsDateOrTime.php +++ b/app/Rules/IsDateOrTime.php @@ -27,8 +27,8 @@ namespace FireflyIII\Rules; use Carbon\Carbon; use Carbon\Exceptions\InvalidDateException; use Carbon\Exceptions\InvalidFormatException; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; /** * Class IsDateOrTime diff --git a/app/Rules/IsDefaultUserGroupName.php b/app/Rules/IsDefaultUserGroupName.php index 81b366a2e6..f59ff49327 100644 --- a/app/Rules/IsDefaultUserGroupName.php +++ b/app/Rules/IsDefaultUserGroupName.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Models\UserGroup; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class IsDefaultUserGroupName diff --git a/app/Rules/IsDuplicateTransaction.php b/app/Rules/IsDuplicateTransaction.php index 1f9a125205..bceb22b95f 100644 --- a/app/Rules/IsDuplicateTransaction.php +++ b/app/Rules/IsDuplicateTransaction.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; /** * TODO not sure where this is used. diff --git a/app/Rules/IsFilterValueIn.php b/app/Rules/IsFilterValueIn.php index e167bdb79c..f7f41eb545 100644 --- a/app/Rules/IsFilterValueIn.php +++ b/app/Rules/IsFilterValueIn.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; class IsFilterValueIn implements ValidationRule { diff --git a/app/Rules/IsTransferAccount.php b/app/Rules/IsTransferAccount.php index 22f1fc5d8c..d64f30fa38 100644 --- a/app/Rules/IsTransferAccount.php +++ b/app/Rules/IsTransferAccount.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Validation\AccountValidator; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class IsTransferAccount diff --git a/app/Rules/IsValidActionExpression.php b/app/Rules/IsValidActionExpression.php index d12b507bd3..f6080a0903 100644 --- a/app/Rules/IsValidActionExpression.php +++ b/app/Rules/IsValidActionExpression.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\TransactionRules\Expressions\ActionExpression; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Translation\PotentiallyTranslatedString; -use Closure; class IsValidActionExpression implements ValidationRule { diff --git a/app/Rules/IsValidAmount.php b/app/Rules/IsValidAmount.php index 208d60c696..26b06c8ac0 100644 --- a/app/Rules/IsValidAmount.php +++ b/app/Rules/IsValidAmount.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; class IsValidAmount implements ValidationRule { diff --git a/app/Rules/IsValidAttachmentModel.php b/app/Rules/IsValidAttachmentModel.php index 093e650cf2..69d09b708c 100644 --- a/app/Rules/IsValidAttachmentModel.php +++ b/app/Rules/IsValidAttachmentModel.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Models\Account; use FireflyIII\Models\Bill; use FireflyIII\Models\Budget; @@ -41,7 +42,6 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Repositories\Tag\TagRepositoryInterface; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class IsValidAttachmentModel diff --git a/app/Rules/IsValidBulkClause.php b/app/Rules/IsValidBulkClause.php index 7d5ed57290..f3c74630b1 100644 --- a/app/Rules/IsValidBulkClause.php +++ b/app/Rules/IsValidBulkClause.php @@ -24,11 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Validator; -use Closure; use JsonException; - use function Safe\json_decode; /** diff --git a/app/Rules/IsValidDateRange.php b/app/Rules/IsValidDateRange.php index faf4b4343e..75a6846fab 100644 --- a/app/Rules/IsValidDateRange.php +++ b/app/Rules/IsValidDateRange.php @@ -27,8 +27,8 @@ namespace FireflyIII\Rules; use Carbon\Carbon; use Carbon\Exceptions\InvalidDateException; use Carbon\Exceptions\InvalidFormatException; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; class IsValidDateRange implements ValidationRule { diff --git a/app/Rules/IsValidPositiveAmount.php b/app/Rules/IsValidPositiveAmount.php index 2c6eeb63cd..f637cdbc6d 100644 --- a/app/Rules/IsValidPositiveAmount.php +++ b/app/Rules/IsValidPositiveAmount.php @@ -25,11 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; - use function Safe\json_encode; class IsValidPositiveAmount implements ValidationRule diff --git a/app/Rules/IsValidZeroOrMoreAmount.php b/app/Rules/IsValidZeroOrMoreAmount.php index 3c93762333..f5880fa78a 100644 --- a/app/Rules/IsValidZeroOrMoreAmount.php +++ b/app/Rules/IsValidZeroOrMoreAmount.php @@ -25,10 +25,10 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; -use Closure; class IsValidZeroOrMoreAmount implements ValidationRule { diff --git a/app/Rules/LessThanPiggyTarget.php b/app/Rules/LessThanPiggyTarget.php index 78df186875..3f34ab068a 100644 --- a/app/Rules/LessThanPiggyTarget.php +++ b/app/Rules/LessThanPiggyTarget.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; /** * Class LessThanPiggyTarget diff --git a/app/Rules/UniqueAccountNumber.php b/app/Rules/UniqueAccountNumber.php index 9cfae9d359..d605010d9d 100644 --- a/app/Rules/UniqueAccountNumber.php +++ b/app/Rules/UniqueAccountNumber.php @@ -24,12 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Models\Account; use FireflyIII\Models\AccountMeta; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; - use function Safe\json_encode; /** diff --git a/app/Rules/UniqueIban.php b/app/Rules/UniqueIban.php index 9246326c15..3f83ab76bf 100644 --- a/app/Rules/UniqueIban.php +++ b/app/Rules/UniqueIban.php @@ -24,11 +24,11 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Models\Account; use FireflyIII\Support\Facades\Steam; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class UniqueIban diff --git a/app/Rules/ValidJournals.php b/app/Rules/ValidJournals.php index 2e2b6c6230..221bef831d 100644 --- a/app/Rules/ValidJournals.php +++ b/app/Rules/ValidJournals.php @@ -24,9 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Rules; +use Closure; use FireflyIII\Models\TransactionJournal; use Illuminate\Contracts\Validation\ValidationRule; -use Closure; /** * Class ValidJournals diff --git a/app/Rules/ValidRecurrenceRepetitionType.php b/app/Rules/ValidRecurrenceRepetitionType.php index f8e0fe3606..a9a923c892 100644 --- a/app/Rules/ValidRecurrenceRepetitionType.php +++ b/app/Rules/ValidRecurrenceRepetitionType.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; /** * Class ValidRecurrenceRepetitionType diff --git a/app/Rules/ValidRecurrenceRepetitionValue.php b/app/Rules/ValidRecurrenceRepetitionValue.php index 5a1a4b9031..9cd29b261b 100644 --- a/app/Rules/ValidRecurrenceRepetitionValue.php +++ b/app/Rules/ValidRecurrenceRepetitionValue.php @@ -25,8 +25,8 @@ declare(strict_types=1); namespace FireflyIII\Rules; use Carbon\Carbon; -use Illuminate\Contracts\Validation\ValidationRule; use Closure; +use Illuminate\Contracts\Validation\ValidationRule; use InvalidArgumentException; /** diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php index ad55aee903..99ead72517 100644 --- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php +++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php @@ -31,7 +31,6 @@ use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; use Illuminate\Support\Facades\Log; use JsonException; - use function Safe\json_decode; /** diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php index 5525181b97..cf2f0e4dc6 100644 --- a/app/Services/Internal/Support/AccountServiceTrait.php +++ b/app/Services/Internal/Support/AccountServiceTrait.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Services\Internal\Support; -use Deprecated; use Carbon\Carbon; +use Deprecated; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Exceptions\DuplicateTransactionException; use FireflyIII\Exceptions\FireflyException; diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index abe783365f..757ce01c0d 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -38,7 +38,6 @@ use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Rules\UniqueIban; use FireflyIII\Support\NullArrayObject; use Illuminate\Support\Facades\Log; - use Safe\Exceptions\JsonException; use function Safe\json_encode; diff --git a/app/Services/Internal/Support/RecurringTransactionTrait.php b/app/Services/Internal/Support/RecurringTransactionTrait.php index ebb7aad99f..b6f5955cb2 100644 --- a/app/Services/Internal/Support/RecurringTransactionTrait.php +++ b/app/Services/Internal/Support/RecurringTransactionTrait.php @@ -42,7 +42,6 @@ use FireflyIII\Models\RecurrenceTransactionMeta; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Validation\AccountValidator; use Illuminate\Support\Facades\Log; - use function Safe\json_encode; /** diff --git a/app/Services/Internal/Update/BillUpdateService.php b/app/Services/Internal/Update/BillUpdateService.php index d71d82a524..4fdd94aae0 100644 --- a/app/Services/Internal/Update/BillUpdateService.php +++ b/app/Services/Internal/Update/BillUpdateService.php @@ -24,10 +24,9 @@ declare(strict_types=1); namespace FireflyIII\Services\Internal\Update; -use FireflyIII\Models\ObjectGroup; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\TransactionCurrencyFactory; use FireflyIII\Models\Bill; +use FireflyIII\Models\ObjectGroup; use FireflyIII\Models\Rule; use FireflyIII\Models\RuleTrigger; use FireflyIII\Repositories\Bill\BillRepositoryInterface; diff --git a/app/Services/Internal/Update/CategoryUpdateService.php b/app/Services/Internal/Update/CategoryUpdateService.php index 193a5957b2..b04c06686e 100644 --- a/app/Services/Internal/Update/CategoryUpdateService.php +++ b/app/Services/Internal/Update/CategoryUpdateService.php @@ -24,13 +24,13 @@ declare(strict_types=1); namespace FireflyIII\Services\Internal\Update; +use Exception; use FireflyIII\Models\Category; use FireflyIII\Models\Note; use FireflyIII\Models\RecurrenceTransactionMeta; use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleTrigger; use FireflyIII\User; -use Exception; /** * Class CategoryUpdateService diff --git a/app/Services/Webhook/StandardWebhookSender.php b/app/Services/Webhook/StandardWebhookSender.php index ab9a82108a..e0f6cd5dfb 100644 --- a/app/Services/Webhook/StandardWebhookSender.php +++ b/app/Services/Webhook/StandardWebhookSender.php @@ -34,7 +34,6 @@ use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Exception\RequestException; use Illuminate\Support\Facades\Log; use JsonException; - use function Safe\json_encode; /** diff --git a/app/Support/Binder/CLIToken.php b/app/Support/Binder/CLIToken.php index b57ae19261..6dc825c585 100644 --- a/app/Support/Binder/CLIToken.php +++ b/app/Support/Binder/CLIToken.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Binder; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\User\UserRepositoryInterface; use Illuminate\Routing\Route; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index e22808ea06..258bea8495 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -27,7 +27,6 @@ use Carbon\Carbon; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Cache; use JsonException; - use function Safe\json_encode; /** diff --git a/app/Support/Http/Controllers/CreateStuff.php b/app/Support/Http/Controllers/CreateStuff.php index a69c44ac54..32e0c2c1a4 100644 --- a/app/Support/Http/Controllers/CreateStuff.php +++ b/app/Support/Http/Controllers/CreateStuff.php @@ -32,7 +32,6 @@ use FireflyIII\User; use Illuminate\Support\Facades\Log; use Laravel\Passport\Passport; use phpseclib3\Crypt\RSA; - use function Safe\file_put_contents; /** diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.php index 39a6df3aff..4f9702bb29 100644 --- a/app/Support/Http/Controllers/RequestInformation.php +++ b/app/Support/Http/Controllers/RequestInformation.php @@ -35,7 +35,6 @@ use Illuminate\Routing\Route; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Route as RouteFacade; use Illuminate\Support\Facades\Validator; - use function Safe\parse_url; /** diff --git a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php index 1ea71f1dc4..25bb788c73 100644 --- a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php +++ b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php @@ -51,7 +51,6 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Arr; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; - use function Safe\json_decode; class RecurringEnrichment implements EnrichmentInterface diff --git a/app/Support/ParseDateString.php b/app/Support/ParseDateString.php index 45404e1952..883e76be41 100644 --- a/app/Support/ParseDateString.php +++ b/app/Support/ParseDateString.php @@ -29,7 +29,6 @@ use Carbon\CarbonInterface; use Carbon\Exceptions\InvalidFormatException; use FireflyIII\Exceptions\FireflyException; use Illuminate\Support\Facades\Log; - use Safe\Exceptions\PcreException; use function Safe\preg_match; diff --git a/app/Support/Report/Budget/BudgetReportGenerator.php b/app/Support/Report/Budget/BudgetReportGenerator.php index 1bf9c81b3e..ecdc897160 100644 --- a/app/Support/Report/Budget/BudgetReportGenerator.php +++ b/app/Support/Report/Budget/BudgetReportGenerator.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Report\Budget; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; use FireflyIII\Models\Budget; use FireflyIII\Models\BudgetLimit; diff --git a/app/Support/Request/ConvertsDataTypes.php b/app/Support/Request/ConvertsDataTypes.php index 5293a6f804..c978f2785c 100644 --- a/app/Support/Request/ConvertsDataTypes.php +++ b/app/Support/Request/ConvertsDataTypes.php @@ -31,7 +31,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Facades\Steam; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; - use function Safe\preg_replace; /** diff --git a/app/Support/Search/AccountSearch.php b/app/Support/Search/AccountSearch.php index 44bb34e893..9e54a772d4 100644 --- a/app/Support/Search/AccountSearch.php +++ b/app/Support/Search/AccountSearch.php @@ -28,7 +28,6 @@ use FireflyIII\User; use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Collection; - use function Safe\json_encode; /** diff --git a/app/Support/Search/QueryParser/GdbotsQueryParser.php b/app/Support/Search/QueryParser/GdbotsQueryParser.php index 127dc475b5..cc51218eaa 100644 --- a/app/Support/Search/QueryParser/GdbotsQueryParser.php +++ b/app/Support/Search/QueryParser/GdbotsQueryParser.php @@ -33,7 +33,6 @@ use Illuminate\Support\Facades\Log; use LogicException; use Safe\Exceptions\FilesystemException; use TypeError; - use function Safe\fwrite; class GdbotsQueryParser implements QueryParserInterface diff --git a/app/Support/Steam.php b/app/Support/Steam.php index 9488fe36fb..f88839823d 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -40,7 +40,6 @@ use Illuminate\Support\Str; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use ValueError; - use function Safe\parse_url; use function Safe\preg_replace; diff --git a/app/Support/System/OAuthKeys.php b/app/Support/System/OAuthKeys.php index e4878d01cf..e39ed5c5de 100644 --- a/app/Support/System/OAuthKeys.php +++ b/app/Support/System/OAuthKeys.php @@ -31,7 +31,6 @@ use Illuminate\Support\Facades\Crypt; use Laravel\Passport\Console\KeysCommand; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; - use Safe\Exceptions\FilesystemException; use function Safe\file_get_contents; use function Safe\file_put_contents; diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 485dfe1bd9..a3b0a3e128 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -37,7 +37,6 @@ use Override; use Twig\Extension\AbstractExtension; use Twig\TwigFilter; use Twig\TwigFunction; - use function Safe\parse_url; /** diff --git a/app/Support/Twig/TransactionGroupTwig.php b/app/Support/Twig/TransactionGroupTwig.php index 3033a84872..30b539f08a 100644 --- a/app/Support/Twig/TransactionGroupTwig.php +++ b/app/Support/Twig/TransactionGroupTwig.php @@ -34,7 +34,6 @@ use Illuminate\Support\Facades\DB; use Override; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; - use function Safe\json_decode; /** diff --git a/app/Transformers/PiggyBankTransformer.php b/app/Transformers/PiggyBankTransformer.php index ccc7e70b00..a418b93d37 100644 --- a/app/Transformers/PiggyBankTransformer.php +++ b/app/Transformers/PiggyBankTransformer.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Transformers; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionCurrency; use FireflyIII\Support\Facades\Amount; diff --git a/app/Transformers/RecurrenceTransformer.php b/app/Transformers/RecurrenceTransformer.php index 00c388fdcb..823c4cecda 100644 --- a/app/Transformers/RecurrenceTransformer.php +++ b/app/Transformers/RecurrenceTransformer.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Transformers; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Recurrence; use Illuminate\Support\Facades\Log; diff --git a/app/Transformers/UserTransformer.php b/app/Transformers/UserTransformer.php index cff73173c2..0dff6bd273 100644 --- a/app/Transformers/UserTransformer.php +++ b/app/Transformers/UserTransformer.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Transformers; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; diff --git a/app/Transformers/WebhookMessageTransformer.php b/app/Transformers/WebhookMessageTransformer.php index 24bc25d4c2..8057d53a54 100644 --- a/app/Transformers/WebhookMessageTransformer.php +++ b/app/Transformers/WebhookMessageTransformer.php @@ -27,7 +27,6 @@ namespace FireflyIII\Transformers; use FireflyIII\Models\WebhookMessage; use Illuminate\Support\Facades\Log; use JsonException; - use function Safe\json_encode; /** diff --git a/app/User.php b/app/User.php index cc9e4b7d07..445ef22f77 100644 --- a/app/User.php +++ b/app/User.php @@ -25,6 +25,7 @@ declare(strict_types=1); namespace FireflyIII; use Deprecated; +use Exception; use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Events\RequestedNewPassword; use FireflyIII\Exceptions\FireflyException; @@ -67,7 +68,6 @@ use Illuminate\Support\Str; use Laravel\Passport\HasApiTokens; use NotificationChannels\Pushover\PushoverReceiver; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Exception; class User extends Authenticatable { diff --git a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php index a218f323ee..2ec2ee2fc9 100644 --- a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php +++ b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php @@ -24,9 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Validation\Api\Data\Bulk; -use Illuminate\Validation\Validator; use FireflyIII\Repositories\Account\AccountRepositoryInterface; - +use Illuminate\Validation\Validator; use function Safe\json_decode; trait ValidatesBulkTransactionQuery diff --git a/app/Validation/CurrencyValidation.php b/app/Validation/CurrencyValidation.php index 2bdc1357d1..52bad8ff61 100644 --- a/app/Validation/CurrencyValidation.php +++ b/app/Validation/CurrencyValidation.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace FireflyIII\Validation; -use Illuminate\Validation\Validator; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Trait CurrencyValidation diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index e3d25b33f8..e13c866efc 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Validation; +use Config; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; @@ -45,15 +46,13 @@ use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException; use PragmaRX\Google2FA\Exceptions\InvalidCharactersException; use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException; use PragmaRX\Google2FALaravel\Facade; -use Config; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\JsonException; use ValueError; - -use function Safe\preg_match; use function Safe\iconv; use function Safe\json_encode; +use function Safe\preg_match; /** * Class FireflyValidator. diff --git a/app/Validation/GroupValidation.php b/app/Validation/GroupValidation.php index bf4801856f..84c32cfc90 100644 --- a/app/Validation/GroupValidation.php +++ b/app/Validation/GroupValidation.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Validation; -use Illuminate\Validation\Validator; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionGroup; +use Illuminate\Validation\Validator; /** * Trait GroupValidation. diff --git a/app/Validation/RecurrenceValidation.php b/app/Validation/RecurrenceValidation.php index 2ba6e58a95..52b829203e 100644 --- a/app/Validation/RecurrenceValidation.php +++ b/app/Validation/RecurrenceValidation.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace FireflyIII\Validation; -use Illuminate\Validation\Validator; use Carbon\Carbon; use FireflyIII\Models\Recurrence; use FireflyIII\Models\RecurrenceTransaction; +use Illuminate\Validation\Validator; use InvalidArgumentException; /** diff --git a/app/Validation/TransactionValidation.php b/app/Validation/TransactionValidation.php index 944b9372d2..b44333bd90 100644 --- a/app/Validation/TransactionValidation.php +++ b/app/Validation/TransactionValidation.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Validation; -use Illuminate\Validation\Validator; use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Exceptions\FireflyException; @@ -37,6 +36,7 @@ use FireflyIII\Repositories\Account\AccountRepository; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\User; use Illuminate\Support\Facades\Log; +use Illuminate\Validation\Validator; /** * Trait TransactionValidation From b0033cf9ed4386c55facc4d396060f4b778cda29 Mon Sep 17 00:00:00 2001 From: JC5 Date: Sun, 5 Oct 2025 13:03:51 +0200 Subject: [PATCH 22/26] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-10-05?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V1/Controllers/Chart/BudgetController.php | 1 - .../Data/Export/ExportController.php | 36 +-- .../Models/Account/ListController.php | 5 - .../Models/Account/ShowController.php | 1 - .../Models/Attachment/ShowController.php | 1 - .../Models/AvailableBudget/ShowController.php | 1 - .../Models/Bill/ListController.php | 3 - .../Models/Bill/ShowController.php | 1 - .../Models/Budget/ListController.php | 4 - .../Models/Budget/ShowController.php | 1 - .../Models/BudgetLimit/ListController.php | 1 - .../Models/Category/ListController.php | 2 - .../Models/Category/ShowController.php | 1 - .../Models/ObjectGroup/ListController.php | 2 - .../Models/PiggyBank/ListController.php | 3 - .../Models/PiggyBank/ShowController.php | 1 - .../Models/Recurrence/ListController.php | 1 - .../Models/Recurrence/ShowController.php | 1 - .../Models/Recurrence/TriggerController.php | 2 +- .../Models/Rule/ShowController.php | 1 - .../Models/RuleGroup/ListController.php | 1 - .../Models/RuleGroup/ShowController.php | 1 - .../Controllers/Models/Tag/ListController.php | 2 - .../Controllers/Models/Tag/ShowController.php | 1 - .../Models/Transaction/ListController.php | 3 - .../Models/Transaction/ShowController.php | 1 - .../TransactionCurrency/ListController.php | 7 - .../TransactionCurrency/ShowController.php | 3 - .../TransactionCurrency/StoreController.php | 1 - .../TransactionCurrency/UpdateController.php | 3 - .../Models/TransactionLink/ShowController.php | 1 - .../TransactionLinkType/ListController.php | 1 - .../TransactionLinkType/ShowController.php | 1 - .../Search/TransactionController.php | 1 - .../V1/Controllers/System/UserController.php | 1 - .../User/PreferencesController.php | 1 - .../Controllers/Webhook/MessageController.php | 1 - .../V1/Controllers/Webhook/ShowController.php | 1 - .../Requests/Data/Bulk/TransactionRequest.php | 1 + app/Console/Commands/Export/ExportsData.php | 4 +- .../Commands/System/ForcesDecimalSize.php | 1 + .../Commands/System/ResetsErrorMailLimit.php | 1 + .../Commands/System/ScansAttachments.php | 1 + .../Commands/System/VerifySecurityAlerts.php | 2 +- .../Upgrade/AddsTransactionIdentifiers.php | 2 +- .../Upgrade/RemovesDatabaseDecryption.php | 2 + .../Upgrade/UpgradesAccountCurrencies.php | 2 - .../Upgrade/UpgradesAccountMetaData.php | 1 + .../Commands/Upgrade/UpgradesAttachments.php | 1 + .../Commands/Upgrade/UpgradesBillsToRules.php | 2 +- .../Commands/Upgrade/UpgradesBudgetLimits.php | 1 + .../Upgrade/UpgradesCurrencyPreferences.php | 1 + .../Commands/Upgrade/UpgradesDatabase.php | 1 + .../Commands/Upgrade/UpgradesJournalNotes.php | 1 + .../Commands/Upgrade/UpgradesLiabilities.php | 1 + .../Upgrade/UpgradesLiabilitiesEight.php | 1 + .../Upgrade/UpgradesMultiPiggyBanks.php | 1 + .../UpgradesPrimaryCurrencyAmounts.php | 1 + .../Upgrade/UpgradesRecurrenceMetaData.php | 2 + .../Commands/Upgrade/UpgradesRuleActions.php | 1 + .../Commands/Upgrade/UpgradesTagLocations.php | 1 + .../Commands/Upgrade/UpgradesToGroups.php | 1 + .../Upgrade/UpgradesTransferCurrencies.php | 1 + .../UpgradesVariousCurrencyInformation.php | 1 + .../Commands/Upgrade/UpgradesWebhooks.php | 1 + app/Console/Commands/VerifiesAccessToken.php | 1 - app/Exceptions/Handler.php | 1 + app/Factory/AccountFactory.php | 3 +- app/Factory/PiggyBankFactory.php | 1 + app/Factory/TransactionJournalFactory.php | 5 +- app/Handlers/Events/BillEventHandler.php | 1 + app/Handlers/Events/UserEventHandler.php | 5 - .../Events/VersionCheckEventHandler.php | 4 - app/Helpers/Attachments/AttachmentHelper.php | 6 +- .../Collector/Extensions/MetaCollection.php | 1 + app/Helpers/Collector/GroupCollector.php | 4 +- app/Helpers/Fiscal/FiscalHelper.php | 3 +- .../Webhook/Sha3SignatureGenerator.php | 1 + .../Controllers/Account/CreateController.php | 2 - .../Controllers/Account/IndexController.php | 6 - .../Controllers/Account/ShowController.php | 8 - app/Http/Controllers/Admin/HomeController.php | 1 + app/Http/Controllers/Admin/UserController.php | 1 + .../Auth/ForgotPasswordController.php | 5 +- app/Http/Controllers/Auth/LoginController.php | 2 - .../Controllers/Auth/RegisterController.php | 5 - .../Auth/ResetPasswordController.php | 3 +- .../Controllers/Auth/TwoFactorController.php | 3 +- app/Http/Controllers/Bill/IndexController.php | 2 - app/Http/Controllers/Bill/ShowController.php | 4 +- .../Controllers/Budget/ShowController.php | 15 +- .../Controllers/Category/IndexController.php | 3 +- .../Category/NoCategoryController.php | 7 +- .../Controllers/Category/ShowController.php | 9 +- .../Controllers/Chart/AccountController.php | 6 +- .../Controllers/Chart/CategoryController.php | 5 - .../Controllers/Chart/PiggyBankController.php | 1 - app/Http/Controllers/Controller.php | 1 + app/Http/Controllers/DebugController.php | 2 + app/Http/Controllers/JavascriptController.php | 4 - app/Http/Controllers/Json/IntroController.php | 2 - app/Http/Controllers/NewUserController.php | 1 - .../Controllers/PiggyBank/IndexController.php | 1 - .../Controllers/PreferencesController.php | 3 +- .../Controllers/Profile/MfaController.php | 6 - app/Http/Controllers/ProfileController.php | 1 - .../Controllers/Recurring/IndexController.php | 2 - app/Http/Controllers/ReportController.php | 3 +- .../Controllers/System/InstallController.php | 1 + app/Http/Controllers/TagController.php | 9 +- .../Transaction/CreateController.php | 3 +- .../Transaction/EditController.php | 4 +- .../Transaction/IndexController.php | 9 +- .../TransactionCurrency/DeleteController.php | 8 +- .../TransactionCurrency/EditController.php | 4 +- .../TransactionCurrency/IndexController.php | 3 +- app/Http/Middleware/AcceptHeaders.php | 4 +- app/Http/Requests/ReportFormRequest.php | 3 +- app/Jobs/DownloadExchangeRates.php | 3 +- app/Jobs/MailError.php | 1 + app/Mail/InvitationMail.php | 1 + app/Mail/ReportNewJournalsMail.php | 1 + app/Models/AccountMeta.php | 1 + app/Models/BudgetLimit.php | 13 +- app/Models/Configuration.php | 1 + app/Models/Recurrence.php | 4 +- app/Models/TransactionGroup.php | 5 +- app/Models/TransactionJournal.php | 1 + app/Models/TransactionJournalMeta.php | 1 + app/Providers/AppServiceProvider.php | 1 + .../Account/AccountRepository.php | 1 + app/Repositories/Account/AccountTasker.php | 4 - .../Budget/AvailableBudgetRepository.php | 2 +- app/Repositories/Budget/BudgetRepository.php | 4 +- .../Budget/NoBudgetRepository.php | 3 +- .../Category/CategoryRepository.php | 1 + .../Currency/CurrencyRepository.php | 5 +- .../Journal/JournalCLIRepository.php | 1 + .../Recurring/RecurringRepository.php | 2 +- .../TransactionGroupRepository.php | 2 + app/Repositories/User/UserRepository.php | 2 +- .../UserGroup/UserGroupRepository.php | 2 - app/Rules/IsValidBulkClause.php | 1 + app/Rules/IsValidPositiveAmount.php | 1 + app/Rules/UniqueAccountNumber.php | 1 + .../FireflyIIIOrg/Update/UpdateRequest.php | 1 + .../Internal/Support/AccountServiceTrait.php | 2 - .../Internal/Support/JournalServiceTrait.php | 6 +- .../Support/RecurringTransactionTrait.php | 1 + .../Internal/Update/AccountUpdateService.php | 2 - .../Internal/Update/BillUpdateService.php | 2 - .../Webhook/StandardWebhookSender.php | 1 + app/Support/Binder/CLIToken.php | 1 - app/Support/CacheProperties.php | 1 + app/Support/Export/ExportDataGenerator.php | 2 - app/Support/Http/Controllers/CreateStuff.php | 1 + .../Http/Controllers/RequestInformation.php | 1 + .../Enrichments/BudgetLimitEnrichment.php | 12 +- .../Enrichments/PiggyBankEnrichment.php | 2 +- .../Enrichments/RecurringEnrichment.php | 3 +- app/Support/Navigation.php | 26 +- app/Support/ParseDateString.php | 5 +- app/Support/Preferences.php | 2 - .../Report/Budget/BudgetReportGenerator.php | 2 - app/Support/Request/ConvertsDataTypes.php | 1 + app/Support/Search/AccountSearch.php | 1 + app/Support/Search/OperatorQuerySearch.php | 2 - .../Search/QueryParser/GdbotsQueryParser.php | 4 +- app/Support/Steam.php | 4 +- app/Support/System/OAuthKeys.php | 2 +- app/Support/Twig/General.php | 1 + app/Support/Twig/TransactionGroupTwig.php | 1 + app/Transformers/PiggyBankTransformer.php | 1 - app/Transformers/RecurrenceTransformer.php | 1 - app/Transformers/UserTransformer.php | 1 - .../WebhookMessageTransformer.php | 1 + .../Bulk/ValidatesBulkTransactionQuery.php | 1 + app/Validation/FireflyValidator.php | 5 +- config/firefly.php | 4 +- package-lock.json | 238 +++++++++--------- 180 files changed, 285 insertions(+), 455 deletions(-) diff --git a/app/Api/V1/Controllers/Chart/BudgetController.php b/app/Api/V1/Controllers/Chart/BudgetController.php index 194bcf0362..6f0425d6fb 100644 --- a/app/Api/V1/Controllers/Chart/BudgetController.php +++ b/app/Api/V1/Controllers/Chart/BudgetController.php @@ -259,7 +259,6 @@ class BudgetController extends Controller return $return; } - private function filterLimit(int $currencyId, Collection $limits): ?BudgetLimit { $amount = '0'; diff --git a/app/Api/V1/Controllers/Data/Export/ExportController.php b/app/Api/V1/Controllers/Data/Export/ExportController.php index 685217f769..7e78ca920e 100644 --- a/app/Api/V1/Controllers/Data/Export/ExportController.php +++ b/app/Api/V1/Controllers/Data/Export/ExportController.php @@ -31,6 +31,7 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Support\Export\ExportDataGenerator; use Illuminate\Http\Response as LaravelResponse; use Safe\Exceptions\DatetimeException; + use function Safe\date; /** @@ -60,11 +61,9 @@ class ExportController extends Controller } /** - * @param ExportRequest $request - * - * @return LaravelResponse * @throws DatetimeException * @throws FireflyException + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function accounts(ExportRequest $request): LaravelResponse @@ -102,11 +101,9 @@ class ExportController extends Controller } /** - * @param ExportRequest $request - * - * @return LaravelResponse * @throws DatetimeException * @throws FireflyException + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function bills(ExportRequest $request): LaravelResponse @@ -117,11 +114,9 @@ class ExportController extends Controller } /** - * @param ExportRequest $request - * - * @return LaravelResponse * @throws DatetimeException * @throws FireflyException + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function budgets(ExportRequest $request): LaravelResponse @@ -132,11 +127,9 @@ class ExportController extends Controller } /** - * @param ExportRequest $request - * - * @return LaravelResponse * @throws DatetimeException * @throws FireflyException + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function categories(ExportRequest $request): LaravelResponse @@ -147,11 +140,9 @@ class ExportController extends Controller } /** - * @param ExportRequest $request - * - * @return LaravelResponse * @throws DatetimeException * @throws FireflyException + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function piggyBanks(ExportRequest $request): LaravelResponse @@ -162,11 +153,9 @@ class ExportController extends Controller } /** - * @param ExportRequest $request - * - * @return LaravelResponse * @throws DatetimeException * @throws FireflyException + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function recurring(ExportRequest $request): LaravelResponse @@ -177,11 +166,9 @@ class ExportController extends Controller } /** - * @param ExportRequest $request - * - * @return LaravelResponse * @throws DatetimeException * @throws FireflyException + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function rules(ExportRequest $request): LaravelResponse @@ -192,11 +179,9 @@ class ExportController extends Controller } /** - * @param ExportRequest $request - * - * @return LaravelResponse * @throws DatetimeException * @throws FireflyException + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function tags(ExportRequest $request): LaravelResponse @@ -207,9 +192,6 @@ class ExportController extends Controller } /** - * @param ExportRequest $request - * - * @return LaravelResponse * @throws DatetimeException * @throws FireflyException */ diff --git a/app/Api/V1/Controllers/Models/Account/ListController.php b/app/Api/V1/Controllers/Models/Account/ListController.php index 6ea2908f76..b230572b93 100644 --- a/app/Api/V1/Controllers/Models/Account/ListController.php +++ b/app/Api/V1/Controllers/Models/Account/ListController.php @@ -69,8 +69,6 @@ class ListController extends Controller ); } - /** - */ public function attachments(Account $account): JsonResponse { $manager = $this->getManager(); @@ -94,8 +92,6 @@ class ListController extends Controller return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE); } - /** - */ public function piggyBanks(Account $account): JsonResponse { // create some objects: @@ -132,7 +128,6 @@ class ListController extends Controller /** * Show all transaction groups related to the account. - * */ public function transactions(Request $request, Account $account): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Account/ShowController.php b/app/Api/V1/Controllers/Models/Account/ShowController.php index 74c5fba684..230246bcf1 100644 --- a/app/Api/V1/Controllers/Models/Account/ShowController.php +++ b/app/Api/V1/Controllers/Models/Account/ShowController.php @@ -67,7 +67,6 @@ class ShowController extends Controller /** * Display a listing of the resource. - * */ public function index(ShowRequest $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Attachment/ShowController.php b/app/Api/V1/Controllers/Models/Attachment/ShowController.php index 3785d30b35..273c8dc986 100644 --- a/app/Api/V1/Controllers/Models/Attachment/ShowController.php +++ b/app/Api/V1/Controllers/Models/Attachment/ShowController.php @@ -119,7 +119,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/attachments/listAttachment * * Display a listing of the resource. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php b/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php index 9ee8b50278..ee0c01610f 100644 --- a/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php +++ b/app/Api/V1/Controllers/Models/AvailableBudget/ShowController.php @@ -66,7 +66,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/available_budgets/getAvailableBudget * * Display a listing of the resource. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Bill/ListController.php b/app/Api/V1/Controllers/Models/Bill/ListController.php index e6a98f6716..e33c6f5804 100644 --- a/app/Api/V1/Controllers/Models/Bill/ListController.php +++ b/app/Api/V1/Controllers/Models/Bill/ListController.php @@ -70,7 +70,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/bills/listAttachmentByBill * * Display a listing of the resource. - * */ public function attachments(Bill $bill): JsonResponse { @@ -100,7 +99,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/bills/listRuleByBill * * List all of them. - * */ public function rules(Bill $bill): JsonResponse { @@ -132,7 +130,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/bills/listTransactionByBill * * Show all transactions. - * */ public function transactions(Request $request, Bill $bill): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Bill/ShowController.php b/app/Api/V1/Controllers/Models/Bill/ShowController.php index 7ca52a322e..396c6e4db8 100644 --- a/app/Api/V1/Controllers/Models/Bill/ShowController.php +++ b/app/Api/V1/Controllers/Models/Bill/ShowController.php @@ -64,7 +64,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/bills/listBill * * Display a listing of the resource. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Budget/ListController.php b/app/Api/V1/Controllers/Models/Budget/ListController.php index 17b3f95a94..f2a80bbcb7 100644 --- a/app/Api/V1/Controllers/Models/Budget/ListController.php +++ b/app/Api/V1/Controllers/Models/Budget/ListController.php @@ -72,7 +72,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listAttachmentByBudget - * */ public function attachments(Budget $budget): JsonResponse { @@ -102,7 +101,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listBudgetLimitByBudget * * Display a listing of the resource. - * */ public function budgetLimits(Budget $budget): JsonResponse { @@ -137,7 +135,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionByBudget * * Show all transactions. - * */ public function transactions(Request $request, Budget $budget): JsonResponse { @@ -198,7 +195,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionWithoutBudget * * Show all transactions. - * */ public function withoutBudget(Request $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Budget/ShowController.php b/app/Api/V1/Controllers/Models/Budget/ShowController.php index 55994b1fc0..7b3dfde927 100644 --- a/app/Api/V1/Controllers/Models/Budget/ShowController.php +++ b/app/Api/V1/Controllers/Models/Budget/ShowController.php @@ -68,7 +68,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listBudget * * Display a listing of the resource. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php b/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php index 0e8d707900..f21f276843 100644 --- a/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php +++ b/app/Api/V1/Controllers/Models/BudgetLimit/ListController.php @@ -48,7 +48,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionByBudgetLimit * Show all transactions. - * */ public function transactions(Request $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Category/ListController.php b/app/Api/V1/Controllers/Models/Category/ListController.php index fbadd0c42a..fa71b0a631 100644 --- a/app/Api/V1/Controllers/Models/Category/ListController.php +++ b/app/Api/V1/Controllers/Models/Category/ListController.php @@ -67,7 +67,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listAttachmentByCategory - * */ public function attachments(Category $category): JsonResponse { @@ -97,7 +96,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listTransactionByCategory * * Show all transactions. - * */ public function transactions(Request $request, Category $category): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Category/ShowController.php b/app/Api/V1/Controllers/Models/Category/ShowController.php index 0f827ed175..2fc4137ad7 100644 --- a/app/Api/V1/Controllers/Models/Category/ShowController.php +++ b/app/Api/V1/Controllers/Models/Category/ShowController.php @@ -64,7 +64,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listCategory * * Display a listing of the resource. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php b/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php index cac0aa7cc5..86a5d8bac4 100644 --- a/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php +++ b/app/Api/V1/Controllers/Models/ObjectGroup/ListController.php @@ -67,7 +67,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/object_groups/listBillByObjectGroup * * List all bills in this object group - * */ public function bills(ObjectGroup $objectGroup): JsonResponse { @@ -107,7 +106,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/object_groups/listPiggyBankByObjectGroup * * List all piggies under the object group. - * */ public function piggyBanks(ObjectGroup $objectGroup): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/PiggyBank/ListController.php b/app/Api/V1/Controllers/Models/PiggyBank/ListController.php index 2eff6ea53c..e22e88337d 100644 --- a/app/Api/V1/Controllers/Models/PiggyBank/ListController.php +++ b/app/Api/V1/Controllers/Models/PiggyBank/ListController.php @@ -66,7 +66,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAccountByPiggyBank * * List single resource. - * */ public function accounts(PiggyBank $piggyBank): JsonResponse { @@ -103,7 +102,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAttachmentByPiggyBank - * */ public function attachments(PiggyBank $piggyBank): JsonResponse { @@ -133,7 +131,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listEventByPiggyBank * * List single resource. - * */ public function piggyBankEvents(PiggyBank $piggyBank): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php b/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php index 5f6274e14e..7fb1fb5e71 100644 --- a/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php +++ b/app/Api/V1/Controllers/Models/PiggyBank/ShowController.php @@ -64,7 +64,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listPiggyBank * * List all of them. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Recurrence/ListController.php b/app/Api/V1/Controllers/Models/Recurrence/ListController.php index ea5ed5786d..ce6a9d61a9 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/ListController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/ListController.php @@ -67,7 +67,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/recurrences/listTransactionByRecurrence * * Show transactions for this recurrence. - * */ public function transactions(Request $request, Recurrence $recurrence): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Recurrence/ShowController.php b/app/Api/V1/Controllers/Models/Recurrence/ShowController.php index d08117d869..7b3b9a23b9 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/ShowController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/ShowController.php @@ -64,7 +64,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/recurrences/listRecurrence * * List all of them. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php b/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php index e9662efaf1..7f4ad30b60 100644 --- a/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php +++ b/app/Api/V1/Controllers/Models/Recurrence/TriggerController.php @@ -87,7 +87,7 @@ class TriggerController extends Controller // enrich groups and return them: - $paginator = new LengthAwarePaginator(new Collection(), 0, 1); + $paginator = new LengthAwarePaginator(new Collection(), 0, 1); if ($groups->count() > 0) { /** @var User $admin */ $admin = auth()->user(); diff --git a/app/Api/V1/Controllers/Models/Rule/ShowController.php b/app/Api/V1/Controllers/Models/Rule/ShowController.php index d18599802c..045c61ad28 100644 --- a/app/Api/V1/Controllers/Models/Rule/ShowController.php +++ b/app/Api/V1/Controllers/Models/Rule/ShowController.php @@ -66,7 +66,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/listRule * * List all of them. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/RuleGroup/ListController.php b/app/Api/V1/Controllers/Models/RuleGroup/ListController.php index d39590f831..2d296ce903 100644 --- a/app/Api/V1/Controllers/Models/RuleGroup/ListController.php +++ b/app/Api/V1/Controllers/Models/RuleGroup/ListController.php @@ -63,7 +63,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rule_groups/listRuleByGroup - * */ public function rules(RuleGroup $group): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php b/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php index cd9d42c2d3..b5f08d9d9a 100644 --- a/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php +++ b/app/Api/V1/Controllers/Models/RuleGroup/ShowController.php @@ -65,7 +65,6 @@ class ShowController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rule_groups/listRuleGroup * List all of them. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Tag/ListController.php b/app/Api/V1/Controllers/Models/Tag/ListController.php index 49899a4eec..aed5652f85 100644 --- a/app/Api/V1/Controllers/Models/Tag/ListController.php +++ b/app/Api/V1/Controllers/Models/Tag/ListController.php @@ -70,7 +70,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/tags/listAttachmentByTag - * */ public function attachments(Tag $tag): JsonResponse { @@ -100,7 +99,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/tags/listTransactionByTag * * Show all transactions. - * */ public function transactions(Request $request, Tag $tag): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Tag/ShowController.php b/app/Api/V1/Controllers/Models/Tag/ShowController.php index f69d050ddc..f239cb35c5 100644 --- a/app/Api/V1/Controllers/Models/Tag/ShowController.php +++ b/app/Api/V1/Controllers/Models/Tag/ShowController.php @@ -66,7 +66,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/tags/listTag * * List all of them. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Transaction/ListController.php b/app/Api/V1/Controllers/Models/Transaction/ListController.php index fbc68db891..ab96a00af7 100644 --- a/app/Api/V1/Controllers/Models/Transaction/ListController.php +++ b/app/Api/V1/Controllers/Models/Transaction/ListController.php @@ -68,7 +68,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listAttachmentByTransaction - * */ public function attachments(TransactionGroup $transactionGroup): JsonResponse { @@ -99,7 +98,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listEventByTransaction - * */ public function piggyBankEvents(TransactionGroup $transactionGroup): JsonResponse { @@ -141,7 +139,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listLinksByJournal - * */ public function transactionLinks(TransactionJournal $transactionJournal): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/Transaction/ShowController.php b/app/Api/V1/Controllers/Models/Transaction/ShowController.php index 90942fff14..ee45ded96d 100644 --- a/app/Api/V1/Controllers/Models/Transaction/ShowController.php +++ b/app/Api/V1/Controllers/Models/Transaction/ShowController.php @@ -51,7 +51,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listTransaction * * Show all transactions. - * */ public function index(Request $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php index 02bec34c6a..53d9beea16 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ListController.php @@ -70,7 +70,6 @@ class ListController extends Controller * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listAccountByCurrency * Display a list of accounts. - * */ public function accounts(Request $request, TransactionCurrency $currency): JsonResponse { @@ -127,7 +126,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listAvailableBudgetByCurrency * * Display a listing of the resource. - * */ public function availableBudgets(TransactionCurrency $currency): JsonResponse { @@ -161,7 +159,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listBillByCurrency * * List all bills - * */ public function bills(TransactionCurrency $currency): JsonResponse { @@ -207,7 +204,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listBudgetLimitByCurrency * * List all budget limits - * */ public function budgetLimits(TransactionCurrency $currency): JsonResponse { @@ -244,7 +240,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listRecurrenceByCurrency * * List all recurring transactions. - * */ public function recurrences(TransactionCurrency $currency): JsonResponse { @@ -296,7 +291,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listRuleByCurrency * * List all of them. - * */ public function rules(TransactionCurrency $currency): JsonResponse { @@ -340,7 +334,6 @@ class ListController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listTransactionByCurrency * * Show all transactions. - * */ public function transactions(Request $request, TransactionCurrency $currency): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php index 8f4168ae1e..d0920b00f5 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php @@ -68,7 +68,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listCurrency * * Display a listing of the resource. - * */ public function index(): JsonResponse { @@ -97,7 +96,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/getCurrency * * Show a currency. - * */ public function show(TransactionCurrency $currency): JsonResponse { @@ -120,7 +118,6 @@ class ShowController extends Controller /** * Show a currency. - * */ public function showPrimary(): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php index bbead26e16..56b61b9c99 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php @@ -65,7 +65,6 @@ class StoreController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/storeCurrency * * Store new currency. - * */ public function store(StoreRequest $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php index eca115a7d8..f76bfaf8a2 100644 --- a/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php +++ b/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php @@ -98,8 +98,6 @@ class UpdateController extends Controller return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE); } - /** - */ public function makePrimary(TransactionCurrency $currency): JsonResponse { /** @var User $user */ @@ -126,7 +124,6 @@ class UpdateController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/enableCurrency * * Enable a currency. - * */ public function enable(TransactionCurrency $currency): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php b/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php index a45be78c09..fb2e80204d 100644 --- a/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionLink/ShowController.php @@ -68,7 +68,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listTransactionLink * * List all transaction links there are. - * */ public function index(Request $request): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php index a71cfa46e9..03537cfe62 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/ListController.php @@ -67,7 +67,6 @@ class ListController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listTransactionByLinkType - * */ public function transactions(Request $request, LinkType $linkType): JsonResponse { diff --git a/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php b/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php index 65af2aa929..27c7a4eb15 100644 --- a/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php +++ b/app/Api/V1/Controllers/Models/TransactionLinkType/ShowController.php @@ -66,7 +66,6 @@ class ShowController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listLinkType - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Search/TransactionController.php b/app/Api/V1/Controllers/Search/TransactionController.php index 040e672934..d95daf8c37 100644 --- a/app/Api/V1/Controllers/Search/TransactionController.php +++ b/app/Api/V1/Controllers/Search/TransactionController.php @@ -41,7 +41,6 @@ class TransactionController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/search/searchTransactions - * */ public function search(Request $request, SearchInterface $searcher): JsonResponse { diff --git a/app/Api/V1/Controllers/System/UserController.php b/app/Api/V1/Controllers/System/UserController.php index edffb84c44..d08807ab52 100644 --- a/app/Api/V1/Controllers/System/UserController.php +++ b/app/Api/V1/Controllers/System/UserController.php @@ -90,7 +90,6 @@ class UserController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/users/listUser * * Display a listing of the resource. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/User/PreferencesController.php b/app/Api/V1/Controllers/User/PreferencesController.php index 552d10c8e0..e5a97f7628 100644 --- a/app/Api/V1/Controllers/User/PreferencesController.php +++ b/app/Api/V1/Controllers/User/PreferencesController.php @@ -49,7 +49,6 @@ class PreferencesController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/preferences/listPreference * * List all of them. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Controllers/Webhook/MessageController.php b/app/Api/V1/Controllers/Webhook/MessageController.php index a5426ca91d..475724f4c5 100644 --- a/app/Api/V1/Controllers/Webhook/MessageController.php +++ b/app/Api/V1/Controllers/Webhook/MessageController.php @@ -62,7 +62,6 @@ class MessageController extends Controller /** * This endpoint is documented at: * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/webhooks/getWebhookMessages - * */ public function index(Webhook $webhook): JsonResponse { diff --git a/app/Api/V1/Controllers/Webhook/ShowController.php b/app/Api/V1/Controllers/Webhook/ShowController.php index 466f0e8a90..62c39258b4 100644 --- a/app/Api/V1/Controllers/Webhook/ShowController.php +++ b/app/Api/V1/Controllers/Webhook/ShowController.php @@ -69,7 +69,6 @@ class ShowController extends Controller * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/webhooks/listWebhook * * Display a listing of the webhooks of the user. - * */ public function index(): JsonResponse { diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index 14b660d7fe..902967a9c2 100644 --- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php @@ -33,6 +33,7 @@ use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Log; use Illuminate\Validation\Validator; use JsonException; + use function Safe\json_decode; /** diff --git a/app/Console/Commands/Export/ExportsData.php b/app/Console/Commands/Export/ExportsData.php index cd1d53e9f5..90a8c9602b 100644 --- a/app/Console/Commands/Export/ExportsData.php +++ b/app/Console/Commands/Export/ExportsData.php @@ -40,6 +40,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use InvalidArgumentException; use Safe\Exceptions\FilesystemException; + use function Safe\file_put_contents; class ExportsData extends Command @@ -275,9 +276,6 @@ class ExportsData extends Command } /** - * @param array $options - * @param array $data - * * @throws FireflyException * @throws FilesystemException */ diff --git a/app/Console/Commands/System/ForcesDecimalSize.php b/app/Console/Commands/System/ForcesDecimalSize.php index c92183b8c3..4cbbe5546c 100644 --- a/app/Console/Commands/System/ForcesDecimalSize.php +++ b/app/Console/Commands/System/ForcesDecimalSize.php @@ -42,6 +42,7 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; + use function Safe\json_encode; use function Safe\mb_regex_encoding; diff --git a/app/Console/Commands/System/ResetsErrorMailLimit.php b/app/Console/Commands/System/ResetsErrorMailLimit.php index c896842a17..ffba1aad82 100644 --- a/app/Console/Commands/System/ResetsErrorMailLimit.php +++ b/app/Console/Commands/System/ResetsErrorMailLimit.php @@ -28,6 +28,7 @@ namespace FireflyIII\Console\Commands\System; use FireflyIII\Console\Commands\ShowsFriendlyMessages; use Illuminate\Console\Command; use Symfony\Component\Console\Command\Command as CommandAlias; + use function Safe\file_put_contents; use function Safe\json_encode; diff --git a/app/Console/Commands/System/ScansAttachments.php b/app/Console/Commands/System/ScansAttachments.php index 0e9b8c8128..0225cf0008 100644 --- a/app/Console/Commands/System/ScansAttachments.php +++ b/app/Console/Commands/System/ScansAttachments.php @@ -34,6 +34,7 @@ use Illuminate\Support\Facades\Storage; use Safe\Exceptions\FileinfoException; use Safe\Exceptions\FilesystemException; use Safe\Exceptions\StringsException; + use function Safe\file_put_contents; use function Safe\md5_file; use function Safe\mime_content_type; diff --git a/app/Console/Commands/System/VerifySecurityAlerts.php b/app/Console/Commands/System/VerifySecurityAlerts.php index 878f762711..ff801050b9 100644 --- a/app/Console/Commands/System/VerifySecurityAlerts.php +++ b/app/Console/Commands/System/VerifySecurityAlerts.php @@ -31,6 +31,7 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use League\Flysystem\FilesystemException; use Safe\Exceptions\JsonException; + use function Safe\json_decode; class VerifySecurityAlerts extends Command @@ -44,7 +45,6 @@ class VerifySecurityAlerts extends Command /** * Execute the console command. * - * @return int * @throws FilesystemException * @throws JsonException */ diff --git a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php index 79a8f0bfaf..baef09da3d 100644 --- a/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php +++ b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php @@ -52,7 +52,6 @@ class AddsTransactionIdentifiers extends Command * * When either of these are the same amount, FF3 can't keep them apart: +3/-3, +3/-3, +3/-3. This happens more * often than you would think. So each set gets a number (1,2,3) to keep them apart. - * */ public function handle(): int { @@ -99,6 +98,7 @@ class AddsTransactionIdentifiers extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php index cf66e8cc06..03070692ef 100644 --- a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php +++ b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php @@ -34,6 +34,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use JsonException; use stdClass; + use function Safe\json_decode; class RemovesDatabaseDecryption extends Command @@ -98,6 +99,7 @@ class RemovesDatabaseDecryption extends Command } catch (FireflyException $e) { Log::error($e->getMessage()); } + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php b/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php index 50a9fc71c1..cb1a35cc55 100644 --- a/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php +++ b/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php @@ -98,8 +98,6 @@ class UpgradesAccountCurrencies extends Command } } - /** - */ private function updateCurrenciesForUser(User $user): void { $this->accountRepos->setUser($user); diff --git a/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php b/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php index 7e8f6168cc..234fc3cba8 100644 --- a/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php +++ b/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php @@ -83,6 +83,7 @@ class UpgradesAccountMetaData extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesAttachments.php b/app/Console/Commands/Upgrade/UpgradesAttachments.php index b9cfea1ed6..5c8022345b 100644 --- a/app/Console/Commands/Upgrade/UpgradesAttachments.php +++ b/app/Console/Commands/Upgrade/UpgradesAttachments.php @@ -93,6 +93,7 @@ class UpgradesAttachments extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesBillsToRules.php b/app/Console/Commands/Upgrade/UpgradesBillsToRules.php index 62d43c1889..a244f74738 100644 --- a/app/Console/Commands/Upgrade/UpgradesBillsToRules.php +++ b/app/Console/Commands/Upgrade/UpgradesBillsToRules.php @@ -99,13 +99,13 @@ class UpgradesBillsToRules extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } /** * Migrate bills to new rule structure for a specific user. - * */ private function migrateUser(User $user): void { diff --git a/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php b/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php index 6430407ea4..2b55dabfd5 100644 --- a/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php +++ b/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php @@ -85,6 +85,7 @@ class UpgradesBudgetLimits extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php b/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php index ddecd04fef..92b8b0445b 100644 --- a/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php +++ b/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php @@ -66,6 +66,7 @@ class UpgradesCurrencyPreferences extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesDatabase.php b/app/Console/Commands/Upgrade/UpgradesDatabase.php index bbc6c8ee68..32ff857c9e 100644 --- a/app/Console/Commands/Upgrade/UpgradesDatabase.php +++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php @@ -29,6 +29,7 @@ use FireflyIII\Support\Facades\FireflyConfig; use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; use Safe\Exceptions\InfoException; + use function Safe\set_time_limit; try { diff --git a/app/Console/Commands/Upgrade/UpgradesJournalNotes.php b/app/Console/Commands/Upgrade/UpgradesJournalNotes.php index 6ae07abb09..2190cea5e1 100644 --- a/app/Console/Commands/Upgrade/UpgradesJournalNotes.php +++ b/app/Console/Commands/Upgrade/UpgradesJournalNotes.php @@ -87,6 +87,7 @@ class UpgradesJournalNotes extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesLiabilities.php b/app/Console/Commands/Upgrade/UpgradesLiabilities.php index aaf5f7b221..23b94883f7 100644 --- a/app/Console/Commands/Upgrade/UpgradesLiabilities.php +++ b/app/Console/Commands/Upgrade/UpgradesLiabilities.php @@ -62,6 +62,7 @@ class UpgradesLiabilities extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php b/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php index 571fb94ec8..26ecde2584 100644 --- a/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php +++ b/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php @@ -64,6 +64,7 @@ class UpgradesLiabilitiesEight extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php b/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php index ecceb1a085..61f7ba4b0e 100644 --- a/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php +++ b/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php @@ -65,6 +65,7 @@ class UpgradesMultiPiggyBanks extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php b/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php index c233272cba..40e768aefc 100644 --- a/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php +++ b/app/Console/Commands/Upgrade/UpgradesPrimaryCurrencyAmounts.php @@ -61,6 +61,7 @@ class UpgradesPrimaryCurrencyAmounts extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php index 7ffd859065..c6126388ec 100644 --- a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php +++ b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php @@ -29,6 +29,7 @@ use FireflyIII\Models\Recurrence; use FireflyIII\Models\RecurrenceMeta; use FireflyIII\Models\RecurrenceTransactionMeta; use Illuminate\Console\Command; + use function Safe\json_encode; class UpgradesRecurrenceMetaData extends Command @@ -65,6 +66,7 @@ class UpgradesRecurrenceMetaData extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesRuleActions.php b/app/Console/Commands/Upgrade/UpgradesRuleActions.php index 7baeb2cbe2..0be7c55811 100644 --- a/app/Console/Commands/Upgrade/UpgradesRuleActions.php +++ b/app/Console/Commands/Upgrade/UpgradesRuleActions.php @@ -64,6 +64,7 @@ class UpgradesRuleActions extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesTagLocations.php b/app/Console/Commands/Upgrade/UpgradesTagLocations.php index cd60c5b825..c891de9982 100644 --- a/app/Console/Commands/Upgrade/UpgradesTagLocations.php +++ b/app/Console/Commands/Upgrade/UpgradesTagLocations.php @@ -58,6 +58,7 @@ class UpgradesTagLocations extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php index 95fbcf339b..c5db2427ca 100644 --- a/app/Console/Commands/Upgrade/UpgradesToGroups.php +++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php @@ -98,6 +98,7 @@ class UpgradesToGroups extends Command private function isMigrated(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php index 1aced94507..2b4b566c8b 100644 --- a/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php +++ b/app/Console/Commands/Upgrade/UpgradesTransferCurrencies.php @@ -106,6 +106,7 @@ class UpgradesTransferCurrencies extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php b/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php index 49c4e0cf28..2b47161771 100644 --- a/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php +++ b/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php @@ -87,6 +87,7 @@ class UpgradesVariousCurrencyInformation extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/Upgrade/UpgradesWebhooks.php b/app/Console/Commands/Upgrade/UpgradesWebhooks.php index 6dd824473a..e917b09596 100644 --- a/app/Console/Commands/Upgrade/UpgradesWebhooks.php +++ b/app/Console/Commands/Upgrade/UpgradesWebhooks.php @@ -64,6 +64,7 @@ class UpgradesWebhooks extends Command private function isExecuted(): bool { $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); + return (bool)$configVar?->data; } diff --git a/app/Console/Commands/VerifiesAccessToken.php b/app/Console/Commands/VerifiesAccessToken.php index 2dcb004d35..906980df68 100644 --- a/app/Console/Commands/VerifiesAccessToken.php +++ b/app/Console/Commands/VerifiesAccessToken.php @@ -64,7 +64,6 @@ trait VerifiesAccessToken /** * Returns false when given token does not match given user token. - * */ protected function verifyAccessToken(): bool { diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index f160030059..bc010ba8fa 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -49,6 +49,7 @@ use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Throwable; + use function Safe\json_encode; use function Safe\parse_url; diff --git a/app/Factory/AccountFactory.php b/app/Factory/AccountFactory.php index ce47fd2e35..22df6a483e 100644 --- a/app/Factory/AccountFactory.php +++ b/app/Factory/AccountFactory.php @@ -78,7 +78,8 @@ class AccountFactory if (!$type instanceof AccountType) { throw new FireflyException(sprintf('Cannot find account type "%s"', $accountType)); } - /** @var Account|null $return */ + + /** @var null|Account $return */ $return = $this->user->accounts->where('account_type_id', $type->id)->where('name', $accountName)->first(); if (null === $return) { diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.php index 2cf4d35a68..dc6b401311 100644 --- a/app/Factory/PiggyBankFactory.php +++ b/app/Factory/PiggyBankFactory.php @@ -36,6 +36,7 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\User; use Illuminate\Database\QueryException; use Illuminate\Support\Facades\Log; + use function Safe\json_encode; /** diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index 5f218c5d3f..d11753a2bf 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -55,6 +55,7 @@ use FireflyIII\Validation\AccountValidator; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use JsonException; + use function Safe\json_encode; /** @@ -342,8 +343,6 @@ class TransactionJournalFactory /** * If this transaction already exists, throw an error. * - * @param string $hash - * * @throws DuplicateTransactionException * @throws JsonException * @throws \Safe\Exceptions\JsonException @@ -480,8 +479,6 @@ class TransactionJournalFactory }; } - /** - */ private function getCurrency(?TransactionCurrency $currency, Account $account): TransactionCurrency { Log::debug(sprintf('Now in getCurrency(#%d, "%s")', $currency?->id, $account->name)); diff --git a/app/Handlers/Events/BillEventHandler.php b/app/Handlers/Events/BillEventHandler.php index aef9cb49d2..9969bfbf1c 100644 --- a/app/Handlers/Events/BillEventHandler.php +++ b/app/Handlers/Events/BillEventHandler.php @@ -33,6 +33,7 @@ use FireflyIII\Notifications\User\SubscriptionsOverdueReminder; use FireflyIII\Support\Facades\Preferences; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Notification; + use function Safe\json_encode; /** diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index 39271d86a2..db1fdd4134 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -164,7 +164,6 @@ class UserEventHandler /** * Set the demo user back to English. - * */ public function demoUserBackToEnglish(Login $event): void { @@ -181,8 +180,6 @@ class UserEventHandler } } - /** - */ public function notifyNewIPAddress(DetectedNewIPAddress $event): void { $user = $event->user; @@ -445,8 +442,6 @@ class UserEventHandler Log::debug(sprintf('If you see no errors above this line, test notification was sent over channel "%s"', $event->channel)); } - /** - */ public function storeUserIPAddress(ActuallyLoggedIn $event): void { app('log')->debug('Now in storeUserIPAddress'); diff --git a/app/Handlers/Events/VersionCheckEventHandler.php b/app/Handlers/Events/VersionCheckEventHandler.php index 2087d37f76..3a2d7c42d4 100644 --- a/app/Handlers/Events/VersionCheckEventHandler.php +++ b/app/Handlers/Events/VersionCheckEventHandler.php @@ -44,8 +44,6 @@ class VersionCheckEventHandler /** * Checks with GitHub to see if there is a new version. * - * @param RequestedVersionCheckStatus $event - * * @throws ContainerExceptionInterface * @throws FireflyException * @throws NotFoundExceptionInterface @@ -93,8 +91,6 @@ class VersionCheckEventHandler } /** - * @param RequestedVersionCheckStatus $event - * * @throws FireflyException * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index ef0cf558d2..c4d79ed8d2 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -38,11 +38,13 @@ use Safe\Exceptions\FileinfoException; use Safe\Exceptions\FilesystemException; use Safe\Exceptions\StringsException; use Symfony\Component\HttpFoundation\File\UploadedFile; + use function Safe\fclose; use function Safe\finfo_open; use function Safe\fwrite; use function Safe\md5_file; use function Safe\tmpfile; + use const DIRECTORY_SEPARATOR; /** @@ -220,10 +222,6 @@ class AttachmentHelper implements AttachmentHelperInterface /** * Process the upload of a file. * - * @param UploadedFile $file - * @param Model $model - * - * @return Attachment|null * @throws StringsException */ protected function processFile(UploadedFile $file, Model $model): ?Attachment diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php index 40185ef81c..11a15ef799 100644 --- a/app/Helpers/Collector/Extensions/MetaCollection.php +++ b/app/Helpers/Collector/Extensions/MetaCollection.php @@ -36,6 +36,7 @@ use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; + use function Safe\json_encode; /** diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index db4834fbf2..7a44ba5737 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -48,6 +48,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Override; use Safe\Exceptions\JsonException; + use function Safe\json_decode; /** @@ -564,9 +565,6 @@ class GroupCollector implements GroupCollectorInterface } /** - * @param TransactionJournal $augumentedJournal - * - * @return array * @throws FireflyException * @throws JsonException */ diff --git a/app/Helpers/Fiscal/FiscalHelper.php b/app/Helpers/Fiscal/FiscalHelper.php index ae7ebc752b..53aad1fef3 100644 --- a/app/Helpers/Fiscal/FiscalHelper.php +++ b/app/Helpers/Fiscal/FiscalHelper.php @@ -64,9 +64,8 @@ class FiscalHelper implements FiscalHelperInterface } /** - * @param Carbon $date - * * @return Carbon date object + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Helpers/Webhook/Sha3SignatureGenerator.php b/app/Helpers/Webhook/Sha3SignatureGenerator.php index ce6a0680f7..06967cff04 100644 --- a/app/Helpers/Webhook/Sha3SignatureGenerator.php +++ b/app/Helpers/Webhook/Sha3SignatureGenerator.php @@ -28,6 +28,7 @@ use Carbon\Carbon; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\WebhookMessage; use JsonException; + use function Safe\json_encode; /** diff --git a/app/Http/Controllers/Account/CreateController.php b/app/Http/Controllers/Account/CreateController.php index e884c7c5cc..bab54065d9 100644 --- a/app/Http/Controllers/Account/CreateController.php +++ b/app/Http/Controllers/Account/CreateController.php @@ -132,8 +132,6 @@ class CreateController extends Controller /** * Store the new account. * - * @param AccountFormRequest $request - * * @return Redirector|RedirectResponse * * @throws ContainerExceptionInterface diff --git a/app/Http/Controllers/Account/IndexController.php b/app/Http/Controllers/Account/IndexController.php index 8d35f6b56e..4f34f0dd5f 100644 --- a/app/Http/Controllers/Account/IndexController.php +++ b/app/Http/Controllers/Account/IndexController.php @@ -67,9 +67,6 @@ class IndexController extends Controller } /** - * @param Request $request - * @param string $objectType - * * @return Factory|View * * @throws ContainerExceptionInterface @@ -141,9 +138,6 @@ class IndexController extends Controller /** * Show list of accounts. * - * @param Request $request - * @param string $objectType - * * @return Factory|View * * @throws ContainerExceptionInterface diff --git a/app/Http/Controllers/Account/ShowController.php b/app/Http/Controllers/Account/ShowController.php index 8181e0ff80..9b1a6922f6 100644 --- a/app/Http/Controllers/Account/ShowController.php +++ b/app/Http/Controllers/Account/ShowController.php @@ -78,11 +78,6 @@ class ShowController extends Controller /** * Show an account. * - * @param Request $request - * @param Account $account - * @param Carbon|null $start - * @param Carbon|null $end - * * @return Factory|Redirector|RedirectResponse|View * * @throws ContainerExceptionInterface @@ -202,9 +197,6 @@ class ShowController extends Controller /** * Show an account. * - * @param Request $request - * @param Account $account - * * @return Factory|Redirector|RedirectResponse|View * * @throws ContainerExceptionInterface diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index 264d79158d..bd14a9d51b 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -49,6 +49,7 @@ class HomeController extends Controller * Index of the admin. * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 54ad535864..736ae8edf7 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -154,6 +154,7 @@ class UserController extends Controller * Show index of user manager. * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws FireflyException * @throws NotFoundExceptionInterface diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index c9d54c0982..a945fc7879 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -36,6 +36,7 @@ use Illuminate\View\View; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\UrlException; + use function Safe\parse_url; /** @@ -61,10 +62,8 @@ class ForgotPasswordController extends Controller /** * Send a reset link to the given user. * - * @param Request $request - * @param UserRepositoryInterface $repository - * * @return Factory|RedirectResponse|View + * * @throws FireflyException */ public function sendResetLinkEmail(Request $request, UserRepositoryInterface $repository) diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 6e4bba5669..30b0bce73f 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -221,8 +221,6 @@ class LoginController extends Controller /** * Show the application's login form. * - * @param Request $request - * * @return Application|Factory|Redirector|RedirectResponse|View * * @throws FireflyException diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 4122f3fa5a..a36e65e8bc 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -140,9 +140,6 @@ class RegisterController extends Controller /** * Show the application registration form if the invitation code is valid. * - * @param Request $request - * @param string $code - * * @return Factory|View * * @throws ContainerExceptionInterface @@ -177,8 +174,6 @@ class RegisterController extends Controller /** * Show the application registration form. * - * @param Request|null $request - * * @return Factory|View * * @throws ContainerExceptionInterface diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index 7ff28e0264..714d98bf32 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -114,8 +114,7 @@ class ResetPasswordController extends Controller * * If no token is present, display the link request form. * - * @param Request $request - * @param null $token + * @param null $token * * @return Factory|View * diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php index d9cd52c035..a651b7c50a 100644 --- a/app/Http/Controllers/Auth/TwoFactorController.php +++ b/app/Http/Controllers/Auth/TwoFactorController.php @@ -61,9 +61,8 @@ class TwoFactorController extends Controller } /** - * @param Request $request - * * @return Redirector|RedirectResponse + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/Bill/IndexController.php b/app/Http/Controllers/Bill/IndexController.php index 3896db77af..fcc0ebeb0d 100644 --- a/app/Http/Controllers/Bill/IndexController.php +++ b/app/Http/Controllers/Bill/IndexController.php @@ -147,8 +147,6 @@ class IndexController extends Controller return view('bills.index', compact('bills', 'sums', 'total', 'totals', 'today')); } - /** - */ private function getSums(array $bills): array { $sums = []; diff --git a/app/Http/Controllers/Bill/ShowController.php b/app/Http/Controllers/Bill/ShowController.php index ef004709f5..f102f5b5ac 100644 --- a/app/Http/Controllers/Bill/ShowController.php +++ b/app/Http/Controllers/Bill/ShowController.php @@ -115,10 +115,8 @@ class ShowController extends Controller /** * Show a bill. * - * @param Request $request - * @param Bill $bill - * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/Budget/ShowController.php b/app/Http/Controllers/Budget/ShowController.php index 77158fb699..4c31d2927a 100644 --- a/app/Http/Controllers/Budget/ShowController.php +++ b/app/Http/Controllers/Budget/ShowController.php @@ -75,10 +75,6 @@ class ShowController extends Controller /** * Show transactions without a budget. * - * @param Request $request - * @param Carbon|null $start - * @param Carbon|null $end - * * @return Factory|View * * @throws ContainerExceptionInterface @@ -118,9 +114,8 @@ class ShowController extends Controller /** * Shows ALL transactions without a budget. * - * @param Request $request - * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ @@ -147,10 +142,8 @@ class ShowController extends Controller /** * Show a single budget. * - * @param Request $request - * @param Budget $budget - * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ @@ -183,10 +176,6 @@ class ShowController extends Controller /** * Show a single budget by a budget limit. * - * @param Request $request - * @param Budget $budget - * @param BudgetLimit $budgetLimit - * * @return Factory|View * * @throws FireflyException diff --git a/app/Http/Controllers/Category/IndexController.php b/app/Http/Controllers/Category/IndexController.php index ecd406df91..f91870a346 100644 --- a/app/Http/Controllers/Category/IndexController.php +++ b/app/Http/Controllers/Category/IndexController.php @@ -64,9 +64,8 @@ class IndexController extends Controller /** * Show all categories. * - * @param Request $request - * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/Category/NoCategoryController.php b/app/Http/Controllers/Category/NoCategoryController.php index 065214b856..b2dade990d 100644 --- a/app/Http/Controllers/Category/NoCategoryController.php +++ b/app/Http/Controllers/Category/NoCategoryController.php @@ -71,10 +71,6 @@ class NoCategoryController extends Controller /** * Show transactions without a category. * - * @param Request $request - * @param Carbon|null $start - * @param Carbon|null $end - * * @return Factory|View * * @throws ContainerExceptionInterface @@ -114,9 +110,8 @@ class NoCategoryController extends Controller /** * Show all transactions without a category. * - * @param Request $request - * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/Category/ShowController.php b/app/Http/Controllers/Category/ShowController.php index c9ca74b93c..57fa33fc7a 100644 --- a/app/Http/Controllers/Category/ShowController.php +++ b/app/Http/Controllers/Category/ShowController.php @@ -70,11 +70,6 @@ class ShowController extends Controller /** * Show a single category. * - * @param Request $request - * @param Category $category - * @param Carbon|null $start - * @param Carbon|null $end - * * @return Factory|View * * @throws ContainerExceptionInterface @@ -120,10 +115,8 @@ class ShowController extends Controller /** * Show all transactions within a category. * - * @param Request $request - * @param Category $category - * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 9e0e34851c..3df8e35845 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -45,6 +45,7 @@ use Illuminate\Http\JsonResponse; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Safe\Exceptions\JsonException; + use function Safe\json_encode; /** @@ -482,11 +483,6 @@ class AccountController extends Controller /** * Shows overview of account during a single period. * - * @param Account $account - * @param Carbon $start - * @param Carbon $end - * - * @return JsonResponse * @throws FireflyException * @throws JsonException */ diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 1d3665b548..6e195311b3 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -66,7 +66,6 @@ class CategoryController extends Controller /** * Show an overview for a category for all time, per month/week/year. * TODO test method, for category refactor. - * */ public function all(Category $category): JsonResponse { @@ -256,10 +255,6 @@ class CategoryController extends Controller * Chart for a specific period. * TODO test me, for category refactor. * - * @param Category $category - * @param Carbon $date - * - * @return JsonResponse * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index 065cc16f49..c0db48f026 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -57,7 +57,6 @@ class PiggyBankController extends Controller * Shows the piggy bank history. * * TODO this chart is not multi currency aware. - * */ public function history(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank): JsonResponse { diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index daba3dbeae..534acf8488 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -38,6 +38,7 @@ use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\View; + use function Safe\ini_get; use function Safe\realpath; diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index f83dfb0f37..1ed00b4710 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -51,8 +51,10 @@ use Illuminate\View\View; use Monolog\Handler\RotatingFileHandler; use Safe\Exceptions\FilesystemException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; + use function Safe\file_get_contents; use function Safe\ini_get; + use const PHP_INT_SIZE; use const PHP_SAPI; diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php index 94696f0373..c5beecfeb4 100644 --- a/app/Http/Controllers/JavascriptController.php +++ b/app/Http/Controllers/JavascriptController.php @@ -92,10 +92,6 @@ class JavascriptController extends Controller /** * Show some common variables to be used in scripts. * - * @param Request $request - * @param AccountRepositoryInterface $repository - * - * @return Response * @throws FireflyException * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.php index 8d1aa947a8..7a55bca8c1 100644 --- a/app/Http/Controllers/Json/IntroController.php +++ b/app/Http/Controllers/Json/IntroController.php @@ -87,7 +87,6 @@ class IntroController extends Controller /** * Enable the boxes for a specific page again. - * */ public function postEnable(string $route, ?string $specialPage = null): JsonResponse { @@ -106,7 +105,6 @@ class IntroController extends Controller /** * Set that you saw them. - * */ public function postFinished(string $route, ?string $specialPage = null): JsonResponse { diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index e1c70c78f4..5bfbc6815e 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -85,7 +85,6 @@ class NewUserController extends Controller * Store his new settings. * * @return Redirector|RedirectResponse - * */ public function submit(NewUserFormRequest $request, CurrencyRepositoryInterface $currencyRepository) { diff --git a/app/Http/Controllers/PiggyBank/IndexController.php b/app/Http/Controllers/PiggyBank/IndexController.php index 199d90a3a8..60c089fee0 100644 --- a/app/Http/Controllers/PiggyBank/IndexController.php +++ b/app/Http/Controllers/PiggyBank/IndexController.php @@ -76,7 +76,6 @@ class IndexController extends Controller * TODO very complicated function. * * @return Factory|View - * */ public function index() { diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 723998cd3f..f1c2ac8658 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -43,6 +43,7 @@ use Illuminate\Support\Facades\Log; use Illuminate\View\View; use JsonException; use Safe\Exceptions\FilesystemException; + use function Safe\file_get_contents; use function Safe\json_decode; @@ -71,8 +72,6 @@ class PreferencesController extends Controller /** * Show overview of preferences. * - * @param AccountRepositoryInterface $repository - * * @return Factory|View * * @throws FireflyException diff --git a/app/Http/Controllers/Profile/MfaController.php b/app/Http/Controllers/Profile/MfaController.php index 7959f1cd54..123680e2c3 100644 --- a/app/Http/Controllers/Profile/MfaController.php +++ b/app/Http/Controllers/Profile/MfaController.php @@ -84,8 +84,6 @@ class MfaController extends Controller } - /** - */ public function backupCodes(Request $request): Factory|RedirectResponse|View { if (!$this->internalAuth) { @@ -230,8 +228,6 @@ class MfaController extends Controller /** * Submit 2FA for the first time. * - * @param TokenFormRequest $request - * * @return Redirector|RedirectResponse * * @throws ContainerExceptionInterface @@ -293,8 +289,6 @@ class MfaController extends Controller /** * TODO duplicate code. * - * @param string $mfaCode - * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 33f8b41866..26e1509103 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -138,7 +138,6 @@ class ProfileController extends Controller /** * Index for profile. * - * @return Factory|View * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/Recurring/IndexController.php b/app/Http/Controllers/Recurring/IndexController.php index 9923a42d0a..be4d9e527c 100644 --- a/app/Http/Controllers/Recurring/IndexController.php +++ b/app/Http/Controllers/Recurring/IndexController.php @@ -73,8 +73,6 @@ class IndexController extends Controller * TODO the notes of a recurrence are pretty pointless at this moment. * Show all recurring transactions. * - * @param Request $request - * * @return Factory|View * * @throws FireflyException diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 126d312f71..eb82e859d9 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -227,9 +227,8 @@ class ReportController extends Controller /** * Show index. * - * @param AccountRepositoryInterface $repository - * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index 48ff8a64b0..6e1e168d0a 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -37,6 +37,7 @@ use Illuminate\Support\Facades\Cache; use Illuminate\View\View; use Laravel\Passport\Passport; use phpseclib3\Crypt\RSA; + use function Safe\file_put_contents; /** diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index d062801d47..53372408ae 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -220,11 +220,6 @@ class TagController extends Controller /** * Show a single tag. * - * @param Request $request - * @param Tag $tag - * @param Carbon|null $start - * @param Carbon|null $end - * * @return Factory|View * * @throws ContainerExceptionInterface @@ -270,10 +265,8 @@ class TagController extends Controller /** * Show a single tag over all time. * - * @param Request $request - * @param Tag $tag - * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php index 71012d3565..054a94ec23 100644 --- a/app/Http/Controllers/Transaction/CreateController.php +++ b/app/Http/Controllers/Transaction/CreateController.php @@ -38,6 +38,7 @@ use Illuminate\Http\Request; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\UrlException; + use function Safe\parse_url; /** @@ -99,8 +100,6 @@ class CreateController extends Controller /** * Create a new transaction group. * - * @param string|null $objectType - * * @return Factory|View * * @throws ContainerExceptionInterface diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php index dcf9e36ca3..d349a9e18c 100644 --- a/app/Http/Controllers/Transaction/EditController.php +++ b/app/Http/Controllers/Transaction/EditController.php @@ -37,6 +37,7 @@ use Illuminate\View\View; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\UrlException; + use function Safe\parse_url; /** @@ -67,9 +68,8 @@ class EditController extends Controller } /** - * @param TransactionGroup $transactionGroup - * * @return Factory|Redirector|RedirectResponse|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws UrlException diff --git a/app/Http/Controllers/Transaction/IndexController.php b/app/Http/Controllers/Transaction/IndexController.php index e0d2c83359..efb29a1236 100644 --- a/app/Http/Controllers/Transaction/IndexController.php +++ b/app/Http/Controllers/Transaction/IndexController.php @@ -69,11 +69,6 @@ class IndexController extends Controller /** * Index for a range of transactions. * - * @param Request $request - * @param string $objectType - * @param Carbon|null $start - * @param Carbon|null $end - * * @return Factory|View * * @throws ContainerExceptionInterface @@ -132,10 +127,8 @@ class IndexController extends Controller /** * Index for ALL transactions. * - * @param Request $request - * @param string $objectType - * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Controllers/TransactionCurrency/DeleteController.php b/app/Http/Controllers/TransactionCurrency/DeleteController.php index ca25c9c2e5..7a2348cdff 100644 --- a/app/Http/Controllers/TransactionCurrency/DeleteController.php +++ b/app/Http/Controllers/TransactionCurrency/DeleteController.php @@ -67,10 +67,8 @@ class DeleteController extends Controller /** * Deletes a currency. * - * @param Request $request - * @param TransactionCurrency $currency - * * @return Factory|Redirector|RedirectResponse|View + * * @throws FireflyException */ public function delete(Request $request, TransactionCurrency $currency) @@ -104,10 +102,8 @@ class DeleteController extends Controller /** * Destroys a currency. * - * @param Request $request - * @param TransactionCurrency $currency - * * @return Redirector|RedirectResponse + * * @throws FireflyException */ public function destroy(Request $request, TransactionCurrency $currency) diff --git a/app/Http/Controllers/TransactionCurrency/EditController.php b/app/Http/Controllers/TransactionCurrency/EditController.php index 092b5c623f..d079b5ec8e 100644 --- a/app/Http/Controllers/TransactionCurrency/EditController.php +++ b/app/Http/Controllers/TransactionCurrency/EditController.php @@ -107,10 +107,8 @@ class EditController extends Controller /** * Updates a currency. * - * @param CurrencyFormRequest $request - * @param TransactionCurrency $currency - * * @return Redirector|RedirectResponse + * * @throws FireflyException */ public function update(CurrencyFormRequest $request, TransactionCurrency $currency) diff --git a/app/Http/Controllers/TransactionCurrency/IndexController.php b/app/Http/Controllers/TransactionCurrency/IndexController.php index 62566bbd3b..a24f1123d2 100644 --- a/app/Http/Controllers/TransactionCurrency/IndexController.php +++ b/app/Http/Controllers/TransactionCurrency/IndexController.php @@ -63,9 +63,8 @@ class IndexController extends Controller /** * Show overview of currencies. * - * @param Request $request - * * @return Factory|View + * * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ diff --git a/app/Http/Middleware/AcceptHeaders.php b/app/Http/Middleware/AcceptHeaders.php index c8b8749ad8..9cd43dc583 100644 --- a/app/Http/Middleware/AcceptHeaders.php +++ b/app/Http/Middleware/AcceptHeaders.php @@ -29,6 +29,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; use Safe\Exceptions\PcreException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; + use function Safe\preg_match; class AcceptHeaders @@ -36,9 +37,6 @@ class AcceptHeaders /** * Handle the incoming requests. * - * @param Request $request - * @param callable $next - * * @return Response * * @throws BadHttpHeaderException diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index fd11a32096..eda973b3fb 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -36,6 +36,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Illuminate\Validation\Validator; use Safe\Exceptions\PcreException; + use function Safe\preg_match; /** @@ -133,7 +134,6 @@ class ReportFormRequest extends FormRequest /** * Validate end date. * - * @return Carbon * @throws FireflyException * @throws PcreException */ @@ -173,7 +173,6 @@ class ReportFormRequest extends FormRequest /** * Validate start date. * - * @return Carbon * @throws FireflyException * @throws PcreException */ diff --git a/app/Jobs/DownloadExchangeRates.php b/app/Jobs/DownloadExchangeRates.php index 9b29bcaac5..e5be322d09 100644 --- a/app/Jobs/DownloadExchangeRates.php +++ b/app/Jobs/DownloadExchangeRates.php @@ -41,6 +41,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Safe\Exceptions\JsonException; + use function Safe\json_decode; /** @@ -94,8 +95,6 @@ class DownloadExchangeRates implements ShouldQueue } /** - * @param TransactionCurrency $currency - * * @throws GuzzleException * @throws JsonException */ diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 70c7f407b4..ecc8c24b5d 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -32,6 +32,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; use Symfony\Component\Mailer\Exception\TransportException; + use function Safe\file_get_contents; use function Safe\file_put_contents; use function Safe\json_decode; diff --git a/app/Mail/InvitationMail.php b/app/Mail/InvitationMail.php index 0c886bc21e..14ad8821b5 100644 --- a/app/Mail/InvitationMail.php +++ b/app/Mail/InvitationMail.php @@ -27,6 +27,7 @@ namespace FireflyIII\Mail; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; + use function Safe\parse_url; /** diff --git a/app/Mail/ReportNewJournalsMail.php b/app/Mail/ReportNewJournalsMail.php index 0fd9ac7127..c8b51a782d 100644 --- a/app/Mail/ReportNewJournalsMail.php +++ b/app/Mail/ReportNewJournalsMail.php @@ -52,6 +52,7 @@ class ReportNewJournalsMail extends Mailable * Build the message. * * @return $this + * * @throws FireflyException */ public function build(): self diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index ff42cb44f7..a91e5eb778 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -27,6 +27,7 @@ use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; + use function Safe\json_decode; use function Safe\json_encode; diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index f29c7102d1..6ac0d049f3 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -58,9 +58,10 @@ class BudgetLimit extends Model if (auth()->check()) { $budgetLimitId = (int)$value; $budgetLimit = self::where('budget_limits.id', $budgetLimitId) - ->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id') - ->where('budgets.user_id', auth()->user()->id) - ->first(['budget_limits.*']); + ->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id') + ->where('budgets.user_id', auth()->user()->id) + ->first(['budget_limits.*']) + ; if (null !== $budgetLimit) { return $budgetLimit; } @@ -93,14 +94,14 @@ class BudgetLimit extends Model protected function amount(): Attribute { return Attribute::make( - get: static fn($value) => (string)$value, + get: static fn ($value) => (string)$value, ); } protected function budgetId(): Attribute { return Attribute::make( - get: static fn($value) => (int)$value, + get: static fn ($value) => (int)$value, ); } @@ -120,7 +121,7 @@ class BudgetLimit extends Model protected function transactionCurrencyId(): Attribute { return Attribute::make( - get: static fn($value) => (int)$value, + get: static fn ($value) => (int)$value, ); } } diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index e1fe1be20f..3fd2d82a19 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -27,6 +27,7 @@ use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; + use function Safe\json_decode; use function Safe\json_encode; diff --git a/app/Models/Recurrence.php b/app/Models/Recurrence.php index 306be4dde4..1893fa023e 100644 --- a/app/Models/Recurrence.php +++ b/app/Models/Recurrence.php @@ -40,8 +40,8 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * @property Carbon $first_date - * @property Carbon|null $latest_date + * @property Carbon $first_date + * @property null|Carbon $latest_date */ #[ObservedBy([RecurrenceObserver::class])] class Recurrence extends Model diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php index 544cdd3830..ee6911ee37 100644 --- a/app/Models/TransactionGroup.php +++ b/app/Models/TransactionGroup.php @@ -36,10 +36,9 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; - /** - * @property User $user - * @property UserGroup $userGroup + * @property User $user + * @property UserGroup $userGroup * @property Collection $transactionJournals */ #[ObservedBy([TransactionGroupObserver::class])] diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 72e1cd35cc..f6bd140648 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -47,6 +47,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @method EloquentBuilder|static before() * @method EloquentBuilder|static after() * @method static EloquentBuilder|static query() + * * @property TransactionGroup $transactionGroup */ #[ObservedBy([TransactionJournalObserver::class])] diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index 8c2c02ad72..4a748bfb8b 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -28,6 +28,7 @@ use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; + use function Safe\json_decode; use function Safe\json_encode; diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index e28f83d871..263342b753 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -30,6 +30,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; use Laravel\Passport\Passport; use Override; + use function Safe\preg_match; /** diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 4b0278de7d..8eacb438b4 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -48,6 +48,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use Override; + use function Safe\json_encode; /** diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php index a9ca59cb65..63260b6643 100644 --- a/app/Repositories/Account/AccountTasker.php +++ b/app/Repositories/Account/AccountTasker.php @@ -143,8 +143,6 @@ class AccountTasker implements AccountTaskerInterface, UserGroupInterface return $report; } - /** - */ private function groupExpenseByDestination(array $array): array { $primaryCurrency = app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup); @@ -230,8 +228,6 @@ class AccountTasker implements AccountTaskerInterface, UserGroupInterface return $report; } - /** - */ private function groupIncomeBySource(array $array): array { $primaryCurrency = app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup); diff --git a/app/Repositories/Budget/AvailableBudgetRepository.php b/app/Repositories/Budget/AvailableBudgetRepository.php index cc2916cb92..e992bff82d 100644 --- a/app/Repositories/Budget/AvailableBudgetRepository.php +++ b/app/Repositories/Budget/AvailableBudgetRepository.php @@ -113,7 +113,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface, U ; } - #[\Deprecated] + #[Deprecated] public function getAvailableBudget(TransactionCurrency $currency, Carbon $start, Carbon $end): string { $amount = '0'; diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 23cc13e273..0b2d41395d 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -386,8 +386,6 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface return $budget->autoBudgets()->first(); } - /** - */ private function updateAutoBudget(Budget $budget, array $data): void { // update or create auto-budget: @@ -524,6 +522,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface public function firstUseDate(Budget $budget): ?Carbon { $journal = $budget->transactionJournals()->orderBy('date', 'ASC')->first(); + return $journal?->date; } @@ -564,6 +563,7 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface public function getNoteText(Budget $budget): ?string { $note = $budget->notes()->first(); + return $note?->text; } diff --git a/app/Repositories/Budget/NoBudgetRepository.php b/app/Repositories/Budget/NoBudgetRepository.php index 8ae96cb192..3b5709b18b 100644 --- a/app/Repositories/Budget/NoBudgetRepository.php +++ b/app/Repositories/Budget/NoBudgetRepository.php @@ -33,6 +33,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface; use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use Illuminate\Support\Collection; use Override; +use Deprecated; /** * Class NoBudgetRepository @@ -41,7 +42,7 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface, UserGroupInterf { use UserGroupTrait; - #[\Deprecated] + #[Deprecated] public function getNoBudgetPeriodReport(Collection $accounts, Carbon $start, Carbon $end): array { $carbonFormat = app('navigation')->preferredCarbonFormat($start, $end); diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 7e46ff30d9..6b1f75a91c 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -261,6 +261,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf public function getNoteText(Category $category): ?string { $dbNote = $category->notes()->first(); + return $dbNote?->text; } diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index a3f673f108..eacd820c34 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -45,6 +45,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; use Override; use Safe\Exceptions\JsonException; + use function Safe\json_encode; /** @@ -65,9 +66,6 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf } /** - * @param TransactionCurrency $currency - * - * @return string|null * @throws JsonException */ public function currencyInUseAt(TransactionCurrency $currency): ?string @@ -236,7 +234,6 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf /** * Find by object, ID or code. Returns user default or system default. - * */ public function findCurrency(?int $currencyId, ?string $currencyCode): TransactionCurrency { diff --git a/app/Repositories/Journal/JournalCLIRepository.php b/app/Repositories/Journal/JournalCLIRepository.php index dd47a39323..eaaaf600b4 100644 --- a/app/Repositories/Journal/JournalCLIRepository.php +++ b/app/Repositories/Journal/JournalCLIRepository.php @@ -166,6 +166,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface, UserGroupIn public function getNoteText(TransactionJournal $journal): ?string { $note = $journal->notes()->first(); + return $note?->text; } diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.php index c519ab397f..4e8a67ec0d 100644 --- a/app/Repositories/Recurring/RecurringRepository.php +++ b/app/Repositories/Recurring/RecurringRepository.php @@ -50,6 +50,7 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; + use function Safe\json_decode; use function Safe\json_encode; @@ -429,7 +430,6 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte /** * Parse the repetition in a string that is user readable. - * */ public function repetitionDescription(RecurrenceRepetition $repetition): string { diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php index 8e8eac95e3..fbf45efb73 100644 --- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php +++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php @@ -49,6 +49,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; + use function Safe\json_decode; /** @@ -176,6 +177,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface, ->where('noteable_type', TransactionJournal::class) ->first() ; + return $note?->text; } diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index d2e5c3fa81..da82fe44ad 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -161,6 +161,7 @@ class UserRepository implements UserRepositoryInterface { /** @var null|Role $role */ $role = $user->roles()->first(); + return $role?->name; } @@ -376,7 +377,6 @@ class UserRepository implements UserRepositoryInterface * This updates the users email address. Same as changeEmail just without most logging. This makes sure that the * undo/confirm routine can't catch this one. The user is NOT blocked. * - * * @see changeEmail */ public function updateEmail(User $user, string $newEmail): bool diff --git a/app/Repositories/UserGroup/UserGroupRepository.php b/app/Repositories/UserGroup/UserGroupRepository.php index 691807110c..80b3fc459c 100644 --- a/app/Repositories/UserGroup/UserGroupRepository.php +++ b/app/Repositories/UserGroup/UserGroupRepository.php @@ -96,7 +96,6 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte /** * Returns all groups the user is member in. - * */ public function get(): Collection { @@ -165,7 +164,6 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte /** * Returns all groups. - * */ public function getAll(): Collection { diff --git a/app/Rules/IsValidBulkClause.php b/app/Rules/IsValidBulkClause.php index f3c74630b1..df93b82a50 100644 --- a/app/Rules/IsValidBulkClause.php +++ b/app/Rules/IsValidBulkClause.php @@ -28,6 +28,7 @@ use Closure; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Validator; use JsonException; + use function Safe\json_decode; /** diff --git a/app/Rules/IsValidPositiveAmount.php b/app/Rules/IsValidPositiveAmount.php index f637cdbc6d..157307a3f8 100644 --- a/app/Rules/IsValidPositiveAmount.php +++ b/app/Rules/IsValidPositiveAmount.php @@ -29,6 +29,7 @@ use Closure; use FireflyIII\Support\Validation\ValidatesAmountsTrait; use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Support\Facades\Log; + use function Safe\json_encode; class IsValidPositiveAmount implements ValidationRule diff --git a/app/Rules/UniqueAccountNumber.php b/app/Rules/UniqueAccountNumber.php index d605010d9d..467c5e6c83 100644 --- a/app/Rules/UniqueAccountNumber.php +++ b/app/Rules/UniqueAccountNumber.php @@ -29,6 +29,7 @@ use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Models\Account; use FireflyIII\Models\AccountMeta; use Illuminate\Contracts\Validation\ValidationRule; + use function Safe\json_encode; /** diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php index 99ead72517..ad55aee903 100644 --- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php +++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php @@ -31,6 +31,7 @@ use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; use Illuminate\Support\Facades\Log; use JsonException; + use function Safe\json_decode; /** diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php index cf2f0e4dc6..15cb35f760 100644 --- a/app/Services/Internal/Support/AccountServiceTrait.php +++ b/app/Services/Internal/Support/AccountServiceTrait.php @@ -339,8 +339,6 @@ trait AccountServiceTrait return $this->accountRepository->getOpeningBalanceGroup($account); } - /** - */ protected function getCurrency(int $currencyId, string $currencyCode): TransactionCurrency { // find currency, or use default currency instead. diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index 757ce01c0d..a4ce044ebf 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -39,6 +39,7 @@ use FireflyIII\Rules\UniqueIban; use FireflyIII\Support\NullArrayObject; use Illuminate\Support\Facades\Log; use Safe\Exceptions\JsonException; + use function Safe\json_encode; /** @@ -265,11 +266,6 @@ trait JournalServiceTrait } /** - * @param Account|null $account - * @param array $data - * @param string $preferredType - * - * @return Account|null * @throws FireflyException * @throws JsonException */ diff --git a/app/Services/Internal/Support/RecurringTransactionTrait.php b/app/Services/Internal/Support/RecurringTransactionTrait.php index b6f5955cb2..ebb7aad99f 100644 --- a/app/Services/Internal/Support/RecurringTransactionTrait.php +++ b/app/Services/Internal/Support/RecurringTransactionTrait.php @@ -42,6 +42,7 @@ use FireflyIII\Models\RecurrenceTransactionMeta; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Validation\AccountValidator; use Illuminate\Support\Facades\Log; + use function Safe\json_encode; /** diff --git a/app/Services/Internal/Update/AccountUpdateService.php b/app/Services/Internal/Update/AccountUpdateService.php index 341e72b33a..9f38297e42 100644 --- a/app/Services/Internal/Update/AccountUpdateService.php +++ b/app/Services/Internal/Update/AccountUpdateService.php @@ -284,8 +284,6 @@ class AccountUpdateService } } - /** - */ private function updatePreferences(Account $account): void { $account->refresh(); diff --git a/app/Services/Internal/Update/BillUpdateService.php b/app/Services/Internal/Update/BillUpdateService.php index 4fdd94aae0..20825af2f2 100644 --- a/app/Services/Internal/Update/BillUpdateService.php +++ b/app/Services/Internal/Update/BillUpdateService.php @@ -45,8 +45,6 @@ class BillUpdateService protected User $user; - /** - */ public function update(Bill $bill, array $data): Bill { $this->user = $bill->user; diff --git a/app/Services/Webhook/StandardWebhookSender.php b/app/Services/Webhook/StandardWebhookSender.php index e0f6cd5dfb..ab9a82108a 100644 --- a/app/Services/Webhook/StandardWebhookSender.php +++ b/app/Services/Webhook/StandardWebhookSender.php @@ -34,6 +34,7 @@ use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Exception\RequestException; use Illuminate\Support\Facades\Log; use JsonException; + use function Safe\json_encode; /** diff --git a/app/Support/Binder/CLIToken.php b/app/Support/Binder/CLIToken.php index 6dc825c585..09c54de3f0 100644 --- a/app/Support/Binder/CLIToken.php +++ b/app/Support/Binder/CLIToken.php @@ -35,7 +35,6 @@ class CLIToken implements BinderInterface { /** * @return mixed - * */ public static function routeBinder(string $value, Route $route) { diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index 258bea8495..e22808ea06 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -27,6 +27,7 @@ use Carbon\Carbon; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Cache; use JsonException; + use function Safe\json_encode; /** diff --git a/app/Support/Export/ExportDataGenerator.php b/app/Support/Export/ExportDataGenerator.php index d1b19bf7e4..c9f25e12a5 100644 --- a/app/Support/Export/ExportDataGenerator.php +++ b/app/Support/Export/ExportDataGenerator.php @@ -107,7 +107,6 @@ class ExportDataGenerator } /** - * @return array * @throws CannotInsertRecord * @throws ContainerExceptionInterface * @throws Exception @@ -754,7 +753,6 @@ class ExportDataGenerator } /** - * @return string * @throws CannotInsertRecord * @throws Exception * @throws FireflyException diff --git a/app/Support/Http/Controllers/CreateStuff.php b/app/Support/Http/Controllers/CreateStuff.php index 32e0c2c1a4..a69c44ac54 100644 --- a/app/Support/Http/Controllers/CreateStuff.php +++ b/app/Support/Http/Controllers/CreateStuff.php @@ -32,6 +32,7 @@ use FireflyIII\User; use Illuminate\Support\Facades\Log; use Laravel\Passport\Passport; use phpseclib3\Crypt\RSA; + use function Safe\file_put_contents; /** diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.php index 4f9702bb29..39a6df3aff 100644 --- a/app/Support/Http/Controllers/RequestInformation.php +++ b/app/Support/Http/Controllers/RequestInformation.php @@ -35,6 +35,7 @@ use Illuminate\Routing\Route; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Route as RouteFacade; use Illuminate\Support\Facades\Validator; + use function Safe\parse_url; /** diff --git a/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php b/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php index 0df7aea164..e1a6be6a94 100644 --- a/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php +++ b/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php @@ -42,13 +42,13 @@ class BudgetLimitEnrichment implements EnrichmentInterface { private Collection $collection; private bool $convertToPrimary; // @phpstan-ignore-line - private array $currencies = []; - private array $currencyIds = []; + private array $currencies = []; + private array $currencyIds = []; private Carbon $end; - private array $expenses = []; - private array $ids = []; - private array $notes = []; - private array $pcExpenses = []; + private array $expenses = []; + private array $ids = []; + private array $notes = []; + private array $pcExpenses = []; private readonly TransactionCurrency $primaryCurrency; private Carbon $start; private User $user; diff --git a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php index e51c110078..23f7b2d2d3 100644 --- a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php +++ b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php @@ -159,7 +159,7 @@ class PiggyBankEnrichment implements EnrichmentInterface // get suggested per month. $meta['save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['target_amount'], $meta['current_amount']), $currency->decimal_places); - if(null !== $meta['pc_current_amount']) { + if (null !== $meta['pc_current_amount']) { $meta['pc_save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['pc_target_amount'], $meta['pc_current_amount']), $currency->decimal_places); } diff --git a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php index 25bb788c73..fb5115136a 100644 --- a/app/Support/JsonApi/Enrichments/RecurringEnrichment.php +++ b/app/Support/JsonApi/Enrichments/RecurringEnrichment.php @@ -51,6 +51,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Arr; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; + use function Safe\json_decode; class RecurringEnrichment implements EnrichmentInterface @@ -60,7 +61,7 @@ class RecurringEnrichment implements EnrichmentInterface // private array $transactionTypeIds = []; // private array $transactionTypes = []; private bool $convertToPrimary; - private array $currencies = []; + private array $currencies = []; private array $currencyIds = []; private array $destinationAccountIds = []; private array $foreignCurrencyIds = []; diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 534eff6fe6..dd5981e327 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -413,20 +413,20 @@ class Navigation { $date = clone $theDate; $formatMap = [ - '1D' => (string)trans('config.specific_day_js'), - 'daily' => (string)trans('config.specific_day_js'), - 'custom' => (string)trans('config.specific_day_js'), - '1W' => (string)trans('config.week_in_year_js'), - 'week' => (string)trans('config.week_in_year_js'), - 'weekly' => (string)trans('config.week_in_year_js'), - '1M' => (string)trans('config.month_js'), - 'month' => (string)trans('config.month_js'), - 'monthly' => (string)trans('config.month_js'), - '1Y' => (string)trans('config.year_js'), + '1D' => (string)trans('config.specific_day_js'), + 'daily' => (string)trans('config.specific_day_js'), + 'custom' => (string)trans('config.specific_day_js'), + '1W' => (string)trans('config.week_in_year_js'), + 'week' => (string)trans('config.week_in_year_js'), + 'weekly' => (string)trans('config.week_in_year_js'), + '1M' => (string)trans('config.month_js'), + 'month' => (string)trans('config.month_js'), + 'monthly' => (string)trans('config.month_js'), + '1Y' => (string)trans('config.year_js'), 'YTD' => (string)trans('config.year_js'), - 'year' => (string)trans('config.year_js'), - 'yearly' => (string)trans('config.year_js'), - '6M' => (string)trans('config.half_year_js'), + 'year' => (string)trans('config.year_js'), + 'yearly' => (string)trans('config.year_js'), + '6M' => (string)trans('config.half_year_js'), ]; if (array_key_exists($repeatFrequency, $formatMap)) { diff --git a/app/Support/ParseDateString.php b/app/Support/ParseDateString.php index 883e76be41..46df80c290 100644 --- a/app/Support/ParseDateString.php +++ b/app/Support/ParseDateString.php @@ -30,6 +30,7 @@ use Carbon\Exceptions\InvalidFormatException; use FireflyIII\Exceptions\FireflyException; use Illuminate\Support\Facades\Log; use Safe\Exceptions\PcreException; + use function Safe\preg_match; /** @@ -72,11 +73,9 @@ class ParseDateString } /** - * @param string $date - * - * @return Carbon * @throws FireflyException * @throws PcreException + * * @SuppressWarnings("PHPMD.NPathComplexity") */ public function parseDate(string $date): Carbon diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index 5f00a32036..943d48b117 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -230,8 +230,6 @@ class Preferences return $this->getForUser($user, $name, $default); } - /** - */ public function lastActivity(): string { $instance = PreferencesSingleton::getInstance(); diff --git a/app/Support/Report/Budget/BudgetReportGenerator.php b/app/Support/Report/Budget/BudgetReportGenerator.php index ecdc897160..42f58a2728 100644 --- a/app/Support/Report/Budget/BudgetReportGenerator.php +++ b/app/Support/Report/Budget/BudgetReportGenerator.php @@ -131,8 +131,6 @@ class BudgetReportGenerator $this->start = $start; } - /** - */ public function setUser(User $user): void { $this->repository->setUser($user); diff --git a/app/Support/Request/ConvertsDataTypes.php b/app/Support/Request/ConvertsDataTypes.php index c978f2785c..5293a6f804 100644 --- a/app/Support/Request/ConvertsDataTypes.php +++ b/app/Support/Request/ConvertsDataTypes.php @@ -31,6 +31,7 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\Facades\Steam; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Log; + use function Safe\preg_replace; /** diff --git a/app/Support/Search/AccountSearch.php b/app/Support/Search/AccountSearch.php index 9e54a772d4..44bb34e893 100644 --- a/app/Support/Search/AccountSearch.php +++ b/app/Support/Search/AccountSearch.php @@ -28,6 +28,7 @@ use FireflyIII\User; use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Collection; + use function Safe\json_encode; /** diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index c9368d74af..5546fbc8c9 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -369,8 +369,6 @@ class OperatorQuerySearch implements SearchInterface } } - /** - */ private function parseDateRange(string $type, string $value): array { $parser = new ParseDateString(); diff --git a/app/Support/Search/QueryParser/GdbotsQueryParser.php b/app/Support/Search/QueryParser/GdbotsQueryParser.php index cc51218eaa..209b09721a 100644 --- a/app/Support/Search/QueryParser/GdbotsQueryParser.php +++ b/app/Support/Search/QueryParser/GdbotsQueryParser.php @@ -33,6 +33,7 @@ use Illuminate\Support\Facades\Log; use LogicException; use Safe\Exceptions\FilesystemException; use TypeError; + use function Safe\fwrite; class GdbotsQueryParser implements QueryParserInterface @@ -45,9 +46,6 @@ class GdbotsQueryParser implements QueryParserInterface } /** - * @param string $query - * - * @return NodeGroup * @throws FireflyException * @throws FilesystemException */ diff --git a/app/Support/Steam.php b/app/Support/Steam.php index f88839823d..10a8061153 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -40,6 +40,7 @@ use Illuminate\Support\Str; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use ValueError; + use function Safe\parse_url; use function Safe\preg_replace; @@ -534,8 +535,6 @@ class Steam return Amount::getTransactionCurrencyById((int)$result->data); } - /** - */ public function getHostName(string $ipAddress): string { $host = ''; @@ -557,7 +556,6 @@ class Steam /** * Get user's language. * - * @return string * @throws FireflyException * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface diff --git a/app/Support/System/OAuthKeys.php b/app/Support/System/OAuthKeys.php index e39ed5c5de..afb028180a 100644 --- a/app/Support/System/OAuthKeys.php +++ b/app/Support/System/OAuthKeys.php @@ -32,6 +32,7 @@ use Laravel\Passport\Console\KeysCommand; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\FilesystemException; + use function Safe\file_get_contents; use function Safe\file_put_contents; @@ -79,7 +80,6 @@ class OAuthKeys } /** - * @return bool * @throws ContainerExceptionInterface * @throws FireflyException * @throws NotFoundExceptionInterface diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index a3b0a3e128..485dfe1bd9 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -37,6 +37,7 @@ use Override; use Twig\Extension\AbstractExtension; use Twig\TwigFilter; use Twig\TwigFunction; + use function Safe\parse_url; /** diff --git a/app/Support/Twig/TransactionGroupTwig.php b/app/Support/Twig/TransactionGroupTwig.php index 30b539f08a..3033a84872 100644 --- a/app/Support/Twig/TransactionGroupTwig.php +++ b/app/Support/Twig/TransactionGroupTwig.php @@ -34,6 +34,7 @@ use Illuminate\Support\Facades\DB; use Override; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; + use function Safe\json_decode; /** diff --git a/app/Transformers/PiggyBankTransformer.php b/app/Transformers/PiggyBankTransformer.php index a418b93d37..9088044890 100644 --- a/app/Transformers/PiggyBankTransformer.php +++ b/app/Transformers/PiggyBankTransformer.php @@ -45,7 +45,6 @@ class PiggyBankTransformer extends AbstractTransformer /** * Transform the piggy bank. - * */ public function transform(PiggyBank $piggyBank): array { diff --git a/app/Transformers/RecurrenceTransformer.php b/app/Transformers/RecurrenceTransformer.php index 823c4cecda..d2e1bb914c 100644 --- a/app/Transformers/RecurrenceTransformer.php +++ b/app/Transformers/RecurrenceTransformer.php @@ -39,7 +39,6 @@ class RecurrenceTransformer extends AbstractTransformer /** * Transform the recurring transaction. - * */ public function transform(Recurrence $recurrence): array { diff --git a/app/Transformers/UserTransformer.php b/app/Transformers/UserTransformer.php index 0dff6bd273..d4a06aefb0 100644 --- a/app/Transformers/UserTransformer.php +++ b/app/Transformers/UserTransformer.php @@ -36,7 +36,6 @@ class UserTransformer extends AbstractTransformer /** * Transform user. - * */ public function transform(User $user): array { diff --git a/app/Transformers/WebhookMessageTransformer.php b/app/Transformers/WebhookMessageTransformer.php index 8057d53a54..24bc25d4c2 100644 --- a/app/Transformers/WebhookMessageTransformer.php +++ b/app/Transformers/WebhookMessageTransformer.php @@ -27,6 +27,7 @@ namespace FireflyIII\Transformers; use FireflyIII\Models\WebhookMessage; use Illuminate\Support\Facades\Log; use JsonException; + use function Safe\json_encode; /** diff --git a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php index 2ec2ee2fc9..8f8cffba91 100644 --- a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php +++ b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php @@ -26,6 +26,7 @@ namespace FireflyIII\Validation\Api\Data\Bulk; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Illuminate\Validation\Validator; + use function Safe\json_decode; trait ValidatesBulkTransactionQuery diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index e13c866efc..e420a44f50 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -50,6 +50,7 @@ use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use Safe\Exceptions\JsonException; use ValueError; + use function Safe\iconv; use function Safe\json_encode; use function Safe\preg_match; @@ -64,12 +65,12 @@ class FireflyValidator extends Validator * @param mixed $attribute * @param mixed $value * - * @return bool * @throws IncompatibleWithGoogleAuthenticatorException * @throws InvalidCharactersException * @throws SecretKeyTooShortException * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function validate2faCode($attribute, $value): bool @@ -632,8 +633,8 @@ class FireflyValidator extends Validator * @param mixed $value * @param mixed $parameters * - * @return bool * @throws JsonException + * * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ public function validateUniqueAccountNumberForUser($attribute, $value, $parameters): bool diff --git a/config/firefly.php b/config/firefly.php index 906dab11e0..34bb614840 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,8 +78,8 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-10-03', - 'build_time' => 1759466687, + 'version' => 'develop/2025-10-05', + 'build_time' => 1759662132, 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 28, // field is no longer used. diff --git a/package-lock.json b/package-lock.json index c97c70daf4..a38fd55cd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2589,9 +2589,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.3.tgz", - "integrity": "sha512-h6cqHGZ6VdnwliFG1NXvMPTy/9PS3h8oLh7ImwR+kl+oYnQizgjxsONmmPSb2C66RksfkfIxEVtDSEcJiO0tqw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.4.tgz", + "integrity": "sha512-BTm2qKNnWIQ5auf4deoetINJm2JzvihvGb9R6K/ETwKLql/Bb3Eg2H1FBp1gUb4YGbydMA3jcmQTR73q7J+GAA==", "cpu": [ "arm" ], @@ -2603,9 +2603,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.52.3.tgz", - "integrity": "sha512-wd+u7SLT/u6knklV/ifG7gr5Qy4GUbH2hMWcDauPFJzmCZUAJ8L2bTkVXC2niOIxp8lk3iH/QX8kSrUxVZrOVw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.52.4.tgz", + "integrity": "sha512-P9LDQiC5vpgGFgz7GSM6dKPCiqR3XYN1WwJKA4/BUVDjHpYsf3iBEmVz62uyq20NGYbiGPR5cNHI7T1HqxNs2w==", "cpu": [ "arm64" ], @@ -2617,9 +2617,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.52.3.tgz", - "integrity": "sha512-lj9ViATR1SsqycwFkJCtYfQTheBdvlWJqzqxwc9f2qrcVrQaF/gCuBRTiTolkRWS6KvNxSk4KHZWG7tDktLgjg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.52.4.tgz", + "integrity": "sha512-QRWSW+bVccAvZF6cbNZBJwAehmvG9NwfWHwMy4GbWi/BQIA/laTIktebT2ipVjNncqE6GLPxOok5hsECgAxGZg==", "cpu": [ "arm64" ], @@ -2631,9 +2631,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.52.3.tgz", - "integrity": "sha512-+Dyo7O1KUmIsbzx1l+4V4tvEVnVQqMOIYtrxK7ncLSknl1xnMHLgn7gddJVrYPNZfEB8CIi3hK8gq8bDhb3h5A==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.52.4.tgz", + "integrity": "sha512-hZgP05pResAkRJxL1b+7yxCnXPGsXU0fG9Yfd6dUaoGk+FhdPKCJ5L1Sumyxn8kvw8Qi5PvQ8ulenUbRjzeCTw==", "cpu": [ "x64" ], @@ -2645,9 +2645,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.52.3.tgz", - "integrity": "sha512-u9Xg2FavYbD30g3DSfNhxgNrxhi6xVG4Y6i9Ur1C7xUuGDW3banRbXj+qgnIrwRN4KeJ396jchwy9bCIzbyBEQ==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.52.4.tgz", + "integrity": "sha512-xmc30VshuBNUd58Xk4TKAEcRZHaXlV+tCxIXELiE9sQuK3kG8ZFgSPi57UBJt8/ogfhAF5Oz4ZSUBN77weM+mQ==", "cpu": [ "arm64" ], @@ -2659,9 +2659,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.52.3.tgz", - "integrity": "sha512-5M8kyi/OX96wtD5qJR89a/3x5x8x5inXBZO04JWhkQb2JWavOWfjgkdvUqibGJeNNaz1/Z1PPza5/tAPXICI6A==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.52.4.tgz", + "integrity": "sha512-WdSLpZFjOEqNZGmHflxyifolwAiZmDQzuOzIq9L27ButpCVpD7KzTRtEG1I0wMPFyiyUdOO+4t8GvrnBLQSwpw==", "cpu": [ "x64" ], @@ -2673,9 +2673,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.52.3.tgz", - "integrity": "sha512-IoerZJ4l1wRMopEHRKOO16e04iXRDyZFZnNZKrWeNquh5d6bucjezgd+OxG03mOMTnS1x7hilzb3uURPkJ0OfA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.52.4.tgz", + "integrity": "sha512-xRiOu9Of1FZ4SxVbB0iEDXc4ddIcjCv2aj03dmW8UrZIW7aIQ9jVJdLBIhxBI+MaTnGAKyvMwPwQnoOEvP7FgQ==", "cpu": [ "arm" ], @@ -2687,9 +2687,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.52.3.tgz", - "integrity": "sha512-ZYdtqgHTDfvrJHSh3W22TvjWxwOgc3ThK/XjgcNGP2DIwFIPeAPNsQxrJO5XqleSlgDux2VAoWQ5iJrtaC1TbA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.52.4.tgz", + "integrity": "sha512-FbhM2p9TJAmEIEhIgzR4soUcsW49e9veAQCziwbR+XWB2zqJ12b4i/+hel9yLiD8pLncDH4fKIPIbt5238341Q==", "cpu": [ "arm" ], @@ -2701,9 +2701,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.52.3.tgz", - "integrity": "sha512-NcViG7A0YtuFDA6xWSgmFb6iPFzHlf5vcqb2p0lGEbT+gjrEEz8nC/EeDHvx6mnGXnGCC1SeVV+8u+smj0CeGQ==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.52.4.tgz", + "integrity": "sha512-4n4gVwhPHR9q/g8lKCyz0yuaD0MvDf7dV4f9tHt0C73Mp8h38UCtSCSE6R9iBlTbXlmA8CjpsZoujhszefqueg==", "cpu": [ "arm64" ], @@ -2715,9 +2715,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.52.3.tgz", - "integrity": "sha512-d3pY7LWno6SYNXRm6Ebsq0DJGoiLXTb83AIPCXl9fmtIQs/rXoS8SJxxUNtFbJ5MiOvs+7y34np77+9l4nfFMw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.52.4.tgz", + "integrity": "sha512-u0n17nGA0nvi/11gcZKsjkLj1QIpAuPFQbR48Subo7SmZJnGxDpspyw2kbpuoQnyK+9pwf3pAoEXerJs/8Mi9g==", "cpu": [ "arm64" ], @@ -2729,9 +2729,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.52.3.tgz", - "integrity": "sha512-3y5GA0JkBuirLqmjwAKwB0keDlI6JfGYduMlJD/Rl7fvb4Ni8iKdQs1eiunMZJhwDWdCvrcqXRY++VEBbvk6Eg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.52.4.tgz", + "integrity": "sha512-0G2c2lpYtbTuXo8KEJkDkClE/+/2AFPdPAbmaHoE870foRFs4pBrDehilMcrSScrN/fB/1HTaWO4bqw+ewBzMQ==", "cpu": [ "loong64" ], @@ -2743,9 +2743,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.52.3.tgz", - "integrity": "sha512-AUUH65a0p3Q0Yfm5oD2KVgzTKgwPyp9DSXc3UA7DtxhEb/WSPfbG4wqXeSN62OG5gSo18em4xv6dbfcUGXcagw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.52.4.tgz", + "integrity": "sha512-teSACug1GyZHmPDv14VNbvZFX779UqWTsd7KtTM9JIZRDI5NUwYSIS30kzI8m06gOPB//jtpqlhmraQ68b5X2g==", "cpu": [ "ppc64" ], @@ -2757,9 +2757,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.52.3.tgz", - "integrity": "sha512-1makPhFFVBqZE+XFg3Dkq+IkQ7JvmUrwwqaYBL2CE+ZpxPaqkGaiWFEWVGyvTwZace6WLJHwjVh/+CXbKDGPmg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.52.4.tgz", + "integrity": "sha512-/MOEW3aHjjs1p4Pw1Xk4+3egRevx8Ji9N6HUIA1Ifh8Q+cg9dremvFCUbOX2Zebz80BwJIgCBUemjqhU5XI5Eg==", "cpu": [ "riscv64" ], @@ -2771,9 +2771,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.52.3.tgz", - "integrity": "sha512-OOFJa28dxfl8kLOPMUOQBCO6z3X2SAfzIE276fwT52uXDWUS178KWq0pL7d6p1kz7pkzA0yQwtqL0dEPoVcRWg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.52.4.tgz", + "integrity": "sha512-1HHmsRyh845QDpEWzOFtMCph5Ts+9+yllCrREuBR/vg2RogAQGGBRC8lDPrPOMnrdOJ+mt1WLMOC2Kao/UwcvA==", "cpu": [ "riscv64" ], @@ -2785,9 +2785,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.52.3.tgz", - "integrity": "sha512-jMdsML2VI5l+V7cKfZx3ak+SLlJ8fKvLJ0Eoa4b9/vCUrzXKgoKxvHqvJ/mkWhFiyp88nCkM5S2v6nIwRtPcgg==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.52.4.tgz", + "integrity": "sha512-seoeZp4L/6D1MUyjWkOMRU6/iLmCU2EjbMTyAG4oIOs1/I82Y5lTeaxW0KBfkUdHAWN7j25bpkt0rjnOgAcQcA==", "cpu": [ "s390x" ], @@ -2799,9 +2799,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.3.tgz", - "integrity": "sha512-tPgGd6bY2M2LJTA1uGq8fkSPK8ZLYjDjY+ZLK9WHncCnfIz29LIXIqUgzCR0hIefzy6Hpbe8Th5WOSwTM8E7LA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.4.tgz", + "integrity": "sha512-Wi6AXf0k0L7E2gteNsNHUs7UMwCIhsCTs6+tqQ5GPwVRWMaflqGec4Sd8n6+FNFDw9vGcReqk2KzBDhCa1DLYg==", "cpu": [ "x64" ], @@ -2813,9 +2813,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.52.3.tgz", - "integrity": "sha512-BCFkJjgk+WFzP+tcSMXq77ymAPIxsX9lFJWs+2JzuZTLtksJ2o5hvgTdIcZ5+oKzUDMwI0PfWzRBYAydAHF2Mw==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.52.4.tgz", + "integrity": "sha512-dtBZYjDmCQ9hW+WgEkaffvRRCKm767wWhxsFW3Lw86VXz/uJRuD438/XvbZT//B96Vs8oTA8Q4A0AfHbrxP9zw==", "cpu": [ "x64" ], @@ -2827,9 +2827,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.52.3.tgz", - "integrity": "sha512-KTD/EqjZF3yvRaWUJdD1cW+IQBk4fbQaHYJUmP8N4XoKFZilVL8cobFSTDnjTtxWJQ3JYaMgF4nObY/+nYkumA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.52.4.tgz", + "integrity": "sha512-1ox+GqgRWqaB1RnyZXL8PD6E5f7YyRUJYnCqKpNzxzP0TkaUh112NDrR9Tt+C8rJ4x5G9Mk8PQR3o7Ku2RKqKA==", "cpu": [ "arm64" ], @@ -2841,9 +2841,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.52.3.tgz", - "integrity": "sha512-+zteHZdoUYLkyYKObGHieibUFLbttX2r+58l27XZauq0tcWYYuKUwY2wjeCN9oK1Um2YgH2ibd6cnX/wFD7DuA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.52.4.tgz", + "integrity": "sha512-8GKr640PdFNXwzIE0IrkMWUNUomILLkfeHjXBi/nUvFlpZP+FA8BKGKpacjW6OUUHaNI6sUURxR2U2g78FOHWQ==", "cpu": [ "arm64" ], @@ -2855,9 +2855,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.52.3.tgz", - "integrity": "sha512-of1iHkTQSo3kr6dTIRX6t81uj/c/b15HXVsPcEElN5sS859qHrOepM5p9G41Hah+CTqSh2r8Bm56dL2z9UQQ7g==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.52.4.tgz", + "integrity": "sha512-AIy/jdJ7WtJ/F6EcfOb2GjR9UweO0n43jNObQMb6oGxkYTfLcnN7vYYpG+CN3lLxrQkzWnMOoNSHTW54pgbVxw==", "cpu": [ "ia32" ], @@ -2869,9 +2869,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.52.3.tgz", - "integrity": "sha512-s0hybmlHb56mWVZQj8ra9048/WZTPLILKxcvcq+8awSZmyiSUZjjem1AhU3Tf4ZKpYhK4mg36HtHDOe8QJS5PQ==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.52.4.tgz", + "integrity": "sha512-UF9KfsH9yEam0UjTwAgdK0anlQ7c8/pWPU2yVjyWcF1I1thABt6WXE47cI71pGiZ8wGvxohBoLnxM04L/wj8mQ==", "cpu": [ "x64" ], @@ -2883,9 +2883,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.52.3.tgz", - "integrity": "sha512-zGIbEVVXVtauFgl3MRwGWEN36P5ZGenHRMgNw88X5wEhEBpq0XrMEZwOn07+ICrwM17XO5xfMZqh0OldCH5VTA==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.52.4.tgz", + "integrity": "sha512-bf9PtUa0u8IXDVxzRToFQKsNCRz9qLYfR/MpECxl4mRoWYjAeFjgxj1XdZr2M/GNVpT05p+LgQOHopYDlUu6/w==", "cpu": [ "x64" ], @@ -3221,13 +3221,12 @@ "license": "MIT" }, "node_modules/@types/send": { - "version": "0.17.5", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", - "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.0.tgz", + "integrity": "sha512-zBF6vZJn1IaMpg3xUF25VK3gd3l8zwE0ZLRX7dsQyQi+jp4E8mMDJNGDYnYse+bQhYwWERTxVwHpi3dMOq7RKQ==", "dev": true, "license": "MIT", "dependencies": { - "@types/mime": "^1", "@types/node": "*" } }, @@ -3242,15 +3241,26 @@ } }, "node_modules/@types/serve-static": { - "version": "1.15.8", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.8.tgz", - "integrity": "sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.9.tgz", + "integrity": "sha512-dOTIuqpWLyl3BBXU3maNQsS4A3zuuoYRNIvYSxxhebPfXg2mzWQEPne/nlJ37yOse6uGgR386uTpdsx4D0QZWA==", "dev": true, "license": "MIT", "dependencies": { "@types/http-errors": "*", "@types/node": "*", - "@types/send": "*" + "@types/send": "<1" + } + }, + "node_modules/@types/serve-static/node_modules/@types/send": { + "version": "0.17.5", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", + "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" } }, "node_modules/@types/sockjs": { @@ -4065,9 +4075,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.8.10", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.10.tgz", - "integrity": "sha512-uLfgBi+7IBNay8ECBO2mVMGZAc1VgZWEChxm4lv+TobGdG82LnXMjuNGo/BSSZZL4UmkWhxEHP2f5ziLNwGWMA==", + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.12.tgz", + "integrity": "sha512-vAPMQdnyKCBtkmQA6FMCBvU9qFIppS3nzyXnEM+Lo2IAhG4Mpjv9cCxMudhgV3YdNNJv6TNqXy97dfRVL2LmaQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -4511,9 +4521,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001746.tgz", - "integrity": "sha512-eA7Ys/DGw+pnkWWSE/id29f2IcPHVoE8wxtvE5JdvD2V28VTDPy1yEeo11Guz0sJ4ZeGRcm3uaTcAqK1LXaphA==", + "version": "1.0.30001747", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001747.tgz", + "integrity": "sha512-mzFa2DGIhuc5490Nd/G31xN1pnBnYMadtkyTjefPI7wzypqgCEpeWu9bJr0OnDsyKrW75zA9ZAt7pbQFmwLsQg==", "dev": true, "funding": [ { @@ -5726,9 +5736,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.229", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.229.tgz", - "integrity": "sha512-cwhDcZKGcT/rEthLRJ9eBlMDkh1sorgsuk+6dpsehV0g9CABsIqBxU4rLRjG+d/U6pYU1s37A4lSKrVc5lSQYg==", + "version": "1.5.230", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.230.tgz", + "integrity": "sha512-A6A6Fd3+gMdaed9wX83CvHYJb4UuapPD5X5SLq72VZJzxHSY0/LUweGXRWmQlh2ln7KV7iw7jnwXK7dlPoOnHQ==", "dev": true, "license": "ISC" }, @@ -5810,9 +5820,9 @@ } }, "node_modules/envinfo": { - "version": "7.15.0", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.15.0.tgz", - "integrity": "sha512-chR+t7exF6y59kelhXw5I3849nTy7KIRO+ePdLMhCD+JRP/JvmkenDWP7QSFGlsHX+kxGxdDutOPrmj5j1HR6g==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.16.0.tgz", + "integrity": "sha512-LqGbDxROFEWnYpUm9KiU2xHiYbjlHZS6NZQUpm1Lg1To4p+FJLks5crEhUnw+s/ZLHzI8U0QB+oVG7e8cXckMg==", "dev": true, "license": "MIT", "bin": { @@ -8454,9 +8464,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.21", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.21.tgz", - "integrity": "sha512-5b0pgg78U3hwXkCM8Z9b2FJdPZlr9Psr9V2gQPESdGHqbntyFJKFW4r5TeWGFzafGY3hzs1JC62VEQMbl1JFkw==", + "version": "2.0.23", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.23.tgz", + "integrity": "sha512-cCmFDMSm26S6tQSDpBCg/NR8NENrVPhAJSf+XbxBG4rPFaaonlEoE9wHQmun+cls499TQGSb7ZyPBRlzgKfpeg==", "dev": true, "license": "MIT" }, @@ -10096,9 +10106,9 @@ } }, "node_modules/rollup": { - "version": "4.52.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.3.tgz", - "integrity": "sha512-RIDh866U8agLgiIcdpB+COKnlCreHJLfIhWC3LVflku5YHfpnsIKigRZeFfMfCc4dVcqNVfQQ5gO/afOck064A==", + "version": "4.52.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.4.tgz", + "integrity": "sha512-CLEVl+MnPAiKh5pl4dEWSyMTpuflgNQiLGhMv8ezD5W/qP8AKvmYpCOKRRNOh7oRKnauBZ4SyeYkMS+1VSyKwQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10112,28 +10122,28 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.52.3", - "@rollup/rollup-android-arm64": "4.52.3", - "@rollup/rollup-darwin-arm64": "4.52.3", - "@rollup/rollup-darwin-x64": "4.52.3", - "@rollup/rollup-freebsd-arm64": "4.52.3", - "@rollup/rollup-freebsd-x64": "4.52.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.52.3", - "@rollup/rollup-linux-arm-musleabihf": "4.52.3", - "@rollup/rollup-linux-arm64-gnu": "4.52.3", - "@rollup/rollup-linux-arm64-musl": "4.52.3", - "@rollup/rollup-linux-loong64-gnu": "4.52.3", - "@rollup/rollup-linux-ppc64-gnu": "4.52.3", - "@rollup/rollup-linux-riscv64-gnu": "4.52.3", - "@rollup/rollup-linux-riscv64-musl": "4.52.3", - "@rollup/rollup-linux-s390x-gnu": "4.52.3", - "@rollup/rollup-linux-x64-gnu": "4.52.3", - "@rollup/rollup-linux-x64-musl": "4.52.3", - "@rollup/rollup-openharmony-arm64": "4.52.3", - "@rollup/rollup-win32-arm64-msvc": "4.52.3", - "@rollup/rollup-win32-ia32-msvc": "4.52.3", - "@rollup/rollup-win32-x64-gnu": "4.52.3", - "@rollup/rollup-win32-x64-msvc": "4.52.3", + "@rollup/rollup-android-arm-eabi": "4.52.4", + "@rollup/rollup-android-arm64": "4.52.4", + "@rollup/rollup-darwin-arm64": "4.52.4", + "@rollup/rollup-darwin-x64": "4.52.4", + "@rollup/rollup-freebsd-arm64": "4.52.4", + "@rollup/rollup-freebsd-x64": "4.52.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.52.4", + "@rollup/rollup-linux-arm-musleabihf": "4.52.4", + "@rollup/rollup-linux-arm64-gnu": "4.52.4", + "@rollup/rollup-linux-arm64-musl": "4.52.4", + "@rollup/rollup-linux-loong64-gnu": "4.52.4", + "@rollup/rollup-linux-ppc64-gnu": "4.52.4", + "@rollup/rollup-linux-riscv64-gnu": "4.52.4", + "@rollup/rollup-linux-riscv64-musl": "4.52.4", + "@rollup/rollup-linux-s390x-gnu": "4.52.4", + "@rollup/rollup-linux-x64-gnu": "4.52.4", + "@rollup/rollup-linux-x64-musl": "4.52.4", + "@rollup/rollup-openharmony-arm64": "4.52.4", + "@rollup/rollup-win32-arm64-msvc": "4.52.4", + "@rollup/rollup-win32-ia32-msvc": "4.52.4", + "@rollup/rollup-win32-x64-gnu": "4.52.4", + "@rollup/rollup-win32-x64-msvc": "4.52.4", "fsevents": "~2.3.2" } }, From 521db984abea3fe99599c8af9f2e8d6eb543091e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 5 Oct 2025 13:09:42 +0200 Subject: [PATCH 23/26] More user friendly message. --- app/Console/Commands/Integrity/ReportsEmptyObjects.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/Integrity/ReportsEmptyObjects.php b/app/Console/Commands/Integrity/ReportsEmptyObjects.php index b2d26ba555..936d8cede3 100644 --- a/app/Console/Commands/Integrity/ReportsEmptyObjects.php +++ b/app/Console/Commands/Integrity/ReportsEmptyObjects.php @@ -70,7 +70,7 @@ class ReportsEmptyObjects extends Command /** @var stdClass $entry */ foreach ($set as $entry) { $line = sprintf( - 'User #%d (%s) has budget #%d ("%s") which has no transaction journals.', + 'User #%d (%s) has budget #%d ("%s") which has no transactions.', $entry->user_id, $entry->email, $entry->id, @@ -96,7 +96,7 @@ class ReportsEmptyObjects extends Command /** @var stdClass $entry */ foreach ($set as $entry) { $line = sprintf( - 'User #%d (%s) has category #%d ("%s") which has no transaction journals.', + 'User #%d (%s) has category #%d ("%s") which has no transactions.', $entry->user_id, $entry->email, $entry->id, @@ -119,7 +119,7 @@ class ReportsEmptyObjects extends Command /** @var stdClass $entry */ foreach ($set as $entry) { $line = sprintf( - 'User #%d (%s) has tag #%d ("%s") which has no transaction journals.', + 'User #%d (%s) has tag #%d ("%s") which has no transactions.', $entry->user_id, $entry->email, $entry->id, From c541cf48c37f3388428b6ccaeb7b074b849eb4a0 Mon Sep 17 00:00:00 2001 From: JC5 Date: Mon, 6 Oct 2025 05:21:33 +0200 Subject: [PATCH 24/26] =?UTF-8?q?=F0=9F=A4=96=20Auto=20commit=20for=20rele?= =?UTF-8?q?ase=20'develop'=20on=202025-10-06?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.lock | 12 ++++++------ config/firefly.php | 4 ++-- package-lock.json | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/composer.lock b/composer.lock index 982569fbbd..7199fbf526 100644 --- a/composer.lock +++ b/composer.lock @@ -4813,16 +4813,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.46", + "version": "3.0.47", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6" + "reference": "9d6ca36a6c2dd434765b1071b2644a1c683b385d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6", - "reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/9d6ca36a6c2dd434765b1071b2644a1c683b385d", + "reference": "9d6ca36a6c2dd434765b1071b2644a1c683b385d", "shasum": "" }, "require": { @@ -4903,7 +4903,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.46" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.47" }, "funding": [ { @@ -4919,7 +4919,7 @@ "type": "tidelift" } ], - "time": "2025-06-26T16:29:55+00:00" + "time": "2025-10-06T01:07:24+00:00" }, { "name": "pragmarx/google2fa", diff --git a/config/firefly.php b/config/firefly.php index 34bb614840..733841fa2b 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -78,8 +78,8 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => 'develop/2025-10-05', - 'build_time' => 1759662132, + 'version' => 'develop/2025-10-06', + 'build_time' => 1759720765, 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 28, // field is no longer used. diff --git a/package-lock.json b/package-lock.json index a38fd55cd2..7469f14c92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4521,9 +4521,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001747", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001747.tgz", - "integrity": "sha512-mzFa2DGIhuc5490Nd/G31xN1pnBnYMadtkyTjefPI7wzypqgCEpeWu9bJr0OnDsyKrW75zA9ZAt7pbQFmwLsQg==", + "version": "1.0.30001748", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001748.tgz", + "integrity": "sha512-5P5UgAr0+aBmNiplks08JLw+AW/XG/SurlgZLgB1dDLfAw7EfRGxIwzPHxdSCGY/BTKDqIVyJL87cCN6s0ZR0w==", "dev": true, "funding": [ { @@ -5820,9 +5820,9 @@ } }, "node_modules/envinfo": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.16.0.tgz", - "integrity": "sha512-LqGbDxROFEWnYpUm9KiU2xHiYbjlHZS6NZQUpm1Lg1To4p+FJLks5crEhUnw+s/ZLHzI8U0QB+oVG7e8cXckMg==", + "version": "7.16.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.16.1.tgz", + "integrity": "sha512-IugkinfKJlINIece0m1tAtjn4LGNP3APqchokVe090oSI5E3mixxKuc34ZiDHO17MTPODwjHWEt7QdC8Y+xtyQ==", "dev": true, "license": "MIT", "bin": { From 36e87f33839afef75f469678f736869958a3b859 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 6 Oct 2025 20:43:47 +0200 Subject: [PATCH 25/26] Fix #11007 and fix #11005 --- app/Api/V1/Controllers/Autocomplete/AccountController.php | 2 +- app/Api/V1/Controllers/Models/Account/ShowController.php | 6 ++++++ app/Support/Request/ConvertsDataTypes.php | 3 ++- changelog.md | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Api/V1/Controllers/Autocomplete/AccountController.php b/app/Api/V1/Controllers/Autocomplete/AccountController.php index efd12f655e..c3f7cd9618 100644 --- a/app/Api/V1/Controllers/Autocomplete/AccountController.php +++ b/app/Api/V1/Controllers/Autocomplete/AccountController.php @@ -90,7 +90,7 @@ class AccountController extends Controller $timer->start(sprintf('AC accounts "%s"', $query)); $result = $this->repository->searchAccount((string) $query, $types, $this->parameters->get('limit')); - // set date to subday + end-of-day for account balance. so it is at $date 23:59:59 + // set date to end-of-day for account balance. so it is at $date 23:59:59 $date->endOfDay(); $allBalances = Steam::accountsBalancesOptimized($result, $date, $this->primaryCurrency, $this->convertToPrimary); diff --git a/app/Api/V1/Controllers/Models/Account/ShowController.php b/app/Api/V1/Controllers/Models/Account/ShowController.php index 230246bcf1..33c2e100d1 100644 --- a/app/Api/V1/Controllers/Models/Account/ShowController.php +++ b/app/Api/V1/Controllers/Models/Account/ShowController.php @@ -87,6 +87,9 @@ class ShowController extends Controller // TODO still need to figure out how to do this easily. $accounts = $collection->slice(($this->parameters->get('page') - 1) * $params['limit'], $params['limit']); + // #11007 go to the end of the previous day. + $this->parameters->set('start', $this->parameters->get('start')->subSecond()); + // enrich /** @var User $admin */ $admin = auth()->user(); @@ -125,6 +128,9 @@ class ShowController extends Controller $account->refresh(); $manager = $this->getManager(); + // #11007 go to the end of the previous day. + $this->parameters->set('start', $this->parameters->get('start')->subSecond()); + // enrich /** @var User $admin */ $admin = auth()->user(); diff --git a/app/Support/Request/ConvertsDataTypes.php b/app/Support/Request/ConvertsDataTypes.php index 5293a6f804..a57c45a320 100644 --- a/app/Support/Request/ConvertsDataTypes.php +++ b/app/Support/Request/ConvertsDataTypes.php @@ -314,7 +314,8 @@ trait ConvertsDataTypes // is an atom string, I hope? try { - $carbon = Carbon::parse($value, $value, config('app.timezone')); + $carbon = Carbon::parse($value); + $carbon->setTimezone(config('app.timezone')); } catch (InvalidDateException $e) { // @phpstan-ignore-line Log::error(sprintf('[3] "%s" is not a valid date or time: %s', $value, $e->getMessage())); diff --git a/changelog.md b/changelog.md index 588034223d..acd62c1168 100644 --- a/changelog.md +++ b/changelog.md @@ -29,6 +29,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). - [Discussion 10988](https://github.com/orgs/firefly-iii/discussions/10988) (Call to a member function startOfDay() on null.) started by @molnarti - [Issue 10990](https://github.com/firefly-iii/firefly-iii/issues/10990) (duplicate piggy event via API) reported by @4e868df3 - [Discussion 10994](https://github.com/orgs/firefly-iii/discussions/10994) (How does the save per month attribute from a piggy bank is calculated?) started by @AdriDevelopsThings +- #11005 +- #11007 ### API From def2dd77ab72b75f742493113a6b63825fe705c8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 6 Oct 2025 20:45:20 +0200 Subject: [PATCH 26/26] Fix #11003 --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 4d86235d14..b37e68c5bc 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1427,7 +1427,7 @@ Route::group( static function (): void { Route::get('', ['uses' => 'UserGroup\IndexController@index', 'as' => 'index']); Route::get('create', ['uses' => 'UserGroup\CreateController@create', 'as' => 'create']); - Route::get('edit/{userGroup}', ['uses' => 'UserGroup\EditController@edit', 'as' => 'edit']); + Route::get('edit/{userGroup?}', ['uses' => 'UserGroup\EditController@edit', 'as' => 'edit']); // Route::get('show/{userGroup}', ['uses' => 'UserGroup\ShowController@show', 'as' => 'show']); // Route::post('rescan/{bill}', ['uses' => 'Bill\ShowController@rescan', 'as' => 'rescan']);