Skip to content

Firefly III: a personal finances manager

Clean up comments

James Colee6dc881f56b9
diff --git a/app/Api/V1/Controllers/System/ConfigurationController.php b/app/Api/V1/Controllers/System/ConfigurationController.php
index 8d6fd7c73e..3d450f9cf3 100644
--- a/app/Api/V1/Controllers/System/ConfigurationController.php
+++ b/app/Api/V1/Controllers/System/ConfigurationController.php
@@ -61,7 +61,9 @@ class ConfigurationController extends Controller
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/configuration/getConfiguration
*
* @return JsonResponse
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function index(): JsonResponse
{
@@ -96,7 +98,6 @@ class ConfigurationController extends Controller
* Get all config values.
*
* @return array
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
@@ -136,7 +137,9 @@ class ConfigurationController extends Controller
* @param string $configKey
*
* @return JsonResponse
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function show(string $configKey): JsonResponse
{
@@ -171,7 +174,9 @@ class ConfigurationController extends Controller
* @param string $name
*
* @return JsonResponse
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function update(UpdateRequest $request, string $name): JsonResponse
{
diff --git a/app/Api/V2/Controllers/Chart/AccountController.php b/app/Api/V2/Controllers/Chart/AccountController.php
index 95ab24c5d4..e8d42a6595 100644
--- a/app/Api/V2/Controllers/Chart/AccountController.php
+++ b/app/Api/V2/Controllers/Chart/AccountController.php
@@ -32,6 +32,8 @@ use FireflyIII\Models\AccountType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Http\Api\ConvertsExchangeRates;
use Illuminate\Http\JsonResponse;
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\NotFoundExceptionInterface;
/**
* Class AccountController
@@ -62,6 +64,8 @@ class AccountController extends Controller
*
* @param DateRequest $request
* @return JsonResponse
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
public function dashboard(DateRequest $request): JsonResponse
{
diff --git a/app/Api/V2/Controllers/Model/Account/ShowController.php b/app/Api/V2/Controllers/Model/Account/ShowController.php
index d197005add..8f62d0b94d 100644
--- a/app/Api/V2/Controllers/Model/Account/ShowController.php
+++ b/app/Api/V2/Controllers/Model/Account/ShowController.php
@@ -37,8 +37,6 @@ class ShowController extends Controller
{
/**
* TODO this endpoint is not yet reachable.
- * @param Account $account
- * @return JsonResponse
*/
public function show(Request $request, Account $account): JsonResponse
{
diff --git a/app/Api/V2/Controllers/Model/Budget/ShowController.php b/app/Api/V2/Controllers/Model/Budget/ShowController.php
index 3dfa41460f..bf079e4242 100644
--- a/app/Api/V2/Controllers/Model/Budget/ShowController.php
+++ b/app/Api/V2/Controllers/Model/Budget/ShowController.php
@@ -57,8 +57,6 @@ class ShowController extends Controller
* This endpoint is documented at:
* TODO add URL
*
- * @param DateRequest $request
- * @return JsonResponse
*/
public function budgeted(DateRequest $request, Budget $budget): JsonResponse
{
@@ -73,8 +71,6 @@ class ShowController extends Controller
* This endpoint is documented at:
* TODO add URL
*
- * @param DateRequest $request
- * @return JsonResponse
*/
public function spent(DateRequest $request, Budget $budget): JsonResponse
{
diff --git a/app/Api/V2/Controllers/Model/BudgetLimit/ListController.php b/app/Api/V2/Controllers/Model/BudgetLimit/ListController.php
index 35f1de3479..591108da33 100644
--- a/app/Api/V2/Controllers/Model/BudgetLimit/ListController.php
+++ b/app/Api/V2/Controllers/Model/BudgetLimit/ListController.php
@@ -50,7 +50,6 @@ class ListController extends Controller
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/budgets/listBudgetLimitByBudget
- * @return JsonResponse
*/
public function index(DateRequest $request, Budget $budget): JsonResponse
{
diff --git a/app/Console/Commands/Correction/CorrectOpeningBalanceCurrencies.php b/app/Console/Commands/Correction/CorrectOpeningBalanceCurrencies.php
index 1d0fa1e0aa..d8fc818203 100644
--- a/app/Console/Commands/Correction/CorrectOpeningBalanceCurrencies.php
+++ b/app/Console/Commands/Correction/CorrectOpeningBalanceCurrencies.php
@@ -94,6 +94,8 @@ class CorrectOpeningBalanceCurrencies extends Command
* @param TransactionJournal $journal
*
* @return int
+ * @throws FireflyException
+ * @throws JsonException
*/
private function correctJournal(TransactionJournal $journal): int
{
diff --git a/app/Console/Commands/Correction/FixAccountTypes.php b/app/Console/Commands/Correction/FixAccountTypes.php
index cbc369391b..abdce7d3ac 100644
--- a/app/Console/Commands/Correction/FixAccountTypes.php
+++ b/app/Console/Commands/Correction/FixAccountTypes.php
@@ -166,6 +166,7 @@ class FixAccountTypes extends Command
* @param Transaction $dest
*
* @throws FireflyException
+ * @throws \JsonException
*/
private function fixJournal(TransactionJournal $journal, string $type, Transaction $source, Transaction $dest): void
{
diff --git a/app/Console/Commands/DecryptDatabase.php b/app/Console/Commands/DecryptDatabase.php
index f0c82a920d..74b784debf 100644
--- a/app/Console/Commands/DecryptDatabase.php
+++ b/app/Console/Commands/DecryptDatabase.php
@@ -90,6 +90,8 @@ class DecryptDatabase extends Command
/**
* @param string $table
* @param array $fields
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
private function decryptTable(string $table, array $fields): void
{
diff --git a/app/Console/Commands/Tools/Cron.php b/app/Console/Commands/Tools/Cron.php
index d8cfaa2919..5059e43ffa 100644
--- a/app/Console/Commands/Tools/Cron.php
+++ b/app/Console/Commands/Tools/Cron.php
@@ -33,6 +33,8 @@ use FireflyIII\Support\Cronjobs\RecurringCronjob;
use Illuminate\Console\Command;
use InvalidArgumentException;
use Log;
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\NotFoundExceptionInterface;
/**
* Class Cron
@@ -124,7 +126,6 @@ class Cron extends Command
/**
* @param bool $force
* @param Carbon|null $date
- * @throws FireflyException
*/
private function exchangeRatesCronJob(bool $force, ?Carbon $date): void
{
@@ -152,7 +153,9 @@ class Cron extends Command
* @param bool $force
* @param Carbon|null $date
*
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
private function recurringCronJob(bool $force, ?Carbon $date): void
{
@@ -207,6 +210,8 @@ class Cron extends Command
* @param bool $force
* @param Carbon|null $date
* @throws FireflyException
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
private function billWarningCronJob(bool $force, ?Carbon $date): void
{
diff --git a/app/Console/Commands/Upgrade/AccountCurrencies.php b/app/Console/Commands/Upgrade/AccountCurrencies.php
index b3addddfcb..5f6c2ecbfe 100644
--- a/app/Console/Commands/Upgrade/AccountCurrencies.php
+++ b/app/Console/Commands/Upgrade/AccountCurrencies.php
@@ -66,7 +66,9 @@ class AccountCurrencies extends Command
* Each (asset) account must have a reference to a preferred currency. If the account does not have one, it's forced upon the account.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -110,7 +112,6 @@ class AccountCurrencies extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/AppendBudgetLimitPeriods.php b/app/Console/Commands/Upgrade/AppendBudgetLimitPeriods.php
index 32d1f735f5..e2f811c4b3 100644
--- a/app/Console/Commands/Upgrade/AppendBudgetLimitPeriods.php
+++ b/app/Console/Commands/Upgrade/AppendBudgetLimitPeriods.php
@@ -50,7 +50,9 @@ class AppendBudgetLimitPeriods extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -73,7 +75,6 @@ class AppendBudgetLimitPeriods extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/BackToJournals.php b/app/Console/Commands/Upgrade/BackToJournals.php
index e0a8454410..b0da223015 100644
--- a/app/Console/Commands/Upgrade/BackToJournals.php
+++ b/app/Console/Commands/Upgrade/BackToJournals.php
@@ -58,7 +58,9 @@ class BackToJournals extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -86,6 +88,8 @@ class BackToJournals extends Command
/**
* @return bool
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
private function isMigrated(): bool
{
@@ -96,7 +100,6 @@ class BackToJournals extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/BudgetLimitCurrency.php b/app/Console/Commands/Upgrade/BudgetLimitCurrency.php
index 333a4af854..9f46ab81d8 100644
--- a/app/Console/Commands/Upgrade/BudgetLimitCurrency.php
+++ b/app/Console/Commands/Upgrade/BudgetLimitCurrency.php
@@ -53,8 +53,9 @@ class BudgetLimitCurrency extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
- * @throws JsonException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -100,7 +101,6 @@ class BudgetLimitCurrency extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/CCLiabilities.php b/app/Console/Commands/Upgrade/CCLiabilities.php
index aaac64b4bd..a2b5d0e9ba 100644
--- a/app/Console/Commands/Upgrade/CCLiabilities.php
+++ b/app/Console/Commands/Upgrade/CCLiabilities.php
@@ -54,7 +54,9 @@ class CCLiabilities extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -97,7 +99,6 @@ class CCLiabilities extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/MigrateAttachments.php b/app/Console/Commands/Upgrade/MigrateAttachments.php
index 1fe8957180..ee81654dc9 100644
--- a/app/Console/Commands/Upgrade/MigrateAttachments.php
+++ b/app/Console/Commands/Upgrade/MigrateAttachments.php
@@ -54,7 +54,9 @@ class MigrateAttachments extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -106,7 +108,6 @@ class MigrateAttachments extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/MigrateJournalNotes.php b/app/Console/Commands/Upgrade/MigrateJournalNotes.php
index 96b92b349b..aaad2291f5 100644
--- a/app/Console/Commands/Upgrade/MigrateJournalNotes.php
+++ b/app/Console/Commands/Upgrade/MigrateJournalNotes.php
@@ -55,7 +55,9 @@ class MigrateJournalNotes extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -102,7 +104,6 @@ class MigrateJournalNotes extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php b/app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php
index 267f93ec5f..14a01764c5 100644
--- a/app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php
+++ b/app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php
@@ -56,8 +56,10 @@ class MigrateRecurrenceMeta extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
* @throws JsonException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -86,7 +88,6 @@ class MigrateRecurrenceMeta extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/MigrateRecurrenceType.php b/app/Console/Commands/Upgrade/MigrateRecurrenceType.php
index 485aa4ca9a..edc2f67b08 100644
--- a/app/Console/Commands/Upgrade/MigrateRecurrenceType.php
+++ b/app/Console/Commands/Upgrade/MigrateRecurrenceType.php
@@ -55,7 +55,9 @@ class MigrateRecurrenceType extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -78,7 +80,6 @@ class MigrateRecurrenceType extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/MigrateTagLocations.php b/app/Console/Commands/Upgrade/MigrateTagLocations.php
index 97bd4d1368..15c9f1b654 100644
--- a/app/Console/Commands/Upgrade/MigrateTagLocations.php
+++ b/app/Console/Commands/Upgrade/MigrateTagLocations.php
@@ -54,7 +54,9 @@ class MigrateTagLocations extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -75,7 +77,6 @@ class MigrateTagLocations extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/MigrateToGroups.php b/app/Console/Commands/Upgrade/MigrateToGroups.php
index 26b665b416..9a2e7cc288 100644
--- a/app/Console/Commands/Upgrade/MigrateToGroups.php
+++ b/app/Console/Commands/Upgrade/MigrateToGroups.php
@@ -72,7 +72,9 @@ class MigrateToGroups extends Command
* Execute the console command.
*
* @return int
- * @throws Exception
+ * @throws ContainerExceptionInterface
+ * @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -130,7 +132,6 @@ class MigrateToGroups extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/MigrateToRules.php b/app/Console/Commands/Upgrade/MigrateToRules.php
index a07e0d312d..802c6c849b 100644
--- a/app/Console/Commands/Upgrade/MigrateToRules.php
+++ b/app/Console/Commands/Upgrade/MigrateToRules.php
@@ -68,7 +68,9 @@ class MigrateToRules extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -121,7 +123,6 @@ class MigrateToRules extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php b/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php
index 3e15c73425..faeb76a83f 100644
--- a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php
+++ b/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php
@@ -67,7 +67,9 @@ class OtherCurrenciesCorrections extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -110,7 +112,6 @@ class OtherCurrenciesCorrections extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/RenameAccountMeta.php b/app/Console/Commands/Upgrade/RenameAccountMeta.php
index 8f4dd04373..0d9c5d5e82 100644
--- a/app/Console/Commands/Upgrade/RenameAccountMeta.php
+++ b/app/Console/Commands/Upgrade/RenameAccountMeta.php
@@ -52,7 +52,9 @@ class RenameAccountMeta extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -100,7 +102,6 @@ class RenameAccountMeta extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/TransactionIdentifier.php b/app/Console/Commands/Upgrade/TransactionIdentifier.php
index de4ec730b8..b8711e1084 100644
--- a/app/Console/Commands/Upgrade/TransactionIdentifier.php
+++ b/app/Console/Commands/Upgrade/TransactionIdentifier.php
@@ -68,7 +68,9 @@ class TransactionIdentifier extends Command
* think. So each set gets a number (1,2,3) to keep them apart.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -121,7 +123,6 @@ class TransactionIdentifier extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php b/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php
index 8133018813..2a67a3c234 100644
--- a/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php
+++ b/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php
@@ -138,7 +138,6 @@ class TransferCurrenciesCorrections extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/UpgradeLiabilities.php b/app/Console/Commands/Upgrade/UpgradeLiabilities.php
index e2c64278bf..d17f1c6394 100644
--- a/app/Console/Commands/Upgrade/UpgradeLiabilities.php
+++ b/app/Console/Commands/Upgrade/UpgradeLiabilities.php
@@ -60,7 +60,9 @@ class UpgradeLiabilities extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -82,7 +84,6 @@ class UpgradeLiabilities extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.php b/app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.php
index 1757c975cc..76c10e813b 100644
--- a/app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.php
+++ b/app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.php
@@ -62,7 +62,9 @@ class UpgradeLiabilitiesEight extends Command
* Execute the console command.
*
* @return int
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -83,7 +85,6 @@ class UpgradeLiabilitiesEight extends Command
/**
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Factory/AccountFactory.php b/app/Factory/AccountFactory.php
index 83274334cb..5959134cc7 100644
--- a/app/Factory/AccountFactory.php
+++ b/app/Factory/AccountFactory.php
@@ -253,6 +253,8 @@ class AccountFactory
* @param array $data
*
* @return array
+ * @throws FireflyException
+ * @throws JsonException
*/
private function cleanMetaDataArray(Account $account, array $data): array
{
diff --git a/app/Factory/RecurrenceFactory.php b/app/Factory/RecurrenceFactory.php
index c739b657b7..5e66d9b63c 100644
--- a/app/Factory/RecurrenceFactory.php
+++ b/app/Factory/RecurrenceFactory.php
@@ -58,6 +58,7 @@ class RecurrenceFactory
*
* @return Recurrence
* @throws FireflyException
+ * @throws \JsonException
*/
public function create(array $data): Recurrence
{
diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php
index 4a324362f5..872f20342a 100644
--- a/app/Factory/TransactionJournalFactory.php
+++ b/app/Factory/TransactionJournalFactory.php
@@ -450,6 +450,8 @@ class TransactionJournalFactory
* @param Account $destination
*
* @return TransactionCurrency
+ * @throws FireflyException
+ * @throws JsonException
*/
private function getCurrencyByAccount(string $type, ?TransactionCurrency $currency, Account $source, Account $destination): TransactionCurrency
{
@@ -510,6 +512,8 @@ class TransactionJournalFactory
* @param Account $destination
*
* @return TransactionCurrency|null
+ * @throws FireflyException
+ * @throws JsonException
*/
private function getForeignByAccount(string $type, ?TransactionCurrency $foreignCurrency, Account $destination): ?TransactionCurrency
{
diff --git a/app/Generator/Report/Budget/MonthReportGenerator.php b/app/Generator/Report/Budget/MonthReportGenerator.php
index 7505d80ba8..717e6b7a91 100644
--- a/app/Generator/Report/Budget/MonthReportGenerator.php
+++ b/app/Generator/Report/Budget/MonthReportGenerator.php
@@ -58,6 +58,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
* Generates the report.
*
* @return string
+ * @throws FireflyException
*/
public function generate(): string
{
diff --git a/app/Generator/Report/Category/MonthReportGenerator.php b/app/Generator/Report/Category/MonthReportGenerator.php
index 906d0fc17c..b1fc078873 100644
--- a/app/Generator/Report/Category/MonthReportGenerator.php
+++ b/app/Generator/Report/Category/MonthReportGenerator.php
@@ -60,6 +60,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
* Generates the report.
*
* @return string
+ * @throws FireflyException
*/
public function generate(): string
{
diff --git a/app/Generator/Report/Standard/MonthReportGenerator.php b/app/Generator/Report/Standard/MonthReportGenerator.php
index 6114b761f7..4c4dbe914e 100644
--- a/app/Generator/Report/Standard/MonthReportGenerator.php
+++ b/app/Generator/Report/Standard/MonthReportGenerator.php
@@ -48,6 +48,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
* Generates the report.
*
* @return string
+ * @throws FireflyException
*/
public function generate(): string
{
diff --git a/app/Generator/Report/Standard/MultiYearReportGenerator.php b/app/Generator/Report/Standard/MultiYearReportGenerator.php
index ac405e93c2..6cac024b12 100644
--- a/app/Generator/Report/Standard/MultiYearReportGenerator.php
+++ b/app/Generator/Report/Standard/MultiYearReportGenerator.php
@@ -48,6 +48,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
* Generates the report.
*
* @return string
+ * @throws FireflyException
*/
public function generate(): string
{
diff --git a/app/Generator/Report/Standard/YearReportGenerator.php b/app/Generator/Report/Standard/YearReportGenerator.php
index d3dd23628c..14d4d7ac65 100644
--- a/app/Generator/Report/Standard/YearReportGenerator.php
+++ b/app/Generator/Report/Standard/YearReportGenerator.php
@@ -48,6 +48,7 @@ class YearReportGenerator implements ReportGeneratorInterface
* Generates the report.
*
* @return string
+ * @throws FireflyException
*/
public function generate(): string
{
diff --git a/app/Generator/Report/Tag/MonthReportGenerator.php b/app/Generator/Report/Tag/MonthReportGenerator.php
index b380305d87..72c057362d 100644
--- a/app/Generator/Report/Tag/MonthReportGenerator.php
+++ b/app/Generator/Report/Tag/MonthReportGenerator.php
@@ -55,6 +55,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
* Generate the report.
*
* @return string
+ * @throws FireflyException
*/
public function generate(): string
{
diff --git a/app/Generator/Webhook/StandardMessageGenerator.php b/app/Generator/Webhook/StandardMessageGenerator.php
index 62f47bdbf0..a0e28589a6 100644
--- a/app/Generator/Webhook/StandardMessageGenerator.php
+++ b/app/Generator/Webhook/StandardMessageGenerator.php
@@ -103,6 +103,8 @@ class StandardMessageGenerator implements MessageGeneratorInterface
/**
* @param Webhook $webhook
+ * @throws FireflyException
+ * @throws JsonException
*/
private function runWebhook(Webhook $webhook): void
{
diff --git a/app/Handlers/Events/AutomationHandler.php b/app/Handlers/Events/AutomationHandler.php
index 6cdace98b6..98b2b5f7b1 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 FireflyIII\Events\RequestedReportOnJournals;
+use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Notifications\User\TransactionCreation;
use FireflyIII\Repositories\User\UserRepositoryInterface;
@@ -40,6 +41,7 @@ class AutomationHandler
* Respond to the creation of X journals.
*
* @param RequestedReportOnJournals $event
+ * @throws FireflyException
*/
public function reportJournals(RequestedReportOnJournals $event): void
{
diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php
index 2c23b85cdc..8d6af22cf6 100644
--- a/app/Handlers/Events/UserEventHandler.php
+++ b/app/Handlers/Events/UserEventHandler.php
@@ -287,6 +287,7 @@ class UserEventHandler
/**
* @param InvitationCreated $event
* @return void
+ * @throws FireflyException
*/
public function sendRegistrationInvite(InvitationCreated $event): void
{
diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php
index d84e88e4a9..a1768a271e 100644
--- a/app/Helpers/Collector/GroupCollector.php
+++ b/app/Helpers/Collector/GroupCollector.php
@@ -504,6 +504,7 @@ class GroupCollector implements GroupCollectorInterface
* @param Collection $collection
*
* @return Collection
+ * @throws FireflyException
*/
private function parseArray(Collection $collection): Collection
{
@@ -556,6 +557,7 @@ class GroupCollector implements GroupCollectorInterface
* @param TransactionJournal $augumentedJournal
*
* @return array
+ * @throws FireflyException
*/
private function parseAugmentedJournal(TransactionJournal $augumentedJournal): array
{
diff --git a/app/Helpers/Fiscal/FiscalHelper.php b/app/Helpers/Fiscal/FiscalHelper.php
index d33d8b3c18..7c0c549c16 100644
--- a/app/Helpers/Fiscal/FiscalHelper.php
+++ b/app/Helpers/Fiscal/FiscalHelper.php
@@ -74,7 +74,6 @@ class FiscalHelper implements FiscalHelperInterface
* @param Carbon $date
*
* @return Carbon date object
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php
index 98d9651e6e..45e2badfbb 100644
--- a/app/Http/Controllers/Account/ReconcileController.php
+++ b/app/Http/Controllers/Account/ReconcileController.php
@@ -209,7 +209,7 @@ class ReconcileController extends Controller
*
* @return RedirectResponse|Redirector|string
* @throws DuplicateTransactionException
- *
+ * @throws JsonException
*/
private function createReconciliation(Account $account, Carbon $start, Carbon $end, string $difference)
{
diff --git a/app/Http/Controllers/Admin/UpdateController.php b/app/Http/Controllers/Admin/UpdateController.php
index 5334f27843..f568ac8302 100644
--- a/app/Http/Controllers/Admin/UpdateController.php
+++ b/app/Http/Controllers/Admin/UpdateController.php
@@ -63,7 +63,6 @@ class UpdateController extends Controller
* Show page with update options.
*
* @return Factory|View
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php
index b5107d4d28..082d13b5d5 100644
--- a/app/Http/Controllers/Admin/UserController.php
+++ b/app/Http/Controllers/Admin/UserController.php
@@ -36,6 +36,8 @@ use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use Log;
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\NotFoundExceptionInterface;
/**
* Class UserController.
@@ -142,6 +144,8 @@ class UserController extends Controller
* Show index of user manager.
*
* @return Factory|View
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
public function index()
{
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index 4fa018248b..aa5ac49521 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -81,7 +81,6 @@ class LoginController extends Controller
/**
* Handle a login request to the application.
*
- * @param Request $request
*
* @throws ValidationException
*/
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php
index 3eed0fe336..c7e6cbc1df 100644
--- a/app/Http/Controllers/Auth/RegisterController.php
+++ b/app/Http/Controllers/Auth/RegisterController.php
@@ -144,7 +144,6 @@ class RegisterController extends Controller
/**
* Show the application registration form if the invitation code is valid.
*
- * @param Request $request
*
* @return Factory|View
* @throws ContainerExceptionInterface
diff --git a/app/Http/Controllers/Bill/ShowController.php b/app/Http/Controllers/Bill/ShowController.php
index 98c4d32323..930e43f2e9 100644
--- a/app/Http/Controllers/Bill/ShowController.php
+++ b/app/Http/Controllers/Bill/ShowController.php
@@ -126,7 +126,6 @@ class ShowController extends Controller
* @param Bill $bill
*
* @return Factory|View
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Http/Controllers/Budget/ShowController.php b/app/Http/Controllers/Budget/ShowController.php
index 860d38d8a9..725b9c6530 100644
--- a/app/Http/Controllers/Budget/ShowController.php
+++ b/app/Http/Controllers/Budget/ShowController.php
@@ -83,7 +83,6 @@ class ShowController extends Controller
*
* @return Factory|View
* @throws FireflyException
- * @throws JsonException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
@@ -121,7 +120,6 @@ class ShowController extends Controller
* @param Request $request
*
* @return Factory|View
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
@@ -151,8 +149,6 @@ class ShowController extends Controller
* @param Budget $budget
*
* @return Factory|View
- * @throws FireflyException
- * @throws JsonException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
@@ -190,7 +186,6 @@ class ShowController extends Controller
*
* @return Factory|View
* @throws FireflyException
- * @throws JsonException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Http/Controllers/Category/IndexController.php b/app/Http/Controllers/Category/IndexController.php
index 2c20057fcd..8e7b9886b5 100644
--- a/app/Http/Controllers/Category/IndexController.php
+++ b/app/Http/Controllers/Category/IndexController.php
@@ -69,7 +69,6 @@ class IndexController extends Controller
* @param Request $request
*
* @return Factory|View
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Http/Controllers/Category/ShowController.php b/app/Http/Controllers/Category/ShowController.php
index 5af240529d..50dd4da426 100644
--- a/app/Http/Controllers/Category/ShowController.php
+++ b/app/Http/Controllers/Category/ShowController.php
@@ -81,7 +81,6 @@ class ShowController extends Controller
*
* @return Factory|View
* @throws FireflyException
- * @throws JsonException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
@@ -126,7 +125,6 @@ class ShowController extends Controller
* @param Category $category
*
* @return Factory|View
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php
index afbe4629ce..0e726c999b 100644
--- a/app/Http/Controllers/Chart/AccountController.php
+++ b/app/Http/Controllers/Chart/AccountController.php
@@ -180,7 +180,6 @@ class AccountController extends Controller
* @param Account $account
*
* @return JsonResponse
- * @throws JsonException
*/
public function expenseBudgetAll(AccountRepositoryInterface $repository, Account $account): JsonResponse
{
@@ -255,7 +254,6 @@ class AccountController extends Controller
* @param Account $account
*
* @return JsonResponse
- * @throws JsonException
*/
public function expenseCategoryAll(AccountRepositoryInterface $repository, Account $account): JsonResponse
{
@@ -356,7 +354,6 @@ class AccountController extends Controller
* @param Account $account
*
* @return JsonResponse
- * @throws JsonException
*/
public function incomeCategoryAll(AccountRepositoryInterface $repository, Account $account): JsonResponse
{
diff --git a/app/Http/Controllers/Chart/TransactionController.php b/app/Http/Controllers/Chart/TransactionController.php
index 01a65da0e7..7e487c63f6 100644
--- a/app/Http/Controllers/Chart/TransactionController.php
+++ b/app/Http/Controllers/Chart/TransactionController.php
@@ -98,7 +98,6 @@ class TransactionController extends Controller
* @param Carbon $end
*
* @return JsonResponse
- * @throws FireflyException
*/
public function categories(string $objectType, Carbon $start, Carbon $end)
{
@@ -152,7 +151,6 @@ class TransactionController extends Controller
* @param Carbon $end
*
* @return JsonResponse
- * @throws FireflyException
*/
public function destinationAccounts(string $objectType, Carbon $start, Carbon $end)
{
@@ -206,7 +204,6 @@ class TransactionController extends Controller
* @param Carbon $end
*
* @return JsonResponse
- * @throws FireflyException
*/
public function sourceAccounts(string $objectType, Carbon $start, Carbon $end)
{
diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php
index ef4455323f..5987e12dd6 100644
--- a/app/Http/Controllers/CurrencyController.php
+++ b/app/Http/Controllers/CurrencyController.php
@@ -326,7 +326,6 @@ class CurrencyController extends Controller
* @param Request $request
*
* @return Factory|View
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php
index 0cc8b02bd5..6a6d85ed1a 100644
--- a/app/Http/Controllers/DebugController.php
+++ b/app/Http/Controllers/DebugController.php
@@ -81,6 +81,7 @@ class DebugController extends Controller
* @param Request $request
*
* @return RedirectResponse|Redirector
+ * @throws FireflyException
*/
public function flush(Request $request)
{
diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php
index 2a6c02886d..2a38ceb849 100644
--- a/app/Http/Controllers/JavascriptController.php
+++ b/app/Http/Controllers/JavascriptController.php
@@ -51,7 +51,6 @@ class JavascriptController extends Controller
* @param CurrencyRepositoryInterface $currencyRepository
*
* @return Response
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php
index 407b524cba..a676e8c138 100644
--- a/app/Http/Controllers/Json/FrontpageController.php
+++ b/app/Http/Controllers/Json/FrontpageController.php
@@ -42,6 +42,7 @@ class FrontpageController extends Controller
* @param PiggyBankRepositoryInterface $repository
*
* @return JsonResponse
+ * @throws FireflyException
*/
public function piggyBanks(PiggyBankRepositoryInterface $repository): JsonResponse
{
diff --git a/app/Http/Controllers/Json/RuleController.php b/app/Http/Controllers/Json/RuleController.php
index 669edb381e..f66fe0b604 100644
--- a/app/Http/Controllers/Json/RuleController.php
+++ b/app/Http/Controllers/Json/RuleController.php
@@ -41,6 +41,7 @@ class RuleController extends Controller
* @param Request $request
*
* @return JsonResponse
+ * @throws FireflyException
*/
public function action(Request $request): JsonResponse
{
@@ -67,6 +68,7 @@ class RuleController extends Controller
* @param Request $request
*
* @return JsonResponse
+ * @throws FireflyException
*/
public function trigger(Request $request): JsonResponse
{
diff --git a/app/Http/Controllers/PiggyBank/ShowController.php b/app/Http/Controllers/PiggyBank/ShowController.php
index 00047a61a4..414ec6e3e9 100644
--- a/app/Http/Controllers/PiggyBank/ShowController.php
+++ b/app/Http/Controllers/PiggyBank/ShowController.php
@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank;
use Carbon\Carbon;
+use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
@@ -67,6 +68,8 @@ class ShowController extends Controller
* @param PiggyBank $piggyBank
*
* @return Factory|View
+ * @throws FireflyException
+ * @throws \JsonException
*/
public function show(PiggyBank $piggyBank)
{
diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.php
index 93fdcc9a67..59225acbd9 100644
--- a/app/Http/Controllers/Popup/ReportController.php
+++ b/app/Http/Controllers/Popup/ReportController.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Popup;
+use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Support\Http\Controllers\RenderPartialViews;
use Illuminate\Http\JsonResponse;
@@ -42,7 +43,7 @@ class ReportController extends Controller
* @param Request $request
*
* @return JsonResponse
- *
+ * @throws FireflyException
*/
public function general(Request $request): JsonResponse
{
diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php
index e7b8d8a30d..1cc5f8d481 100644
--- a/app/Http/Controllers/ProfileController.php
+++ b/app/Http/Controllers/ProfileController.php
@@ -216,7 +216,6 @@ class ProfileController extends Controller
/**
* Delete 2FA routine.
*
- * @return RedirectResponse|Redirector
*/
public function deleteCode(Request $request): RedirectResponse|Redirector
{
@@ -245,7 +244,6 @@ class ProfileController extends Controller
/**
* Enable 2FA screen.
*
- * @return RedirectResponse|Redirector
*/
public function enable2FA(Request $request): RedirectResponse|Redirector
{
@@ -643,7 +641,7 @@ class ProfileController extends Controller
* @param Request $request
*
* @return RedirectResponse|Redirector
- * @throws FireflyException
+ * @throws \Exception
*/
public function regenerate(Request $request)
{
diff --git a/app/Http/Controllers/Report/AccountController.php b/app/Http/Controllers/Report/AccountController.php
index c837be0ec4..79bc1b0db7 100644
--- a/app/Http/Controllers/Report/AccountController.php
+++ b/app/Http/Controllers/Report/AccountController.php
@@ -45,6 +45,7 @@ class AccountController extends Controller
* @param Carbon $end
*
* @return mixed|string
+ * @throws FireflyException
*/
public function general(Collection $accounts, Carbon $start, Carbon $end)
{
diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php
index eb79b1b8e9..751a05aff2 100644
--- a/app/Http/Controllers/Report/BalanceController.php
+++ b/app/Http/Controllers/Report/BalanceController.php
@@ -67,6 +67,7 @@ class BalanceController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function general(Collection $accounts, Carbon $start, Carbon $end)
{
diff --git a/app/Http/Controllers/Report/BillController.php b/app/Http/Controllers/Report/BillController.php
index 0cc81018c6..eb5105e93f 100644
--- a/app/Http/Controllers/Report/BillController.php
+++ b/app/Http/Controllers/Report/BillController.php
@@ -43,6 +43,7 @@ class BillController extends Controller
* @param Carbon $end
*
* @return mixed|string
+ * @throws FireflyException
*/
public function overview(Collection $accounts, Carbon $start, Carbon $end)
{ // chart properties for cache:
diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php
index 2320bd83de..71c609b0e9 100644
--- a/app/Http/Controllers/Report/BudgetController.php
+++ b/app/Http/Controllers/Report/BudgetController.php
@@ -74,6 +74,8 @@ class BudgetController extends Controller
* @param Carbon $end
*
* @return Factory|View
+ * @throws FireflyException
+ * @throws JsonException
*/
public function accountPerBudget(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end)
{
@@ -155,6 +157,7 @@ class BudgetController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function avgExpenses(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end)
{
@@ -276,6 +279,8 @@ class BudgetController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
+ * @throws JsonException
*/
public function general(Collection $accounts, Carbon $start, Carbon $end)
{
@@ -301,7 +306,7 @@ class BudgetController extends Controller
* @param Carbon $end
*
* @return mixed|string
- * @throws JsonException
+ * @throws FireflyException
*/
public function period(Collection $accounts, Carbon $start, Carbon $end)
{
@@ -365,6 +370,7 @@ class BudgetController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function topExpenses(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end)
{
diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php
index fcc394091d..588a0f8270 100644
--- a/app/Http/Controllers/Report/CategoryController.php
+++ b/app/Http/Controllers/Report/CategoryController.php
@@ -278,6 +278,7 @@ class CategoryController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function avgExpenses(Collection $accounts, Collection $categories, Carbon $start, Carbon $end)
{
@@ -330,6 +331,7 @@ class CategoryController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function avgIncome(Collection $accounts, Collection $categories, Carbon $start, Carbon $end)
{
@@ -491,7 +493,7 @@ class CategoryController extends Controller
* @param Carbon $end
*
* @return mixed|string
- * @throws JsonException
+ * @throws FireflyException
*/
public function expenses(Collection $accounts, Carbon $start, Carbon $end)
{
@@ -572,7 +574,7 @@ class CategoryController extends Controller
* @param Carbon $end
*
* @return string
- * @throws JsonException
+ * @throws FireflyException
*/
public function income(Collection $accounts, Carbon $start, Carbon $end): string
{
@@ -650,6 +652,7 @@ class CategoryController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function operations(Collection $accounts, Carbon $start, Carbon $end): string
{
@@ -691,6 +694,7 @@ class CategoryController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function topExpenses(Collection $accounts, Collection $categories, Carbon $start, Carbon $end)
{
@@ -741,6 +745,7 @@ class CategoryController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function topIncome(Collection $accounts, Collection $categories, Carbon $start, Carbon $end)
{
diff --git a/app/Http/Controllers/Report/DoubleController.php b/app/Http/Controllers/Report/DoubleController.php
index cfce332b9e..bfa6a0b62a 100644
--- a/app/Http/Controllers/Report/DoubleController.php
+++ b/app/Http/Controllers/Report/DoubleController.php
@@ -77,6 +77,7 @@ class DoubleController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function avgExpenses(Collection $accounts, Collection $doubles, Carbon $start, Carbon $end)
{
@@ -129,6 +130,7 @@ class DoubleController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function avgIncome(Collection $accounts, Collection $doubles, Carbon $start, Carbon $end)
{
@@ -425,6 +427,7 @@ class DoubleController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function topExpenses(Collection $accounts, Collection $doubles, Carbon $start, Carbon $end)
{
@@ -475,6 +478,7 @@ class DoubleController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function topIncome(Collection $accounts, Collection $doubles, Carbon $start, Carbon $end)
{
diff --git a/app/Http/Controllers/Report/OperationsController.php b/app/Http/Controllers/Report/OperationsController.php
index 3621aab212..f73e2cf7bf 100644
--- a/app/Http/Controllers/Report/OperationsController.php
+++ b/app/Http/Controllers/Report/OperationsController.php
@@ -67,6 +67,7 @@ class OperationsController extends Controller
* @param Carbon $end
*
* @return mixed|string
+ * @throws FireflyException
*/
public function expenses(Collection $accounts, Carbon $start, Carbon $end)
{
@@ -102,6 +103,7 @@ class OperationsController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function income(Collection $accounts, Carbon $start, Carbon $end): string
{
@@ -137,6 +139,7 @@ class OperationsController extends Controller
* @param Carbon $end
*
* @return mixed|string
+ * @throws FireflyException
*/
public function operations(Collection $accounts, Carbon $start, Carbon $end)
{
diff --git a/app/Http/Controllers/Report/TagController.php b/app/Http/Controllers/Report/TagController.php
index 47dc192ac8..c9c599be49 100644
--- a/app/Http/Controllers/Report/TagController.php
+++ b/app/Http/Controllers/Report/TagController.php
@@ -270,6 +270,7 @@ class TagController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function avgExpenses(Collection $accounts, Collection $tags, Carbon $start, Carbon $end)
{
@@ -322,6 +323,7 @@ class TagController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function avgIncome(Collection $accounts, Collection $tags, Carbon $start, Carbon $end)
{
@@ -482,6 +484,7 @@ class TagController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function topExpenses(Collection $accounts, Collection $tags, Carbon $start, Carbon $end)
{
@@ -532,6 +535,7 @@ class TagController extends Controller
* @param Carbon $end
*
* @return string
+ * @throws FireflyException
*/
public function topIncome(Collection $accounts, Collection $tags, Carbon $start, Carbon $end)
{
diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php
index 9607e2e107..b3d0dd854a 100644
--- a/app/Http/Controllers/ReportController.php
+++ b/app/Http/Controllers/ReportController.php
@@ -265,7 +265,6 @@ class ReportController extends Controller
* @param AccountRepositoryInterface $repository
*
* @return Factory|View
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
@@ -309,7 +308,7 @@ class ReportController extends Controller
* @param string $reportType
*
* @return JsonResponse
- *
+ * @throws FireflyException
*/
public function options(string $reportType)
{
diff --git a/app/Http/Controllers/Rule/CreateController.php b/app/Http/Controllers/Rule/CreateController.php
index e74afa10d1..cd17de1fbc 100644
--- a/app/Http/Controllers/Rule/CreateController.php
+++ b/app/Http/Controllers/Rule/CreateController.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Rule;
+use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\RuleFormRequest;
use FireflyIII\Models\Bill;
@@ -77,6 +78,7 @@ class CreateController extends Controller
* @param RuleGroup|null $ruleGroup
*
* @return Factory|View
+ * @throws FireflyException
*/
public function create(Request $request, RuleGroup $ruleGroup = null)
{
@@ -139,6 +141,7 @@ class CreateController extends Controller
* @param Bill $bill
*
* @return Factory|View
+ * @throws FireflyException
*/
public function createFromBill(Request $request, Bill $bill)
{
@@ -190,6 +193,7 @@ class CreateController extends Controller
* @param TransactionJournal $journal
*
* @return Factory|\Illuminate\Contracts\View\View
+ * @throws FireflyException
*/
public function createFromJournal(Request $request, TransactionJournal $journal)
{
diff --git a/app/Http/Controllers/Rule/EditController.php b/app/Http/Controllers/Rule/EditController.php
index 5d397098e8..1e23675610 100644
--- a/app/Http/Controllers/Rule/EditController.php
+++ b/app/Http/Controllers/Rule/EditController.php
@@ -78,6 +78,7 @@ class EditController extends Controller
* @param Rule $rule
*
* @return Factory|View
+ * @throws FireflyException
*/
public function edit(Request $request, Rule $rule)
{
@@ -142,6 +143,7 @@ class EditController extends Controller
* @param array $submittedOperators
*
* @return array
+ * @throws FireflyException
*/
private function parseFromOperators(array $submittedOperators): array
{
diff --git a/app/Http/Controllers/Rule/SelectController.php b/app/Http/Controllers/Rule/SelectController.php
index 1b45902a31..bb4f130584 100644
--- a/app/Http/Controllers/Rule/SelectController.php
+++ b/app/Http/Controllers/Rule/SelectController.php
@@ -132,7 +132,7 @@ class SelectController extends Controller
* @param TestRuleFormRequest $request
*
* @return JsonResponse
- *
+ * @throws FireflyException
*/
public function testTriggers(TestRuleFormRequest $request): JsonResponse
{
@@ -194,7 +194,7 @@ class SelectController extends Controller
* @param Rule $rule
*
* @return JsonResponse
- *
+ * @throws FireflyException
*/
public function testTriggersByRule(Rule $rule): JsonResponse
{
diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php
index f8ce3ae7ed..2274d1bcd8 100644
--- a/app/Http/Controllers/SearchController.php
+++ b/app/Http/Controllers/SearchController.php
@@ -103,6 +103,7 @@ class SearchController extends Controller
* @param SearchInterface $searcher
*
* @return JsonResponse
+ * @throws FireflyException
*/
public function search(Request $request, SearchInterface $searcher): JsonResponse
{
diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php
index ce12403dc1..2307edc31e 100644
--- a/app/Http/Controllers/TagController.php
+++ b/app/Http/Controllers/TagController.php
@@ -280,7 +280,6 @@ class TagController extends Controller
* @param Tag $tag
*
* @return Factory|View
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Http/Controllers/Transaction/IndexController.php b/app/Http/Controllers/Transaction/IndexController.php
index 6a1bb0fa54..37516a313d 100644
--- a/app/Http/Controllers/Transaction/IndexController.php
+++ b/app/Http/Controllers/Transaction/IndexController.php
@@ -134,7 +134,6 @@ class IndexController extends Controller
* @param string $objectType
*
* @return Factory|View
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Http/Controllers/Webhooks/DeleteController.php b/app/Http/Controllers/Webhooks/DeleteController.php
index 4d2ba7627a..13a27c2442 100644
--- a/app/Http/Controllers/Webhooks/DeleteController.php
+++ b/app/Http/Controllers/Webhooks/DeleteController.php
@@ -62,7 +62,7 @@ class DeleteController extends Controller
*
* @param Webhook $webhook
*
- * @return Factory|RedirectResponse|Redirector|View
+ * @return Factory|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\View
*/
public function index(Webhook $webhook)
{
diff --git a/app/Http/Controllers/Webhooks/EditController.php b/app/Http/Controllers/Webhooks/EditController.php
index 76a89a23f1..d16948a934 100644
--- a/app/Http/Controllers/Webhooks/EditController.php
+++ b/app/Http/Controllers/Webhooks/EditController.php
@@ -61,7 +61,7 @@ class EditController extends Controller
*
* @param Webhook $webhook
*
- * @return Factory|RedirectResponse|Redirector|View
+ * @return Factory|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\View
*/
public function index(Webhook $webhook)
{
diff --git a/app/Http/Controllers/Webhooks/IndexController.php b/app/Http/Controllers/Webhooks/IndexController.php
index 30c1c414b5..00b54d87a0 100644
--- a/app/Http/Controllers/Webhooks/IndexController.php
+++ b/app/Http/Controllers/Webhooks/IndexController.php
@@ -59,7 +59,6 @@ class IndexController extends Controller
* @param Request $request
*
* @return Factory|View
- * @throws FireflyException
*/
public function index(Request $request)
{
diff --git a/app/Http/Controllers/Webhooks/ShowController.php b/app/Http/Controllers/Webhooks/ShowController.php
index 8954de784b..ad35c5ca20 100644
--- a/app/Http/Controllers/Webhooks/ShowController.php
+++ b/app/Http/Controllers/Webhooks/ShowController.php
@@ -61,7 +61,7 @@ class ShowController extends Controller
*
* @param Webhook $webhook
*
- * @return Factory|RedirectResponse|Redirector|View
+ * @return Factory|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\View
*/
public function index(Webhook $webhook)
{
diff --git a/app/Http/Requests/RecurrenceFormRequest.php b/app/Http/Requests/RecurrenceFormRequest.php
index 62c2450b67..fa531ded19 100644
--- a/app/Http/Requests/RecurrenceFormRequest.php
+++ b/app/Http/Requests/RecurrenceFormRequest.php
@@ -188,7 +188,6 @@ class RecurrenceFormRequest extends FormRequest
* The rules for this request.
*
* @return array
- * @throws FireflyException
*
*/
public function rules(): array
diff --git a/app/Jobs/DownloadExchangeRates.php b/app/Jobs/DownloadExchangeRates.php
index a2eb70c0a4..1cad14faa3 100644
--- a/app/Jobs/DownloadExchangeRates.php
+++ b/app/Jobs/DownloadExchangeRates.php
@@ -29,6 +29,7 @@ use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use GuzzleHttp\Client;
+use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
@@ -94,6 +95,7 @@ class DownloadExchangeRates implements ShouldQueue
/**
* @param TransactionCurrency $currency
* @return void
+ * @throws GuzzleException
*/
private function downloadRates(TransactionCurrency $currency): void
{
@@ -117,11 +119,6 @@ class DownloadExchangeRates implements ShouldQueue
$this->saveRates($currency, $date, $json['rates']);
}
- /**
- * @param TransactionCurrency $currency
- * @param array $rates
- * @return void
- */
private function saveRates(TransactionCurrency $currency, Carbon $date, array $rates): void
{
foreach ($rates as $code => $rate) {
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index 197bbbb31b..9377a149fc 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -261,6 +261,7 @@ class AccountRepository implements AccountRepositoryInterface
* @return Account
*
* @throws FireflyException
+ * @throws JsonException
*/
public function getCashAccount(): Account
{
diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php
index a7bbecf9e0..17891d2ba8 100644
--- a/app/Repositories/Account/AccountTasker.php
+++ b/app/Repositories/Account/AccountTasker.php
@@ -123,6 +123,8 @@ class AccountTasker implements AccountTaskerInterface
* @param Collection $accounts
*
* @return array
+ * @throws FireflyException
+ * @throws JsonException
*/
public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts): array
{
@@ -221,6 +223,8 @@ class AccountTasker implements AccountTaskerInterface
* @param Collection $accounts
*
* @return array
+ * @throws FireflyException
+ * @throws JsonException
*/
public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): array
{
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php
index af6557c773..d8855734cd 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -188,6 +188,7 @@ class BillRepository implements BillRepositoryInterface
*
* @return Bill
* @throws FireflyException
+ * @throws JsonException
*/
public function store(array $data): Bill
{
@@ -911,6 +912,8 @@ class BillRepository implements BillRepositoryInterface
* @param array $data
*
* @return Bill
+ * @throws FireflyException
+ * @throws JsonException
*/
public function update(Bill $bill, array $data): Bill
{
diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php
index dfd2fe936f..9e02398bfd 100644
--- a/app/Repositories/Budget/BudgetRepository.php
+++ b/app/Repositories/Budget/BudgetRepository.php
@@ -230,6 +230,8 @@ class BudgetRepository implements BudgetRepositoryInterface
* @param array $data
*
* @return Budget
+ * @throws FireflyException
+ * @throws JsonException
*/
public function update(Budget $budget, array $data): Budget
{
diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php
index 34ef2f921a..88f0a7c4dc 100644
--- a/app/Repositories/Budget/BudgetRepositoryInterface.php
+++ b/app/Repositories/Budget/BudgetRepositoryInterface.php
@@ -209,10 +209,7 @@ interface BudgetRepositoryInterface
/**
* Used in the v2 API to calculate the amount of money spent in a single budget..
*
- * @param Carbon $start
- * @param Carbon $end
*
- * @return array
*/
public function spentInPeriodForBudget(Budget $budget, Carbon $start, Carbon $end): array;
diff --git a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php
index 4f403150af..825ffe6324 100644
--- a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php
+++ b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php
@@ -42,12 +42,6 @@ trait ModifiesPiggyBanks
{
use CreatesObjectGroups;
- /**
- * @param PiggyBankRepetition $repetition
- * @param string $amount
- *
- * @return void
- */
public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount, TransactionJournal $journal): void
{
Log::debug(sprintf('addAmountToRepetition: %s', $amount));
@@ -61,12 +55,6 @@ trait ModifiesPiggyBanks
}
}
- /**
- * @param PiggyBank $piggyBank
- * @param string $amount
- *
- * @return bool
- */
public function removeAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool
{
$repetition = $this->getRepetition($piggyBank);
@@ -109,6 +97,7 @@ trait ModifiesPiggyBanks
* @param string $amount
*
* @return bool
+ * @throws \JsonException
*/
public function canAddAmount(PiggyBank $piggyBank, string $amount): bool
{
diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php
index c3e4640dcd..ac03d76fab 100644
--- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php
+++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php
@@ -45,10 +45,6 @@ interface PiggyBankRepositoryInterface
*/
public function addAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool;
- /**
- * @param PiggyBankRepetition $repetition
- * @param string $amount
- */
public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount, TransactionJournal $journal): void;
/**
diff --git a/app/Repositories/Tag/OperationsRepository.php b/app/Repositories/Tag/OperationsRepository.php
index 5100258fc1..5e09c262c3 100644
--- a/app/Repositories/Tag/OperationsRepository.php
+++ b/app/Repositories/Tag/OperationsRepository.php
@@ -53,6 +53,8 @@ class OperationsRepository implements OperationsRepositoryInterface
* @param Collection|null $tags
*
* @return array
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
public function listExpenses(Carbon $start, Carbon $end, ?Collection $accounts = null, ?Collection $tags = null): array
{
@@ -150,6 +152,8 @@ class OperationsRepository implements OperationsRepositoryInterface
* @param Collection|null $tags
*
* @return array
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
public function listIncome(Carbon $start, Carbon $end, ?Collection $accounts = null, ?Collection $tags = null): array
{
diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php
index 824601f25e..d305566060 100644
--- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php
+++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php
@@ -470,6 +470,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
* @return TransactionGroup
* @throws DuplicateTransactionException
* @throws FireflyException
+ * @throws JsonException
*/
public function store(array $data): TransactionGroup
{
@@ -495,6 +496,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
*
* @return TransactionGroup
*
+ * @throws DuplicateTransactionException
* @throws FireflyException
*/
public function update(TransactionGroup $transactionGroup, array $data): TransactionGroup
diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php
index 3f103dd549..a05b797a9b 100644
--- a/app/Services/Internal/Support/AccountServiceTrait.php
+++ b/app/Services/Internal/Support/AccountServiceTrait.php
@@ -218,6 +218,7 @@ trait AccountServiceTrait
*
* @return TransactionGroup
* @throws FireflyException
+ * @throws JsonException
* @deprecated
*/
protected function createOBGroup(Account $account, array $data): TransactionGroup
@@ -396,11 +397,7 @@ trait AccountServiceTrait
/**
* Create the opposing "credit liability" transaction for credit liabilities.
*
- * @param Account $account
- * @param string $openingBalance
- * @param Carbon $openingBalanceDate
*
- * @return TransactionGroup
* @throws FireflyException
*/
protected function updateCreditTransaction(Account $account, string $direction, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
@@ -462,6 +459,7 @@ trait AccountServiceTrait
*
* @return TransactionGroup
* @throws FireflyException
+ * @throws JsonException
*/
protected function createCreditTransaction(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{
@@ -674,6 +672,7 @@ trait AccountServiceTrait
*
* @return TransactionGroup
* @throws FireflyException
+ * @throws JsonException
*/
protected function createOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{
diff --git a/app/Services/Internal/Support/RecurringTransactionTrait.php b/app/Services/Internal/Support/RecurringTransactionTrait.php
index c4000a3b46..a8a0262083 100644
--- a/app/Services/Internal/Support/RecurringTransactionTrait.php
+++ b/app/Services/Internal/Support/RecurringTransactionTrait.php
@@ -186,6 +186,7 @@ trait RecurringTransactionTrait
* @param string|null $accountName
*
* @return Account
+ * @throws JsonException
*/
protected function findAccount(array $expectedTypes, ?int $accountId, ?string $accountName): Account
{
diff --git a/app/Services/Internal/Update/AccountUpdateService.php b/app/Services/Internal/Update/AccountUpdateService.php
index 9f76909779..a168a2d147 100644
--- a/app/Services/Internal/Update/AccountUpdateService.php
+++ b/app/Services/Internal/Update/AccountUpdateService.php
@@ -70,6 +70,7 @@ class AccountUpdateService
*
* @return Account
* @throws FireflyException
+ * @throws \JsonException
*/
public function update(Account $account, array $data): Account
{
diff --git a/app/Services/Internal/Update/GroupUpdateService.php b/app/Services/Internal/Update/GroupUpdateService.php
index 7eeb574321..cd16f6f828 100644
--- a/app/Services/Internal/Update/GroupUpdateService.php
+++ b/app/Services/Internal/Update/GroupUpdateService.php
@@ -141,6 +141,7 @@ class GroupUpdateService
* @return array
* @throws DuplicateTransactionException
* @throws FireflyException
+ * @throws JsonException
*/
private function updateTransactions(TransactionGroup $transactionGroup, array $transactions): array
{
diff --git a/app/Services/Internal/Update/RecurrenceUpdateService.php b/app/Services/Internal/Update/RecurrenceUpdateService.php
index ea6b8ce601..7febe5c3e1 100644
--- a/app/Services/Internal/Update/RecurrenceUpdateService.php
+++ b/app/Services/Internal/Update/RecurrenceUpdateService.php
@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Services\Internal\Update;
-use Exception;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Factory\TransactionCurrencyFactory;
use FireflyIII\Models\Note;
@@ -131,9 +130,7 @@ class RecurrenceUpdateService
return;
}
- if (null !== $dbNote && '' === $text) {
- $dbNote->delete();
- }
+ $dbNote?->delete();
}
/**
@@ -159,24 +156,22 @@ class RecurrenceUpdateService
return;
}
// loop all and try to match them:
- if ($originalCount === count($repetitions)) {
- Log::debug('Loop and find');
- foreach ($repetitions as $current) {
- $match = $this->matchRepetition($recurrence, $current);
- if (null === $match) {
- throw new FireflyException('Cannot match recurring repetition to existing repetition. Not sure what to do. Break.');
- }
- $fields = [
- 'type' => 'repetition_type',
- 'moment' => 'repetition_moment',
- 'skip' => 'repetition_skip',
- 'weekend' => 'weekend',
- ];
- foreach ($fields as $field => $column) {
- if (array_key_exists($field, $current)) {
- $match->$column = $current[$field];
- $match->save();
- }
+ Log::debug('Loop and find');
+ foreach ($repetitions as $current) {
+ $match = $this->matchRepetition($recurrence, $current);
+ if (null === $match) {
+ throw new FireflyException('Cannot match recurring repetition to existing repetition. Not sure what to do. Break.');
+ }
+ $fields = [
+ 'type' => 'repetition_type',
+ 'moment' => 'repetition_moment',
+ 'skip' => 'repetition_skip',
+ 'weekend' => 'weekend',
+ ];
+ foreach ($fields as $field => $column) {
+ if (array_key_exists($field, $current)) {
+ $match->$column = $current[$field];
+ $match->save();
}
}
}
@@ -211,7 +206,7 @@ class RecurrenceUpdateService
$query->where($column, $data[$field]);
}
}
-
+ /** @var RecurrenceRepetition|null */
return $query->first();
}
@@ -222,6 +217,7 @@ class RecurrenceUpdateService
* @param array $transactions
*
* @throws FireflyException
+ * @throws \JsonException
*/
private function updateTransactions(Recurrence $recurrence, array $transactions): void
{
@@ -241,77 +237,75 @@ class RecurrenceUpdateService
}
$currencyFactory = app(TransactionCurrencyFactory::class);
// loop all and try to match them:
- if ($originalCount === count($transactions)) {
- Log::debug(sprintf('Count is equal (%d), update transactions.', $originalCount));
- foreach ($transactions as $current) {
- $match = $this->matchTransaction($recurrence, $current);
- if (null === $match) {
- throw new FireflyException('Cannot match recurring transaction to existing transaction. Not sure what to do. Break.');
- }
- // complex loop to find currency:
- $currency = null;
- $foreignCurrency = null;
- if (array_key_exists('currency_id', $current) || array_key_exists('currency_code', $current)) {
- $currency = $currencyFactory->find($current['currency_id'] ?? null, $currency['currency_code'] ?? null);
- }
- if (null === $currency) {
- unset($current['currency_id'], $current['currency_code']);
- }
- if (null !== $currency) {
- $current['currency_id'] = (int)$currency->id;
- }
- if (array_key_exists('foreign_currency_id', $current) || array_key_exists('foreign_currency_code', $current)) {
- $foreignCurrency = $currencyFactory->find($current['foreign_currency_id'] ?? null, $currency['foreign_currency_code'] ?? null);
- }
- if (null === $foreignCurrency) {
- unset($current['foreign_currency_id'], $currency['foreign_currency_code']);
- }
- if (null !== $foreignCurrency) {
- $current['foreign_currency_id'] = (int)$foreignCurrency->id;
- }
+ Log::debug(sprintf('Count is equal (%d), update transactions.', $originalCount));
+ foreach ($transactions as $current) {
+ $match = $this->matchTransaction($recurrence, $current);
+ if (null === $match) {
+ throw new FireflyException('Cannot match recurring transaction to existing transaction. Not sure what to do. Break.');
+ }
+ // complex loop to find currency:
+ $currency = null;
+ $foreignCurrency = null;
+ if (array_key_exists('currency_id', $current) || array_key_exists('currency_code', $current)) {
+ $currency = $currencyFactory->find($current['currency_id'] ?? null, $currency['currency_code'] ?? null);
+ }
+ if (null === $currency) {
+ unset($current['currency_id'], $current['currency_code']);
+ }
+ if (null !== $currency) {
+ $current['currency_id'] = (int)$currency->id;
+ }
+ if (array_key_exists('foreign_currency_id', $current) || array_key_exists('foreign_currency_code', $current)) {
+ $foreignCurrency = $currencyFactory->find($current['foreign_currency_id'] ?? null, $currency['foreign_currency_code'] ?? null);
+ }
+ if (null === $foreignCurrency) {
+ unset($current['foreign_currency_id'], $currency['foreign_currency_code']);
+ }
+ if (null !== $foreignCurrency) {
+ $current['foreign_currency_id'] = (int)$foreignCurrency->id;
+ }
- // update fields that are part of the recurring transaction itself.
- $fields = [
- 'source_id' => 'source_id',
- 'destination_id' => 'destination_id',
- 'amount' => 'amount',
- 'foreign_amount' => 'foreign_amount',
- 'description' => 'description',
- 'currency_id' => 'transaction_currency_id',
- 'foreign_currency_id' => 'foreign_currency_id',
- ];
- foreach ($fields as $field => $column) {
- if (array_key_exists($field, $current)) {
- $match->$column = $current[$field];
- $match->save();
- }
- }
- // update meta data
- if (array_key_exists('budget_id', $current)) {
- $this->setBudget($match, (int)$current['budget_id']);
- }
- if (array_key_exists('bill_id', $current)) {
- $this->setBill($match, (int)$current['bill_id']);
- }
- // reset category if name is set but empty:
- // can be removed when v1 is retired.
- if (array_key_exists('category_name', $current) && '' === (string)$current['category_name']) {
- Log::debug('Category name is submitted but is empty. Set category to be empty.');
- $current['category_name'] = null;
- $current['category_id'] = 0;
+ // update fields that are part of the recurring transaction itself.
+ $fields = [
+ 'source_id' => 'source_id',
+ 'destination_id' => 'destination_id',
+ 'amount' => 'amount',
+ 'foreign_amount' => 'foreign_amount',
+ 'description' => 'description',
+ 'currency_id' => 'transaction_currency_id',
+ 'foreign_currency_id' => 'foreign_currency_id',
+ ];
+ foreach ($fields as $field => $column) {
+ if (array_key_exists($field, $current)) {
+ $match->$column = $current[$field];
+ $match->save();
}
+ }
+ // update meta data
+ if (array_key_exists('budget_id', $current)) {
+ $this->setBudget($match, (int)$current['budget_id']);
+ }
+ if (array_key_exists('bill_id', $current)) {
+ $this->setBill($match, (int)$current['bill_id']);
+ }
+ // reset category if name is set but empty:
+ // can be removed when v1 is retired.
+ if (array_key_exists('category_name', $current) && '' === (string)$current['category_name']) {
+ Log::debug('Category name is submitted but is empty. Set category to be empty.');
+ $current['category_name'] = null;
+ $current['category_id'] = 0;
+ }
- if (array_key_exists('category_id', $current)) {
- Log::debug(sprintf('Category ID is submitted, set category to be %d.', (int)$current['category_id']));
- $this->setCategory($match, (int)$current['category_id']);
- }
+ if (array_key_exists('category_id', $current)) {
+ Log::debug(sprintf('Category ID is submitted, set category to be %d.', (int)$current['category_id']));
+ $this->setCategory($match, (int)$current['category_id']);
+ }
- if (array_key_exists('tags', $current) && is_array($current['tags'])) {
- $this->updateTags($match, $current['tags']);
- }
- if (array_key_exists('piggy_bank_id', $current)) {
- $this->updatePiggyBank($match, (int)$current['piggy_bank_id']);
- }
+ if (array_key_exists('tags', $current) && is_array($current['tags'])) {
+ $this->updateTags($match, $current['tags']);
+ }
+ if (array_key_exists('piggy_bank_id', $current)) {
+ $this->updatePiggyBank($match, (int)$current['piggy_bank_id']);
}
}
}
@@ -328,7 +322,7 @@ class RecurrenceUpdateService
$originalCount = $recurrence->recurrenceTransactions()->count();
if (1 === $originalCount) {
Log::debug('Return the first one.');
-
+ /** @var RecurrenceTransaction|null */
return $recurrence->recurrenceTransactions()->first();
}
// find it based on data
@@ -348,7 +342,7 @@ class RecurrenceUpdateService
$query->where($column, $data[$field]);
}
}
-
+ /** @var RecurrenceTransaction|null */
return $query->first();
}
}
diff --git a/app/Support/Amount.php b/app/Support/Amount.php
index bc03801de9..43d0556d64 100644
--- a/app/Support/Amount.php
+++ b/app/Support/Amount.php
@@ -49,7 +49,7 @@ class Amount
* @param bool $coloured
*
* @return string
- *
+ * @throws FireflyException
*/
public function formatAnything(TransactionCurrency $format, string $amount, bool $coloured = null): string
{
@@ -204,6 +204,7 @@ class Amount
* Used only in one place.
*
* @return array
+ * @throws FireflyException
*/
public function getJsConfig(): array
{
diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php
index 5f9bb6b1b7..3df4ed6f02 100644
--- a/app/Support/Authentication/RemoteUserGuard.php
+++ b/app/Support/Authentication/RemoteUserGuard.php
@@ -32,6 +32,8 @@ use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Http\Request;
use Log;
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\NotFoundExceptionInterface;
/**
* Class RemoteUserGuard
@@ -47,6 +49,8 @@ class RemoteUserGuard implements Guard
*
* @param UserProvider $provider
* @param Application $app
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
public function __construct(UserProvider $provider, Application $app)
{
diff --git a/app/Support/Chart/Budget/FrontpageChartGenerator.php b/app/Support/Chart/Budget/FrontpageChartGenerator.php
index 92f5fff561..d1873f1e52 100644
--- a/app/Support/Chart/Budget/FrontpageChartGenerator.php
+++ b/app/Support/Chart/Budget/FrontpageChartGenerator.php
@@ -221,7 +221,6 @@ class FrontpageChartGenerator
* A basic setter for the user. Also updates the repositories with the right user.
*
* @param User $user
- * @throws FireflyException
*/
public function setUser(User $user): void
{
diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php
index b7cc425beb..6c361b920d 100644
--- a/app/Support/ExpandedForm.php
+++ b/app/Support/ExpandedForm.php
@@ -48,6 +48,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function amountNoCurrency(string $name, $value = null, array $options = null): string
{
@@ -81,6 +82,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function checkbox(string $name, int $value = null, $checked = null, array $options = null): string
{
@@ -116,6 +118,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function date(string $name, $value = null, array $options = null): string
{
@@ -140,6 +143,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function file(string $name, array $options = null): string
{
@@ -164,6 +168,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function integer(string $name, $value = null, array $options = null): string
{
@@ -190,6 +195,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function location(string $name, $value = null, array $options = null): string
{
@@ -243,6 +249,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function nonSelectableAmount(string $name, $value = null, array $options = null): string
{
@@ -275,6 +282,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function number(string $name, $value = null, array $options = null): string
{
@@ -300,6 +308,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function objectGroup($value = null, array $options = null): string
{
@@ -330,7 +339,7 @@ class ExpandedForm
* @param string $name
*
* @return string
- *
+ * @throws FireflyException
*/
public function optionsList(string $type, string $name): string
{
@@ -350,6 +359,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function password(string $name, array $options = null): string
{
@@ -375,6 +385,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function percentage(string $name, $value = null, array $options = null): string
{
@@ -401,6 +412,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function staticText(string $name, $value, array $options = null): string
{
@@ -424,6 +436,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function text(string $name, $value = null, array $options = null): string
{
@@ -448,6 +461,7 @@ class ExpandedForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function textarea(string $name, $value = null, array $options = null): string
{
diff --git a/app/Support/Export/ExportDataGenerator.php b/app/Support/Export/ExportDataGenerator.php
index a8b11f1552..4851e2d3b0 100644
--- a/app/Support/Export/ExportDataGenerator.php
+++ b/app/Support/Export/ExportDataGenerator.php
@@ -102,7 +102,9 @@ class ExportDataGenerator
/**
* @return array
+ * @throws ContainerExceptionInterface
* @throws FireflyException
+ * @throws NotFoundExceptionInterface
*/
public function export(): array
{
diff --git a/app/Support/Form/AccountForm.php b/app/Support/Form/AccountForm.php
index 31b02dcb93..2e244dc812 100644
--- a/app/Support/Form/AccountForm.php
+++ b/app/Support/Form/AccountForm.php
@@ -122,6 +122,7 @@ class AccountForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function assetAccountCheckList(string $name, array $options = null): string
{
diff --git a/app/Support/Form/CurrencyForm.php b/app/Support/Form/CurrencyForm.php
index 6f07c77fd5..56e95cc055 100644
--- a/app/Support/Form/CurrencyForm.php
+++ b/app/Support/Form/CurrencyForm.php
@@ -46,6 +46,7 @@ class CurrencyForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function amount(string $name, $value = null, array $options = null): string
{
@@ -59,6 +60,7 @@ class CurrencyForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
protected function currencyField(string $name, string $view, mixed $value = null, array $options = null): string
{
@@ -114,6 +116,7 @@ class CurrencyForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
public function balanceAll(string $name, $value = null, array $options = null): string
{
@@ -129,6 +132,7 @@ class CurrencyForm
* @param array|null $options
*
* @return string
+ * @throws FireflyException
*/
protected function allCurrencyField(string $name, string $view, $value = null, array $options = null): string
{
diff --git a/app/Support/Http/Api/ConvertsExchangeRates.php b/app/Support/Http/Api/ConvertsExchangeRates.php
index b953c37e9b..f5bd614ada 100644
--- a/app/Support/Http/Api/ConvertsExchangeRates.php
+++ b/app/Support/Http/Api/ConvertsExchangeRates.php
@@ -149,12 +149,6 @@ trait ConvertsExchangeRates
return $result;
}
- /**
- * @param string $amount
- * @param TransactionCurrency $from
- * @param TransactionCurrency $to
- * @return string
- */
private function convertAmount(string $amount, TransactionCurrency $from, TransactionCurrency $to, ?Carbon $date = null): string
{
Log::debug(sprintf('Converting %s from %s to %s', $amount, $from->code, $to->code));
diff --git a/app/Support/Http/Controllers/CronRunner.php b/app/Support/Http/Controllers/CronRunner.php
index db119cab87..fe43ad27d6 100644
--- a/app/Support/Http/Controllers/CronRunner.php
+++ b/app/Support/Http/Controllers/CronRunner.php
@@ -27,6 +27,8 @@ use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Support\Cronjobs\AutoBudgetCronjob;
use FireflyIII\Support\Cronjobs\RecurringCronjob;
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\NotFoundExceptionInterface;
/**
* Trait CronRunner
@@ -69,6 +71,8 @@ trait CronRunner
* @param Carbon $date
*
* @return array
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
protected function runRecurring(bool $force, Carbon $date): array
{
diff --git a/app/Support/Http/Controllers/ModelInformation.php b/app/Support/Http/Controllers/ModelInformation.php
index 745180da4e..4c82189631 100644
--- a/app/Support/Http/Controllers/ModelInformation.php
+++ b/app/Support/Http/Controllers/ModelInformation.php
@@ -45,6 +45,7 @@ trait ModelInformation
* @param Bill $bill
*
* @return array
+ * @throws FireflyException
*/
protected function getActionsForBill(Bill $bill): array // get info and augument
{
@@ -113,6 +114,7 @@ trait ModelInformation
* @param Bill $bill
*
* @return array
+ * @throws FireflyException
*/
protected function getTriggersForBill(Bill $bill): array // get info and augument
{
@@ -164,6 +166,7 @@ trait ModelInformation
* @param TransactionJournal $journal
*
* @return array
+ * @throws FireflyException
*/
private function getTriggersForJournal(TransactionJournal $journal): array
{
diff --git a/app/Support/Http/Controllers/RenderPartialViews.php b/app/Support/Http/Controllers/RenderPartialViews.php
index 026bffd204..568af28212 100644
--- a/app/Support/Http/Controllers/RenderPartialViews.php
+++ b/app/Support/Http/Controllers/RenderPartialViews.php
@@ -51,6 +51,7 @@ trait RenderPartialViews
* @param array $attributes
*
* @return string
+ * @throws FireflyException
*/
protected function budgetEntry(array $attributes): string // generate view for report.
{
@@ -81,6 +82,7 @@ trait RenderPartialViews
* Get options for budget report.
*
* @return string
+ * @throws FireflyException
*/
protected function budgetReportOptions(): string // render a view
{
@@ -105,6 +107,7 @@ trait RenderPartialViews
* @param array $attributes
*
* @return string
+ * @throws FireflyException
*/
protected function budgetSpentAmount(array $attributes): string // generate view for report.
{
@@ -137,6 +140,7 @@ trait RenderPartialViews
* @param array $attributes
*
* @return string
+ * @throws FireflyException
*/
protected function categoryEntry(array $attributes): string // generate view for report.
{
@@ -163,6 +167,7 @@ trait RenderPartialViews
* Get options for category report.
*
* @return string
+ * @throws FireflyException
*/
protected function categoryReportOptions(): string // render a view
{
@@ -185,6 +190,7 @@ trait RenderPartialViews
* Get options for double report.
*
* @return string
+ * @throws FireflyException
*/
protected function doubleReportOptions(): string // render a view
{
@@ -229,6 +235,7 @@ trait RenderPartialViews
* @param array $attributes
*
* @return string
+ * @throws FireflyException
*/
protected function expenseEntry(array $attributes): string // generate view for report.
{
@@ -263,6 +270,7 @@ trait RenderPartialViews
* @param Rule $rule
*
* @return array
+ * @throws FireflyException
*/
protected function getCurrentActions(Rule $rule): array // get info from object and present.
{
@@ -301,7 +309,7 @@ trait RenderPartialViews
* @param Rule $rule
*
* @return array
- *
+ * @throws FireflyException
*/
protected function getCurrentTriggers(Rule $rule): array // get info from object and present.
{
@@ -357,6 +365,7 @@ trait RenderPartialViews
* @param array $attributes
*
* @return string
+ * @throws FireflyException
*/
protected function incomeEntry(array $attributes): string // generate view for report.
{
@@ -388,6 +397,7 @@ trait RenderPartialViews
* Get options for default report.
*
* @return string
+ * @throws FireflyException
*/
protected function noReportOptions(): string // render a view
{
@@ -406,6 +416,7 @@ trait RenderPartialViews
* Get options for tag report.
*
* @return string
+ * @throws FireflyException
*/
protected function tagReportOptions(): string // render a view
{
diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.php
index ecab47278b..5e7059e06a 100644
--- a/app/Support/Http/Controllers/RequestInformation.php
+++ b/app/Support/Http/Controllers/RequestInformation.php
@@ -89,7 +89,6 @@ trait RequestInformation
* Returns if user has seen demo.
*
* @return bool
- * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
diff --git a/app/Support/Http/Controllers/RuleManagement.php b/app/Support/Http/Controllers/RuleManagement.php
index 77dacdaab7..42865ab1ce 100644
--- a/app/Support/Http/Controllers/RuleManagement.php
+++ b/app/Support/Http/Controllers/RuleManagement.php
@@ -40,7 +40,7 @@ trait RuleManagement
* @param Request $request
*
* @return array
-
+ * @throws FireflyException
*/
protected function getPreviousActions(Request $request): array
{
@@ -75,7 +75,7 @@ trait RuleManagement
* @param Request $request
*
* @return array
-
+ * @throws FireflyException
*/
protected function getPreviousTriggers(Request $request): array
{
@@ -122,6 +122,7 @@ trait RuleManagement
* @param array $submittedOperators
*
* @return array
+ * @throws FireflyException
*/
protected function parseFromOperators(array $submittedOperators): array
{
diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php
index 0f46c420f5..4f99f8000a 100644
--- a/app/Support/Navigation.php
+++ b/app/Support/Navigation.php
@@ -27,6 +27,8 @@ use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use Log;
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\NotFoundExceptionInterface;
/**
* Class Navigation.
@@ -433,6 +435,8 @@ class Navigation
* range to a normal range.
* @param bool $correct
* @return string
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
public function getViewRange(bool $correct): string
{
@@ -465,7 +469,6 @@ class Navigation
* @param Carbon $end
*
* @return string
- * @throws FireflyException
*/
public function preferredCarbonLocalizedFormat(Carbon $start, Carbon $end): string
{
diff --git a/app/Support/ParseDateString.php b/app/Support/ParseDateString.php
index a2b5f05762..d85fde5830 100644
--- a/app/Support/ParseDateString.php
+++ b/app/Support/ParseDateString.php
@@ -88,7 +88,7 @@ class ParseDateString
}
// if regex for YYYY-MM-DD:
- $pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/';
+ $pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12]\d|3[01])$/';
if (preg_match($pattern, $date)) {
return $this->parseDefaultDate($date);
}
@@ -101,7 +101,7 @@ class ParseDateString
throw new FireflyException(sprintf('[a] Not a recognised date format: "%s"', $date));
}
// can't do a partial year:
- $substrCount = substr_count(substr($date, 0, 4), 'x', 0);
+ $substrCount = substr_count(substr($date, 0, 4), 'x');
if (10 === strlen($date) && $substrCount > 0 && $substrCount < 4) {
throw new FireflyException(sprintf('[b] Not a recognised date format: "%s"', $date));
}
@@ -254,7 +254,7 @@ class ParseDateString
protected function isDayRange(string $date): bool
{
// if regex for xxxx-xx-DD:
- $pattern = '/^xxxx-xx-(0[1-9]|[12][\d]|3[01])$/';
+ $pattern = '/^xxxx-xx-(0[1-9]|[12]\d|3[01])$/';
if (preg_match($pattern, $date)) {
Log::debug(sprintf('"%s" is a day range.', $date));
@@ -361,7 +361,7 @@ class ParseDateString
protected function isMonthDayRange(string $date): bool
{
// if regex for xxxx-MM-DD:
- $pattern = '/^xxxx-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/';
+ $pattern = '/^xxxx-(0[1-9]|1[012])-(0[1-9]|[12]\d|3[01])$/';
if (preg_match($pattern, $date)) {
Log::debug(sprintf('"%s" is a month/day range.', $date));
@@ -398,7 +398,7 @@ class ParseDateString
protected function isDayYearRange(string $date): bool
{
// if regex for YYYY-xx-DD:
- $pattern = '/^(19|20)\d\d-xx-(0[1-9]|[12][\d]|3[01])$/';
+ $pattern = '/^(19|20)\d\d-xx-(0[1-9]|[12]\d|3[01])$/';
if (preg_match($pattern, $date)) {
Log::debug(sprintf('"%s" is a day/year range.', $date));
diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php
index b28c09f2f6..fdbac099b4 100644
--- a/app/Support/Search/OperatorQuerySearch.php
+++ b/app/Support/Search/OperatorQuerySearch.php
@@ -241,10 +241,7 @@ class OperatorQuerySearch implements SearchInterface
}
/**
- * @param string $operator
- * @param string $value
*
- * @return bool
* @throws FireflyException
*/
private function updateCollector(string $operator, string $value, bool $prohibited): bool
@@ -1568,7 +1565,6 @@ class OperatorQuerySearch implements SearchInterface
}
/**
- * @param array $range
*
* @throws FireflyException
*/
@@ -1627,7 +1623,6 @@ class OperatorQuerySearch implements SearchInterface
}
/**
- * @param array $range
*
* @throws FireflyException
*/
@@ -1666,7 +1661,6 @@ class OperatorQuerySearch implements SearchInterface
}
/**
- * @param array $range
*
* @throws FireflyException
*/
@@ -1705,9 +1699,6 @@ class OperatorQuerySearch implements SearchInterface
}
/**
- * @param string $field
- * @param array $range
- * @return void
* @throws FireflyException
*/
private function setExactMetaDateParams(string $field, array $range, bool $prohibited = false): void
@@ -1767,9 +1758,6 @@ class OperatorQuerySearch implements SearchInterface
}
/**
- * @param string $field
- * @param array $range
- * @return void
* @throws FireflyException
*/
private function setMetaDateBeforeParams(string $field, array $range, bool $prohibited = false): void
@@ -1807,9 +1795,6 @@ class OperatorQuerySearch implements SearchInterface
}
/**
- * @param string $field
- * @param array $range
- * @return void
* @throws FireflyException
*/
private function setMetaDateAfterParams(string $field, array $range, bool $prohibited = false): void
@@ -1847,9 +1832,6 @@ class OperatorQuerySearch implements SearchInterface
}
/**
- * @param string $field
- * @param array $range
- * @return void
* @throws FireflyException
*/
private function setExactObjectDateParams(string $field, array $range, bool $prohibited = false): void
@@ -1908,8 +1890,6 @@ class OperatorQuerySearch implements SearchInterface
}
/**
- * @param string $field
- * @param array $range
*
* @throws FireflyException
*/
@@ -1948,8 +1928,6 @@ class OperatorQuerySearch implements SearchInterface
}
/**
- * @param string $field
- * @param array $range
*
* @throws FireflyException
*/
diff --git a/app/Support/Steam.php b/app/Support/Steam.php
index 18f9897f1c..445a9f675e 100644
--- a/app/Support/Steam.php
+++ b/app/Support/Steam.php
@@ -245,6 +245,7 @@ class Steam
* @param Carbon $date
*
* @return array
+ * @throws FireflyException
*/
public function balancesByAccounts(Collection $accounts, Carbon $date): array
{
@@ -277,7 +278,6 @@ class Steam
* @param Carbon $date
*
* @return array
- * @throws JsonException
*/
public function balancesPerCurrencyByAccounts(Collection $accounts, Carbon $date): array
{
diff --git a/app/TransactionRules/Actions/ConvertToDeposit.php b/app/TransactionRules/Actions/ConvertToDeposit.php
index ce9a74a7f8..4bd3cc8f5b 100644
--- a/app/TransactionRules/Actions/ConvertToDeposit.php
+++ b/app/TransactionRules/Actions/ConvertToDeposit.php
@@ -98,6 +98,7 @@ class ConvertToDeposit implements ActionInterface
*
* @return bool
* @throws FireflyException
+ * @throws \JsonException
*/
private function convertWithdrawalArray(array $journal): bool
{
@@ -146,6 +147,7 @@ class ConvertToDeposit implements ActionInterface
*
* @return bool
* @throws FireflyException
+ * @throws \JsonException
*/
private function convertTransferArray(array $journal): bool
{
diff --git a/app/TransactionRules/Actions/ConvertToWithdrawal.php b/app/TransactionRules/Actions/ConvertToWithdrawal.php
index 447682cfbe..09242f2aeb 100644
--- a/app/TransactionRules/Actions/ConvertToWithdrawal.php
+++ b/app/TransactionRules/Actions/ConvertToWithdrawal.php
@@ -131,6 +131,7 @@ class ConvertToWithdrawal implements ActionInterface
*
* @return bool
* @throws FireflyException
+ * @throws \JsonException
*/
private function convertTransferArray(array $journal): bool
{
diff --git a/app/TransactionRules/Engine/SearchRuleEngine.php b/app/TransactionRules/Engine/SearchRuleEngine.php
index 756716ce82..f12e775102 100644
--- a/app/TransactionRules/Engine/SearchRuleEngine.php
+++ b/app/TransactionRules/Engine/SearchRuleEngine.php
@@ -98,7 +98,6 @@ class SearchRuleEngine implements RuleEngineInterface
Log::debug(sprintf('Now in findStrictRule(#%d)', $rule->id ?? 0));
$searchArray = [];
- /** @var Collection $triggers */
$triggers = $rule->ruleTriggers()->orderBy('order', 'ASC')->get();
/** @var RuleTrigger $ruleTrigger */
diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php
index 31b507ef13..e38431e09a 100644
--- a/app/Transformers/AccountTransformer.php
+++ b/app/Transformers/AccountTransformer.php
@@ -55,6 +55,7 @@ class AccountTransformer extends AbstractTransformer
* @param Account $account
*
* @return array
+ * @throws FireflyException
* @throws JsonException
*/
public function transform(Account $account): array
diff --git a/app/User.php b/app/User.php
index cc8878c38f..bc026b4166 100644
--- a/app/User.php
+++ b/app/User.php
@@ -69,6 +69,8 @@ use Illuminate\Support\Str;
use Laravel\Passport\Client;
use Laravel\Passport\HasApiTokens;
use Laravel\Passport\Token;
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\NotFoundExceptionInterface;
use Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -477,6 +479,8 @@ class User extends Authenticatable
*
* @param Notification $notification
* @return string
+ * @throws ContainerExceptionInterface
+ * @throws NotFoundExceptionInterface
*/
public function routeNotificationForSlack(Notification $notification): string
{
diff --git a/app/Validation/Administration/ValidatesAdministrationAccess.php b/app/Validation/Administration/ValidatesAdministrationAccess.php
index ee3a4ae0e8..9676f775fa 100644
--- a/app/Validation/Administration/ValidatesAdministrationAccess.php
+++ b/app/Validation/Administration/ValidatesAdministrationAccess.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Validation\Administration;
+use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\UserRole;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\User;
@@ -40,6 +41,7 @@ trait ValidatesAdministrationAccess
* @param array $allowedRoles
* @return void
* @throws AuthenticationException
+ * @throws FireflyException
*/
protected function validateAdministration(Validator $validator, array $allowedRoles): void
{
diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php
index 6660dde595..5775193e46 100644
--- a/routes/breadcrumbs.php
+++ b/routes/breadcrumbs.php
@@ -299,7 +299,7 @@ try {
$object = $attachment->attachable;
if ($object instanceof TransactionJournal) {
$group = $object->transactionGroup;
- if (null !== $group && $group instanceof TransactionGroup) {
+ if ($group instanceof TransactionGroup) {
$breadcrumbs->parent('transactions.show', $object->transactionGroup);
}
}
@@ -1108,7 +1108,7 @@ try {
$first = $group->transactionJournals()->first();
$breadcrumbs->push(
- trans('breadcrumbs.edit_journal', ['description' => limitStringLength((string)$first->description)]),
+ trans('breadcrumbs.edit_journal', ['description' => limitStringLength($first->description)]),
route('transactions.edit', [$group->id])
);
}