Skip to content

Firefly III: a personal finances manager

Remove JSON exceptions that are not thrown anyway.

James Cole58dea55d3808
diff --git a/app/Api/V1/Controllers/Autocomplete/AccountController.php b/app/Api/V1/Controllers/Autocomplete/AccountController.php
index 1e52129e96..ac8713169e 100644
--- a/app/Api/V1/Controllers/Autocomplete/AccountController.php
+++ b/app/Api/V1/Controllers/Autocomplete/AccountController.php
@@ -67,7 +67,6 @@ class AccountController extends Controller
* Documentation for this endpoint:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getAccountsAC
*
- * @throws \JsonException
* @throws FireflyException
* @throws FireflyException
*/
diff --git a/app/Api/V1/Controllers/Chart/AccountController.php b/app/Api/V1/Controllers/Chart/AccountController.php
index 498a717685..0b4847d255 100644
--- a/app/Api/V1/Controllers/Chart/AccountController.php
+++ b/app/Api/V1/Controllers/Chart/AccountController.php
@@ -70,8 +70,7 @@ class AccountController extends Controller
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/charts/getChartAccountOverview
*
* @throws FireflyException
- * @throws \JsonException
- * @throws ContainerExceptionInterface
+ * * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function overview(DateRequest $request): JsonResponse
diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php
index 33fa2d9426..7ac5cb9fbb 100644
--- a/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php
+++ b/app/Api/V1/Controllers/Models/TransactionCurrency/ShowController.php
@@ -71,8 +71,7 @@ class ShowController extends Controller
* Display a listing of the resource.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function index(): JsonResponse
{
$pageSize = $this->parameters->get('limit');
@@ -102,8 +101,7 @@ class ShowController extends Controller
* Show a currency.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function show(TransactionCurrency $currency): JsonResponse
{
/** @var User $user */
@@ -131,8 +129,7 @@ class ShowController extends Controller
* Show a currency.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function showDefault(): JsonResponse
{
/** @var User $user */
diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php
index 003c64f854..b2d8b6f2c4 100644
--- a/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php
+++ b/app/Api/V1/Controllers/Models/TransactionCurrency/StoreController.php
@@ -68,8 +68,7 @@ class StoreController extends Controller
* Store new currency.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function store(StoreRequest $request): JsonResponse
{
$currency = $this->repository->store($request->getAll());
diff --git a/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php b/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php
index 3e365ea3c8..c05d307131 100644
--- a/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php
+++ b/app/Api/V1/Controllers/Models/TransactionCurrency/UpdateController.php
@@ -69,8 +69,7 @@ class UpdateController extends Controller
* Disable a currency.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function disable(TransactionCurrency $currency): JsonResponse
{
// must be unused.
@@ -134,8 +133,7 @@ class UpdateController extends Controller
* Enable a currency.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function enable(TransactionCurrency $currency): JsonResponse
{
$this->repository->enable($currency);
@@ -162,8 +160,7 @@ class UpdateController extends Controller
* Update a currency.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function update(UpdateRequest $request, TransactionCurrency $currency): JsonResponse
{
$data = $request->getAll();
diff --git a/app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php b/app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php
index 84887a0fa1..5c68e458af 100644
--- a/app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php
+++ b/app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php
@@ -49,8 +49,7 @@ class MigrateRecurrenceMeta extends Command
* Execute the console command.
*
* @throws ContainerExceptionInterface
- * @throws \JsonException
- * @throws NotFoundExceptionInterface
+ * * @throws NotFoundExceptionInterface
*/
public function handle(): int
{
@@ -88,8 +87,7 @@ class MigrateRecurrenceMeta extends Command
}
/**
- * @throws \JsonException
- */
+ * */
private function migrateMetaData(): int
{
$count = 0;
@@ -105,8 +103,7 @@ class MigrateRecurrenceMeta extends Command
}
/**
- * @throws \JsonException
- */
+ * */
private function migrateEntry(RecurrenceMeta $meta): int
{
/** @var null|Recurrence $recurrence */
diff --git a/app/Factory/AccountFactory.php b/app/Factory/AccountFactory.php
index 150b1cd3ff..ef3822ae7c 100644
--- a/app/Factory/AccountFactory.php
+++ b/app/Factory/AccountFactory.php
@@ -68,8 +68,7 @@ class AccountFactory
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function findOrCreate(string $accountName, string $accountType): Account
{
app('log')->debug(sprintf('findOrCreate("%s", "%s")', $accountName, $accountType));
@@ -101,8 +100,7 @@ class AccountFactory
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function create(array $data): Account
{
app('log')->debug('Now in AccountFactory::create()');
@@ -173,8 +171,7 @@ class AccountFactory
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function createAccount(AccountType $type, array $data): Account
{
$this->accountRepository->resetAccountOrder();
@@ -242,8 +239,7 @@ class AccountFactory
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function cleanMetaDataArray(Account $account, array $data): array
{
$currencyId = array_key_exists('currency_id', $data) ? (int)$data['currency_id'] : 0;
diff --git a/app/Factory/BillFactory.php b/app/Factory/BillFactory.php
index e84e120a3c..88d703d204 100644
--- a/app/Factory/BillFactory.php
+++ b/app/Factory/BillFactory.php
@@ -43,8 +43,7 @@ class BillFactory
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function create(array $data): ?Bill
{
app('log')->debug(sprintf('Now in %s', __METHOD__), $data);
diff --git a/app/Factory/RecurrenceFactory.php b/app/Factory/RecurrenceFactory.php
index 1458326be2..fe504f8b7c 100644
--- a/app/Factory/RecurrenceFactory.php
+++ b/app/Factory/RecurrenceFactory.php
@@ -52,8 +52,7 @@ class RecurrenceFactory
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function create(array $data): Recurrence
{
try {
diff --git a/app/Factory/TransactionGroupFactory.php b/app/Factory/TransactionGroupFactory.php
index 328cbf04c8..2231252604 100644
--- a/app/Factory/TransactionGroupFactory.php
+++ b/app/Factory/TransactionGroupFactory.php
@@ -49,8 +49,7 @@ class TransactionGroupFactory
*
* @throws DuplicateTransactionException
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function create(array $data): TransactionGroup
{
app('log')->debug('Now in TransactionGroupFactory::create()');
diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php
index 00bbb6b616..aa7bf6373c 100644
--- a/app/Factory/TransactionJournalFactory.php
+++ b/app/Factory/TransactionJournalFactory.php
@@ -91,8 +91,7 @@ class TransactionJournalFactory
*
* @throws DuplicateTransactionException
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function create(array $data): Collection
{
app('log')->debug('Now in TransactionJournalFactory::create()');
@@ -185,8 +184,7 @@ class TransactionJournalFactory
/**
* @throws DuplicateTransactionException
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function createJournal(NullArrayObject $row): ?TransactionJournal
{
$row['import_hash_v2'] = $this->hashArray($row);
@@ -346,8 +344,7 @@ class TransactionJournalFactory
}
/**
- * @throws \JsonException
- */
+ * */
private function hashArray(NullArrayObject $row): string
{
$dataRow = $row->getArrayCopy();
@@ -364,8 +361,7 @@ class TransactionJournalFactory
* If this transaction already exists, throw an error.
*
* @throws DuplicateTransactionException
- * @throws \JsonException
- */
+ * */
private function errorIfDuplicate(string $hash): void
{
app('log')->debug(sprintf('In errorIfDuplicate(%s)', $hash));
@@ -463,8 +459,7 @@ class TransactionJournalFactory
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function getCurrencyByAccount(string $type, ?TransactionCurrency $currency, Account $source, Account $destination): TransactionCurrency
{
app('log')->debug('Now in getCurrencyByAccount()');
@@ -477,8 +472,7 @@ class TransactionJournalFactory
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function getCurrency(?TransactionCurrency $currency, Account $account): TransactionCurrency
{
app('log')->debug('Now in getCurrency()');
@@ -512,8 +506,7 @@ class TransactionJournalFactory
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function getForeignByAccount(string $type, ?TransactionCurrency $foreignCurrency, Account $destination): ?TransactionCurrency
{
if (TransactionType::TRANSFER === $type) {
diff --git a/app/Generator/Report/Audit/MonthReportGenerator.php b/app/Generator/Report/Audit/MonthReportGenerator.php
index 60c84a9ef3..6420434707 100644
--- a/app/Generator/Report/Audit/MonthReportGenerator.php
+++ b/app/Generator/Report/Audit/MonthReportGenerator.php
@@ -45,8 +45,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
* Generates the report.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function generate(): string
{
$auditData = [];
@@ -111,8 +110,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
* Get the audit report.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function getAuditReport(Account $account, Carbon $date): array
{
/** @var AccountRepositoryInterface $accountRepository */
diff --git a/app/Generator/Webhook/StandardMessageGenerator.php b/app/Generator/Webhook/StandardMessageGenerator.php
index 2ac1846f43..0692d298a2 100644
--- a/app/Generator/Webhook/StandardMessageGenerator.php
+++ b/app/Generator/Webhook/StandardMessageGenerator.php
@@ -115,8 +115,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function runWebhook(Webhook $webhook): void
{
app('log')->debug(sprintf('Now in runWebhook(#%d)', $webhook->id));
@@ -129,8 +128,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function generateMessage(Webhook $webhook, Model $model): void
{
$class = get_class($model);
diff --git a/app/Http/Controllers/Account/IndexController.php b/app/Http/Controllers/Account/IndexController.php
index 589bcde830..a898aef2e5 100644
--- a/app/Http/Controllers/Account/IndexController.php
+++ b/app/Http/Controllers/Account/IndexController.php
@@ -69,8 +69,7 @@ class IndexController extends Controller
* @return Factory|View
*
* @throws FireflyException
- * @throws \JsonException
- * @throws ContainerExceptionInterface
+ * * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function inactive(Request $request, string $objectType)
@@ -125,8 +124,7 @@ class IndexController extends Controller
* @return Factory|View
*
* @throws FireflyException
- * @throws \JsonException
- * @throws ContainerExceptionInterface
+ * * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function index(Request $request, string $objectType)
diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php
index 280f846b88..84e3a42ad7 100644
--- a/app/Http/Controllers/Account/ReconcileController.php
+++ b/app/Http/Controllers/Account/ReconcileController.php
@@ -76,8 +76,7 @@ class ReconcileController extends Controller
* @return Factory|Redirector|RedirectResponse|View
*
* @throws FireflyException
- * @throws \JsonException
- * @throws ContainerExceptionInterface
+ * * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function reconcile(Account $account, Carbon $start = null, Carbon $end = null)
@@ -151,8 +150,7 @@ class ReconcileController extends Controller
* @return Redirector|RedirectResponse
*
* @throws DuplicateTransactionException
- * @throws \JsonException
- */
+ * */
public function submit(ReconciliationStoreRequest $request, Account $account, Carbon $start, Carbon $end)
{
if (!$this->isEditableAccount($account)) {
@@ -194,8 +192,7 @@ class ReconcileController extends Controller
* Creates a reconciliation group.
*
* @throws DuplicateTransactionException
- * @throws \JsonException
- */
+ * */
private function createReconciliation(Account $account, Carbon $start, Carbon $end, string $difference): string
{
if (!$this->isEditableAccount($account)) {
diff --git a/app/Http/Controllers/Account/ShowController.php b/app/Http/Controllers/Account/ShowController.php
index 899c06c0cc..973f6ea242 100644
--- a/app/Http/Controllers/Account/ShowController.php
+++ b/app/Http/Controllers/Account/ShowController.php
@@ -76,8 +76,7 @@ class ShowController extends Controller
* @return Factory|Redirector|RedirectResponse|View
*
* @throws FireflyException
- * @throws \JsonException
- * @throws ContainerExceptionInterface
+ * * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function show(Request $request, Account $account, Carbon $start = null, Carbon $end = null)
@@ -162,8 +161,7 @@ class ShowController extends Controller
* @return Factory|Redirector|RedirectResponse|View
*
* @throws FireflyException
- * @throws \JsonException
- * @throws ContainerExceptionInterface
+ * * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function showAll(Request $request, Account $account)
diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php
index f4098ebf10..11bb78589c 100644
--- a/app/Http/Controllers/Budget/IndexController.php
+++ b/app/Http/Controllers/Budget/IndexController.php
@@ -86,8 +86,7 @@ class IndexController extends Controller
* @return Factory|View
*
* @throws FireflyException
- * @throws \JsonException
- * @throws ContainerExceptionInterface
+ * * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function index(Carbon $start = null, Carbon $end = null)
diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php
index 26bfa67db4..b599fa254a 100644
--- a/app/Http/Controllers/Chart/AccountController.php
+++ b/app/Http/Controllers/Chart/AccountController.php
@@ -79,8 +79,7 @@ class AccountController extends Controller
*
* This chart is (multi) currency aware.
*
- * @throws \JsonException
- */
+ * */
public function expenseAccounts(): JsonResponse
{
/** @var Carbon $start */
@@ -298,8 +297,7 @@ class AccountController extends Controller
* Shows the balances for all the user's frontpage accounts.
*
* @throws FireflyException
- * @throws \JsonException
- * @throws ContainerExceptionInterface
+ * * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function frontpage(AccountRepositoryInterface $repository): JsonResponse
@@ -386,8 +384,7 @@ class AccountController extends Controller
* Shows overview of account during a single period.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function period(Account $account, Carbon $start, Carbon $end): JsonResponse
{
$chartData = [];
@@ -423,8 +420,7 @@ class AccountController extends Controller
* TODO this chart is not multi currency aware.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function report(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
{
return response()->json($this->accountBalanceChart($accounts, $start, $end));
@@ -435,8 +431,7 @@ class AccountController extends Controller
*
* This chart is multi-currency aware.
*
- * @throws \JsonException
- */
+ * */
public function revenueAccounts(): JsonResponse
{
/** @var Carbon $start */
@@ -526,8 +521,7 @@ class AccountController extends Controller
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function periodByCurrency(Carbon $start, Carbon $end, Account $account, TransactionCurrency $currency): array
{
app('log')->debug(sprintf('Now in periodByCurrency("%s", "%s", %s, "%s")', $start->format('Y-m-d'), $end->format('Y-m-d'), $account->id, $currency->code));
diff --git a/app/Http/Controllers/Chart/ExpenseReportController.php b/app/Http/Controllers/Chart/ExpenseReportController.php
index 03d3e94820..c7513c2cb2 100644
--- a/app/Http/Controllers/Chart/ExpenseReportController.php
+++ b/app/Http/Controllers/Chart/ExpenseReportController.php
@@ -71,8 +71,7 @@ class ExpenseReportController extends Controller
*
* TODO this chart is not multi currency aware.
*
- * @throws \JsonException
- */
+ * */
public function mainChart(Collection $accounts, Collection $expense, Carbon $start, Carbon $end): JsonResponse
{
$cache = new CacheProperties();
diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php
index 7be04bcf3a..60bb6e55df 100644
--- a/app/Http/Controllers/Chart/ReportController.php
+++ b/app/Http/Controllers/Chart/ReportController.php
@@ -133,8 +133,7 @@ class ReportController extends Controller
/**
* Shows income and expense, debit/credit: operations.
*
- * @throws \JsonException
- */
+ * */
public function operations(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
{
// chart properties for cache:
diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php
index f99c6c45d6..7c396ab56a 100644
--- a/app/Http/Controllers/JavascriptController.php
+++ b/app/Http/Controllers/JavascriptController.php
@@ -97,8 +97,7 @@ class JavascriptController extends Controller
* Show some common variables to be used in scripts.
*
* @throws FireflyException
- * @throws \JsonException
- * @throws ContainerExceptionInterface
+ * * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function variables(Request $request, AccountRepositoryInterface $repository): Response
diff --git a/app/Http/Controllers/Json/ReconcileController.php b/app/Http/Controllers/Json/ReconcileController.php
index 9e90dd8f16..4b4dc882fd 100644
--- a/app/Http/Controllers/Json/ReconcileController.php
+++ b/app/Http/Controllers/Json/ReconcileController.php
@@ -65,8 +65,7 @@ class ReconcileController extends Controller
* Overview of reconciliation.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function overview(Request $request, Account $account = null, Carbon $start = null, Carbon $end = null): JsonResponse
{
$startBalance = $request->get('startBalance');
@@ -166,8 +165,7 @@ class ReconcileController extends Controller
* @return JsonResponse
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function transactions(Account $account, Carbon $start = null, Carbon $end = null)
{
if (null === $start || null === $end) {
diff --git a/app/Http/Controllers/PiggyBank/IndexController.php b/app/Http/Controllers/PiggyBank/IndexController.php
index 91243f4d99..0a16be5434 100644
--- a/app/Http/Controllers/PiggyBank/IndexController.php
+++ b/app/Http/Controllers/PiggyBank/IndexController.php
@@ -74,8 +74,7 @@ class IndexController extends Controller
* @return Factory|View
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function index()
{
$this->cleanupObjectGroups();
diff --git a/app/Http/Controllers/PiggyBank/ShowController.php b/app/Http/Controllers/PiggyBank/ShowController.php
index 60b5fc2fd3..9dc9a735da 100644
--- a/app/Http/Controllers/PiggyBank/ShowController.php
+++ b/app/Http/Controllers/PiggyBank/ShowController.php
@@ -66,8 +66,7 @@ class ShowController extends Controller
* @return Factory|View
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function show(PiggyBank $piggyBank)
{
/** @var Carbon $end */
diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php
index 86f2ccbb84..273575065c 100644
--- a/app/Http/Controllers/Report/BudgetController.php
+++ b/app/Http/Controllers/Report/BudgetController.php
@@ -66,8 +66,7 @@ class BudgetController extends Controller
* @return Factory|View
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function accountPerBudget(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end)
{
/** @var BudgetReportGenerator $generator */
@@ -258,8 +257,7 @@ class BudgetController extends Controller
* @return string
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function general(Collection $accounts, Carbon $start, Carbon $end)
{
/** @var BudgetReportGenerator $generator */
diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php
index 2df459054c..b1db88f2b2 100644
--- a/app/Http/Controllers/Transaction/CreateController.php
+++ b/app/Http/Controllers/Transaction/CreateController.php
@@ -98,8 +98,7 @@ class CreateController extends Controller
* @return Factory|View
*
* @throws FireflyException
- * @throws \JsonException
- * @throws ContainerExceptionInterface
+ * * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function create(?string $objectType)
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index bbedcd4c1d..aa36127bf6 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -221,8 +221,7 @@ class AccountRepository implements AccountRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function getCashAccount(): Account
{
/** @var AccountType $type */
@@ -343,8 +342,7 @@ class AccountRepository implements AccountRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function getReconciliation(Account $account): ?Account
{
if (AccountType::ASSET !== $account->accountType->type) {
@@ -619,8 +617,7 @@ class AccountRepository implements AccountRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function store(array $data): Account
{
/** @var AccountFactory $factory */
@@ -632,8 +629,7 @@ class AccountRepository implements AccountRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function update(Account $account, array $data): Account
{
/** @var AccountUpdateService $service */
diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php
index 092c30cd4d..505d00a543 100644
--- a/app/Repositories/Account/AccountTasker.php
+++ b/app/Repositories/Account/AccountTasker.php
@@ -42,8 +42,7 @@ class AccountTasker implements AccountTaskerInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array
{
$yesterday = clone $start;
@@ -110,8 +109,7 @@ class AccountTasker implements AccountTaskerInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts): array
{
// get all expenses for the given accounts in the given period!
@@ -142,8 +140,7 @@ class AccountTasker implements AccountTaskerInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): array
{
// get all incomes for the given accounts in the given period!
@@ -178,8 +175,7 @@ class AccountTasker implements AccountTaskerInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function groupExpenseByDestination(array $array): array
{
$defaultCurrency = app('amount')->getDefaultCurrencyByUserGroup($this->user->userGroup);
@@ -239,8 +235,7 @@ class AccountTasker implements AccountTaskerInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function groupIncomeBySource(array $array): array
{
$defaultCurrency = app('amount')->getDefaultCurrencyByUserGroup($this->user->userGroup);
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php
index 33f55336f5..17634a990e 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -422,8 +422,7 @@ class BillRepository implements BillRepositoryInterface
/**
* Given the date in $date, this method will return a moment in the future where the bill is expected to be paid.
*
- * @throws \JsonException
- */
+ * */
public function nextExpectedMatch(Bill $bill, Carbon $date): Carbon
{
$cache = new CacheProperties();
@@ -464,8 +463,7 @@ class BillRepository implements BillRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function store(array $data): Bill
{
/** @var BillFactory $factory */
@@ -645,8 +643,7 @@ class BillRepository implements BillRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function update(Bill $bill, array $data): Bill
{
/** @var BillUpdateService $service */
diff --git a/app/Repositories/Budget/BudgetLimitRepository.php b/app/Repositories/Budget/BudgetLimitRepository.php
index 64c71991c0..85b3b8f16b 100644
--- a/app/Repositories/Budget/BudgetLimitRepository.php
+++ b/app/Repositories/Budget/BudgetLimitRepository.php
@@ -261,8 +261,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function store(array $data): BudgetLimit
{
// if no currency has been provided, use the user's default currency:
@@ -317,8 +316,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function update(BudgetLimit $budgetLimit, array $data): BudgetLimit
{
$budgetLimit->amount = array_key_exists('amount', $data) ? $data['amount'] : $budgetLimit->amount;
diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php
index c235d04c3c..81290487cf 100644
--- a/app/Repositories/Budget/BudgetRepository.php
+++ b/app/Repositories/Budget/BudgetRepository.php
@@ -233,8 +233,7 @@ class BudgetRepository implements BudgetRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function update(Budget $budget, array $data): Budget
{
app('log')->debug('Now in update()');
@@ -565,8 +564,7 @@ class BudgetRepository implements BudgetRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function store(array $data): Budget
{
$order = $this->getMaxOrder();
@@ -752,8 +750,7 @@ class BudgetRepository implements BudgetRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function updateAutoBudget(Budget $budget, array $data): void
{
// update or create auto-budget:
diff --git a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php
index 35b4148d45..5fa4870906 100644
--- a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php
+++ b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php
@@ -85,8 +85,7 @@ trait ModifiesPiggyBanks
}
/**
- * @throws \JsonException
- */
+ * */
public function canAddAmount(PiggyBank $piggyBank, string $amount): bool
{
$today = today(config('app.timezone'));
diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php
index 111f94fb61..1dad01c73b 100644
--- a/app/Repositories/PiggyBank/PiggyBankRepository.php
+++ b/app/Repositories/PiggyBank/PiggyBankRepository.php
@@ -135,8 +135,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
* Used for connecting to a piggy bank.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function getExactAmount(PiggyBank $piggyBank, PiggyBankRepetition $repetition, TransactionJournal $journal): string
{
app('log')->debug(sprintf('Now in getExactAmount(%d, %d, %d)', $piggyBank->id, $repetition->id, $journal->id));
@@ -320,8 +319,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
/**
* Get for piggy account what is left to put in piggies.
*
- * @throws \JsonException
- */
+ * */
public function leftOnAccount(PiggyBank $piggyBank, Carbon $date): string
{
$balance = app('steam')->balanceIgnoreVirtual($piggyBank->account, $date);
diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.php
index c614d190e0..53e1805e68 100644
--- a/app/Repositories/Recurring/RecurringRepository.php
+++ b/app/Repositories/Recurring/RecurringRepository.php
@@ -259,8 +259,7 @@ class RecurringRepository implements RecurringRepositoryInterface
/**
* Get the tags from the recurring transaction.
*
- * @throws \JsonException
- */
+ * */
public function getTags(RecurrenceTransaction $transaction): array
{
$tags = [];
@@ -480,8 +479,7 @@ class RecurringRepository implements RecurringRepositoryInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function store(array $data): Recurrence
{
/** @var RecurrenceFactory $factory */
diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php
index 109fce96ff..03d5d63c49 100644
--- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php
+++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php
@@ -255,8 +255,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
* Return all piggy bank events for all journals in the group.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function getPiggyEvents(TransactionGroup $group): array
{
$return = [];
@@ -319,8 +318,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
/**
* @throws DuplicateTransactionException
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function store(array $data): TransactionGroup
{
/** @var TransactionGroupFactory $factory */
diff --git a/app/Repositories/UserGroups/Currency/CurrencyRepository.php b/app/Repositories/UserGroups/Currency/CurrencyRepository.php
index 6941f289ef..eb137e2334 100644
--- a/app/Repositories/UserGroups/Currency/CurrencyRepository.php
+++ b/app/Repositories/UserGroups/Currency/CurrencyRepository.php
@@ -217,8 +217,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
* Find by object, ID or code. Returns user default or system default.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function findCurrency(?int $currencyId, ?string $currencyCode): TransactionCurrency
{
$result = $this->findCurrencyNull($currencyId, $currencyCode);
diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php
index a7f40bfb5d..f6e97d4dd7 100644
--- a/app/Services/Internal/Support/AccountServiceTrait.php
+++ b/app/Services/Internal/Support/AccountServiceTrait.php
@@ -188,8 +188,7 @@ trait AccountServiceTrait
/**
* @throws FireflyException
- * @throws \JsonException
- *
+ * *
* @deprecated
*/
protected function createOBGroup(Account $account, array $data): TransactionGroup
@@ -337,8 +336,7 @@ trait AccountServiceTrait
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
protected function getCurrency(int $currencyId, string $currencyCode): TransactionCurrency
{
// find currency, or use default currency instead.
@@ -362,8 +360,7 @@ trait AccountServiceTrait
* Create the opposing "credit liability" transaction for credit liabilities.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
protected function updateCreditTransaction(Account $account, string $direction, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{
app('log')->debug(sprintf('Now in %s', __METHOD__));
@@ -419,8 +416,7 @@ trait AccountServiceTrait
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
protected function createCreditTransaction(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{
app('log')->debug('Now going to create an createCreditTransaction.');
@@ -514,8 +510,7 @@ trait AccountServiceTrait
* Since opening balance and date can still be empty strings, it may fail.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
protected function updateOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{
app('log')->debug(sprintf('Now in %s', __METHOD__));
@@ -571,8 +566,7 @@ trait AccountServiceTrait
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
protected function createOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{
app('log')->debug('Now going to create an OB group.');
diff --git a/app/Services/Internal/Support/RecurringTransactionTrait.php b/app/Services/Internal/Support/RecurringTransactionTrait.php
index 36b3fca9f1..cc9b4c4318 100644
--- a/app/Services/Internal/Support/RecurringTransactionTrait.php
+++ b/app/Services/Internal/Support/RecurringTransactionTrait.php
@@ -87,8 +87,7 @@ trait RecurringTransactionTrait
* Store transactions of a recurring transactions. It's complex but readable.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
protected function createTransactions(Recurrence $recurrence, array $transactions): void
{
app('log')->debug('Now in createTransactions()');
@@ -164,8 +163,7 @@ trait RecurringTransactionTrait
}
/**
- * @throws \JsonException
- */
+ * */
protected function findAccount(array $expectedTypes, ?int $accountId, ?string $accountName): Account
{
$result = null;
diff --git a/app/Services/Internal/Update/AccountUpdateService.php b/app/Services/Internal/Update/AccountUpdateService.php
index 2767b08614..3fd1770241 100644
--- a/app/Services/Internal/Update/AccountUpdateService.php
+++ b/app/Services/Internal/Update/AccountUpdateService.php
@@ -63,8 +63,7 @@ class AccountUpdateService
* Update account data.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function update(Account $account, array $data): Account
{
app('log')->debug(sprintf('Now in %s', __METHOD__));
diff --git a/app/Services/Internal/Update/BillUpdateService.php b/app/Services/Internal/Update/BillUpdateService.php
index 9bf641e17c..f73df42cd3 100644
--- a/app/Services/Internal/Update/BillUpdateService.php
+++ b/app/Services/Internal/Update/BillUpdateService.php
@@ -46,8 +46,7 @@ class BillUpdateService
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function update(Bill $bill, array $data): Bill
{
$this->user = $bill->user;
diff --git a/app/Services/Internal/Update/GroupUpdateService.php b/app/Services/Internal/Update/GroupUpdateService.php
index 6bd80ff311..0b4f4a40d8 100644
--- a/app/Services/Internal/Update/GroupUpdateService.php
+++ b/app/Services/Internal/Update/GroupUpdateService.php
@@ -41,8 +41,7 @@ class GroupUpdateService
*
* @throws DuplicateTransactionException
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function update(TransactionGroup $transactionGroup, array $data): TransactionGroup
{
app('log')->debug(sprintf('Now in %s', __METHOD__));
@@ -150,8 +149,7 @@ class GroupUpdateService
/**
* @throws DuplicateTransactionException
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function updateTransactions(TransactionGroup $transactionGroup, array $transactions): array
{
app('log')->debug(sprintf('Now in %s', __METHOD__));
@@ -208,8 +206,7 @@ class GroupUpdateService
/**
* @throws DuplicateTransactionException
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function createTransactionJournal(TransactionGroup $transactionGroup, array $data): ?TransactionJournal
{
$submission = [
diff --git a/app/Services/Internal/Update/RecurrenceUpdateService.php b/app/Services/Internal/Update/RecurrenceUpdateService.php
index b83d369ac8..e1eaade450 100644
--- a/app/Services/Internal/Update/RecurrenceUpdateService.php
+++ b/app/Services/Internal/Update/RecurrenceUpdateService.php
@@ -192,8 +192,7 @@ class RecurrenceUpdateService
* TODO this method is very complex.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function updateTransactions(Recurrence $recurrence, array $transactions): void
{
app('log')->debug('Now in updateTransactions()');
diff --git a/app/Support/Http/Controllers/ChartGeneration.php b/app/Support/Http/Controllers/ChartGeneration.php
index 365c9e42d2..afaaac5a24 100644
--- a/app/Support/Http/Controllers/ChartGeneration.php
+++ b/app/Support/Http/Controllers/ChartGeneration.php
@@ -40,8 +40,7 @@ trait ChartGeneration
* Shows an overview of the account balances for a set of accounts.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
protected function accountBalanceChart(Collection $accounts, Carbon $start, Carbon $end): array // chart helper method.
{
// chart properties for cache:
diff --git a/app/Support/Report/Budget/BudgetReportGenerator.php b/app/Support/Report/Budget/BudgetReportGenerator.php
index a92a775907..20471c11ba 100644
--- a/app/Support/Report/Budget/BudgetReportGenerator.php
+++ b/app/Support/Report/Budget/BudgetReportGenerator.php
@@ -134,8 +134,7 @@ class BudgetReportGenerator
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function setUser(User $user): void
{
$this->repository->setUser($user);
diff --git a/app/Support/Steam.php b/app/Support/Steam.php
index ea9e2953aa..705e1417ba 100644
--- a/app/Support/Steam.php
+++ b/app/Support/Steam.php
@@ -89,8 +89,7 @@ class Steam
* [yyyy-mm-dd] => 123,2
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function balanceInRange(Account $account, Carbon $start, Carbon $end, ?TransactionCurrency $currency = null): array
{
$cache = new CacheProperties();
diff --git a/app/TransactionRules/Actions/ConvertToDeposit.php b/app/TransactionRules/Actions/ConvertToDeposit.php
index d866262ec3..309c20c556 100644
--- a/app/TransactionRules/Actions/ConvertToDeposit.php
+++ b/app/TransactionRules/Actions/ConvertToDeposit.php
@@ -121,8 +121,7 @@ class ConvertToDeposit implements ActionInterface
* Is converted to a deposit from C to A.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function convertWithdrawalArray(TransactionJournal $journal): bool
{
$user = $journal->user;
@@ -211,8 +210,7 @@ class ConvertToDeposit implements ActionInterface
* The source account is replaced.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function convertTransferArray(TransactionJournal $journal): bool
{
$user = $journal->user;
diff --git a/app/TransactionRules/Actions/ConvertToWithdrawal.php b/app/TransactionRules/Actions/ConvertToWithdrawal.php
index 1a68b48a34..00c794a40e 100644
--- a/app/TransactionRules/Actions/ConvertToWithdrawal.php
+++ b/app/TransactionRules/Actions/ConvertToWithdrawal.php
@@ -116,8 +116,7 @@ class ConvertToWithdrawal implements ActionInterface
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function convertDepositArray(TransactionJournal $journal): bool
{
$user = $journal->user;
@@ -203,8 +202,7 @@ class ConvertToWithdrawal implements ActionInterface
* Output is a withdrawal from A to C.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function convertTransferArray(TransactionJournal $journal): bool
{
// find or create expense account.
diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php
index 7f9d4e633e..c9ccca4772 100644
--- a/app/Transformers/AccountTransformer.php
+++ b/app/Transformers/AccountTransformer.php
@@ -49,8 +49,7 @@ class AccountTransformer extends AbstractTransformer
* Transform the account.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function transform(Account $account): array
{
$this->repository->setUser($account->user);
@@ -157,8 +156,7 @@ class AccountTransformer extends AbstractTransformer
/**
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
private function getCurrency(Account $account): array
{
$currency = $this->repository->getAccountCurrency($account);
diff --git a/app/Transformers/PiggyBankEventTransformer.php b/app/Transformers/PiggyBankEventTransformer.php
index 276f37fdd2..0796f2b73e 100644
--- a/app/Transformers/PiggyBankEventTransformer.php
+++ b/app/Transformers/PiggyBankEventTransformer.php
@@ -49,8 +49,7 @@ class PiggyBankEventTransformer extends AbstractTransformer
* Convert piggy bank event.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function transform(PiggyBankEvent $event): array
{
// get account linked to piggy bank
diff --git a/app/Transformers/PiggyBankTransformer.php b/app/Transformers/PiggyBankTransformer.php
index 8ee2085bdf..82af1d3c5c 100644
--- a/app/Transformers/PiggyBankTransformer.php
+++ b/app/Transformers/PiggyBankTransformer.php
@@ -50,8 +50,7 @@ class PiggyBankTransformer extends AbstractTransformer
* Transform the piggy bank.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function transform(PiggyBank $piggyBank): array
{
$account = $piggyBank->account;
diff --git a/app/Transformers/V2/PiggyBankTransformer.php b/app/Transformers/V2/PiggyBankTransformer.php
index a84e9ad4d2..12076a5594 100644
--- a/app/Transformers/V2/PiggyBankTransformer.php
+++ b/app/Transformers/V2/PiggyBankTransformer.php
@@ -139,8 +139,7 @@ class PiggyBankTransformer extends AbstractTransformer
* Transform the piggy bank.
*
* @throws FireflyException
- * @throws \JsonException
- */
+ * */
public function transform(PiggyBank $piggyBank): array
{
// $account = $piggyBank->account;
diff --git a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php
index 64afda0873..d3912527de 100644
--- a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php
+++ b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php
@@ -30,8 +30,7 @@ use Illuminate\Validation\Validator;
trait ValidatesBulkTransactionQuery
{
/**
- * @throws \JsonException
- */
+ * */
protected function validateTransactionQuery(Validator $validator): void
{
$data = $validator->getData();