Remove JSON exceptions that are not thrown anyway.

This commit is contained in:
James Cole 2023-12-22 07:47:13 +01:00
parent 34e22e0747
commit 58dea55d38
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
52 changed files with 105 additions and 211 deletions

View File

@ -67,7 +67,6 @@ class AccountController extends Controller
* Documentation for this endpoint: * Documentation for this endpoint:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getAccountsAC * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getAccountsAC
* *
* @throws \JsonException
* @throws FireflyException * @throws FireflyException
* @throws FireflyException * @throws FireflyException
*/ */

View File

@ -70,8 +70,7 @@ class AccountController extends Controller
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/charts/getChartAccountOverview * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/charts/getChartAccountOverview
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * * @throws ContainerExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function overview(DateRequest $request): JsonResponse public function overview(DateRequest $request): JsonResponse

View File

@ -71,8 +71,7 @@ class ShowController extends Controller
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function index(): JsonResponse public function index(): JsonResponse
{ {
$pageSize = $this->parameters->get('limit'); $pageSize = $this->parameters->get('limit');
@ -102,8 +101,7 @@ class ShowController extends Controller
* Show a currency. * Show a currency.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function show(TransactionCurrency $currency): JsonResponse public function show(TransactionCurrency $currency): JsonResponse
{ {
/** @var User $user */ /** @var User $user */
@ -131,8 +129,7 @@ class ShowController extends Controller
* Show a currency. * Show a currency.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function showDefault(): JsonResponse public function showDefault(): JsonResponse
{ {
/** @var User $user */ /** @var User $user */

View File

@ -68,8 +68,7 @@ class StoreController extends Controller
* Store new currency. * Store new currency.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function store(StoreRequest $request): JsonResponse public function store(StoreRequest $request): JsonResponse
{ {
$currency = $this->repository->store($request->getAll()); $currency = $this->repository->store($request->getAll());

View File

@ -69,8 +69,7 @@ class UpdateController extends Controller
* Disable a currency. * Disable a currency.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function disable(TransactionCurrency $currency): JsonResponse public function disable(TransactionCurrency $currency): JsonResponse
{ {
// must be unused. // must be unused.
@ -134,8 +133,7 @@ class UpdateController extends Controller
* Enable a currency. * Enable a currency.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function enable(TransactionCurrency $currency): JsonResponse public function enable(TransactionCurrency $currency): JsonResponse
{ {
$this->repository->enable($currency); $this->repository->enable($currency);
@ -162,8 +160,7 @@ class UpdateController extends Controller
* Update a currency. * Update a currency.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function update(UpdateRequest $request, TransactionCurrency $currency): JsonResponse public function update(UpdateRequest $request, TransactionCurrency $currency): JsonResponse
{ {
$data = $request->getAll(); $data = $request->getAll();

View File

@ -49,8 +49,7 @@ class MigrateRecurrenceMeta extends Command
* Execute the console command. * Execute the console command.
* *
* @throws ContainerExceptionInterface * @throws ContainerExceptionInterface
* @throws \JsonException * * @throws NotFoundExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function handle(): int public function handle(): int
{ {
@ -88,8 +87,7 @@ class MigrateRecurrenceMeta extends Command
} }
/** /**
* @throws \JsonException * */
*/
private function migrateMetaData(): int private function migrateMetaData(): int
{ {
$count = 0; $count = 0;
@ -105,8 +103,7 @@ class MigrateRecurrenceMeta extends Command
} }
/** /**
* @throws \JsonException * */
*/
private function migrateEntry(RecurrenceMeta $meta): int private function migrateEntry(RecurrenceMeta $meta): int
{ {
/** @var null|Recurrence $recurrence */ /** @var null|Recurrence $recurrence */

View File

@ -68,8 +68,7 @@ class AccountFactory
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function findOrCreate(string $accountName, string $accountType): Account public function findOrCreate(string $accountName, string $accountType): Account
{ {
app('log')->debug(sprintf('findOrCreate("%s", "%s")', $accountName, $accountType)); app('log')->debug(sprintf('findOrCreate("%s", "%s")', $accountName, $accountType));
@ -101,8 +100,7 @@ class AccountFactory
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function create(array $data): Account public function create(array $data): Account
{ {
app('log')->debug('Now in AccountFactory::create()'); app('log')->debug('Now in AccountFactory::create()');
@ -173,8 +171,7 @@ class AccountFactory
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function createAccount(AccountType $type, array $data): Account private function createAccount(AccountType $type, array $data): Account
{ {
$this->accountRepository->resetAccountOrder(); $this->accountRepository->resetAccountOrder();
@ -242,8 +239,7 @@ class AccountFactory
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function cleanMetaDataArray(Account $account, array $data): array private function cleanMetaDataArray(Account $account, array $data): array
{ {
$currencyId = array_key_exists('currency_id', $data) ? (int)$data['currency_id'] : 0; $currencyId = array_key_exists('currency_id', $data) ? (int)$data['currency_id'] : 0;

View File

@ -43,8 +43,7 @@ class BillFactory
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function create(array $data): ?Bill public function create(array $data): ?Bill
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__), $data); app('log')->debug(sprintf('Now in %s', __METHOD__), $data);

View File

@ -52,8 +52,7 @@ class RecurrenceFactory
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function create(array $data): Recurrence public function create(array $data): Recurrence
{ {
try { try {

View File

@ -49,8 +49,7 @@ class TransactionGroupFactory
* *
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function create(array $data): TransactionGroup public function create(array $data): TransactionGroup
{ {
app('log')->debug('Now in TransactionGroupFactory::create()'); app('log')->debug('Now in TransactionGroupFactory::create()');

View File

@ -91,8 +91,7 @@ class TransactionJournalFactory
* *
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function create(array $data): Collection public function create(array $data): Collection
{ {
app('log')->debug('Now in TransactionJournalFactory::create()'); app('log')->debug('Now in TransactionJournalFactory::create()');
@ -185,8 +184,7 @@ class TransactionJournalFactory
/** /**
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function createJournal(NullArrayObject $row): ?TransactionJournal private function createJournal(NullArrayObject $row): ?TransactionJournal
{ {
$row['import_hash_v2'] = $this->hashArray($row); $row['import_hash_v2'] = $this->hashArray($row);
@ -346,8 +344,7 @@ class TransactionJournalFactory
} }
/** /**
* @throws \JsonException * */
*/
private function hashArray(NullArrayObject $row): string private function hashArray(NullArrayObject $row): string
{ {
$dataRow = $row->getArrayCopy(); $dataRow = $row->getArrayCopy();
@ -364,8 +361,7 @@ class TransactionJournalFactory
* If this transaction already exists, throw an error. * If this transaction already exists, throw an error.
* *
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws \JsonException * */
*/
private function errorIfDuplicate(string $hash): void private function errorIfDuplicate(string $hash): void
{ {
app('log')->debug(sprintf('In errorIfDuplicate(%s)', $hash)); app('log')->debug(sprintf('In errorIfDuplicate(%s)', $hash));
@ -463,8 +459,7 @@ class TransactionJournalFactory
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function getCurrencyByAccount(string $type, ?TransactionCurrency $currency, Account $source, Account $destination): TransactionCurrency private function getCurrencyByAccount(string $type, ?TransactionCurrency $currency, Account $source, Account $destination): TransactionCurrency
{ {
app('log')->debug('Now in getCurrencyByAccount()'); app('log')->debug('Now in getCurrencyByAccount()');
@ -477,8 +472,7 @@ class TransactionJournalFactory
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function getCurrency(?TransactionCurrency $currency, Account $account): TransactionCurrency private function getCurrency(?TransactionCurrency $currency, Account $account): TransactionCurrency
{ {
app('log')->debug('Now in getCurrency()'); app('log')->debug('Now in getCurrency()');
@ -512,8 +506,7 @@ class TransactionJournalFactory
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function getForeignByAccount(string $type, ?TransactionCurrency $foreignCurrency, Account $destination): ?TransactionCurrency private function getForeignByAccount(string $type, ?TransactionCurrency $foreignCurrency, Account $destination): ?TransactionCurrency
{ {
if (TransactionType::TRANSFER === $type) { if (TransactionType::TRANSFER === $type) {

View File

@ -45,8 +45,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
* Generates the report. * Generates the report.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function generate(): string public function generate(): string
{ {
$auditData = []; $auditData = [];
@ -111,8 +110,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
* Get the audit report. * Get the audit report.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function getAuditReport(Account $account, Carbon $date): array public function getAuditReport(Account $account, Carbon $date): array
{ {
/** @var AccountRepositoryInterface $accountRepository */ /** @var AccountRepositoryInterface $accountRepository */

View File

@ -115,8 +115,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function runWebhook(Webhook $webhook): void private function runWebhook(Webhook $webhook): void
{ {
app('log')->debug(sprintf('Now in runWebhook(#%d)', $webhook->id)); app('log')->debug(sprintf('Now in runWebhook(#%d)', $webhook->id));
@ -129,8 +128,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function generateMessage(Webhook $webhook, Model $model): void private function generateMessage(Webhook $webhook, Model $model): void
{ {
$class = get_class($model); $class = get_class($model);

View File

@ -69,8 +69,7 @@ class IndexController extends Controller
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * * @throws ContainerExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function inactive(Request $request, string $objectType) public function inactive(Request $request, string $objectType)
@ -125,8 +124,7 @@ class IndexController extends Controller
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * * @throws ContainerExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function index(Request $request, string $objectType) public function index(Request $request, string $objectType)

View File

@ -76,8 +76,7 @@ class ReconcileController extends Controller
* @return Factory|Redirector|RedirectResponse|View * @return Factory|Redirector|RedirectResponse|View
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * * @throws ContainerExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function reconcile(Account $account, Carbon $start = null, Carbon $end = null) public function reconcile(Account $account, Carbon $start = null, Carbon $end = null)
@ -151,8 +150,7 @@ class ReconcileController extends Controller
* @return Redirector|RedirectResponse * @return Redirector|RedirectResponse
* *
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws \JsonException * */
*/
public function submit(ReconciliationStoreRequest $request, Account $account, Carbon $start, Carbon $end) public function submit(ReconciliationStoreRequest $request, Account $account, Carbon $start, Carbon $end)
{ {
if (!$this->isEditableAccount($account)) { if (!$this->isEditableAccount($account)) {
@ -194,8 +192,7 @@ class ReconcileController extends Controller
* Creates a reconciliation group. * Creates a reconciliation group.
* *
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws \JsonException * */
*/
private function createReconciliation(Account $account, Carbon $start, Carbon $end, string $difference): string private function createReconciliation(Account $account, Carbon $start, Carbon $end, string $difference): string
{ {
if (!$this->isEditableAccount($account)) { if (!$this->isEditableAccount($account)) {

View File

@ -76,8 +76,7 @@ class ShowController extends Controller
* @return Factory|Redirector|RedirectResponse|View * @return Factory|Redirector|RedirectResponse|View
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * * @throws ContainerExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function show(Request $request, Account $account, Carbon $start = null, Carbon $end = null) 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 * @return Factory|Redirector|RedirectResponse|View
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * * @throws ContainerExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function showAll(Request $request, Account $account) public function showAll(Request $request, Account $account)

View File

@ -86,8 +86,7 @@ class IndexController extends Controller
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * * @throws ContainerExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function index(Carbon $start = null, Carbon $end = null) public function index(Carbon $start = null, Carbon $end = null)

View File

@ -79,8 +79,7 @@ class AccountController extends Controller
* *
* This chart is (multi) currency aware. * This chart is (multi) currency aware.
* *
* @throws \JsonException * */
*/
public function expenseAccounts(): JsonResponse public function expenseAccounts(): JsonResponse
{ {
/** @var Carbon $start */ /** @var Carbon $start */
@ -298,8 +297,7 @@ class AccountController extends Controller
* Shows the balances for all the user's frontpage accounts. * Shows the balances for all the user's frontpage accounts.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * * @throws ContainerExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function frontpage(AccountRepositoryInterface $repository): JsonResponse public function frontpage(AccountRepositoryInterface $repository): JsonResponse
@ -386,8 +384,7 @@ class AccountController extends Controller
* Shows overview of account during a single period. * Shows overview of account during a single period.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function period(Account $account, Carbon $start, Carbon $end): JsonResponse public function period(Account $account, Carbon $start, Carbon $end): JsonResponse
{ {
$chartData = []; $chartData = [];
@ -423,8 +420,7 @@ class AccountController extends Controller
* TODO this chart is not multi currency aware. * TODO this chart is not multi currency aware.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function report(Collection $accounts, Carbon $start, Carbon $end): JsonResponse public function report(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
{ {
return response()->json($this->accountBalanceChart($accounts, $start, $end)); return response()->json($this->accountBalanceChart($accounts, $start, $end));
@ -435,8 +431,7 @@ class AccountController extends Controller
* *
* This chart is multi-currency aware. * This chart is multi-currency aware.
* *
* @throws \JsonException * */
*/
public function revenueAccounts(): JsonResponse public function revenueAccounts(): JsonResponse
{ {
/** @var Carbon $start */ /** @var Carbon $start */
@ -526,8 +521,7 @@ class AccountController extends Controller
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function periodByCurrency(Carbon $start, Carbon $end, Account $account, TransactionCurrency $currency): array 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)); 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));

View File

@ -71,8 +71,7 @@ class ExpenseReportController extends Controller
* *
* TODO this chart is not multi currency aware. * TODO this chart is not multi currency aware.
* *
* @throws \JsonException * */
*/
public function mainChart(Collection $accounts, Collection $expense, Carbon $start, Carbon $end): JsonResponse public function mainChart(Collection $accounts, Collection $expense, Carbon $start, Carbon $end): JsonResponse
{ {
$cache = new CacheProperties(); $cache = new CacheProperties();

View File

@ -133,8 +133,7 @@ class ReportController extends Controller
/** /**
* Shows income and expense, debit/credit: operations. * Shows income and expense, debit/credit: operations.
* *
* @throws \JsonException * */
*/
public function operations(Collection $accounts, Carbon $start, Carbon $end): JsonResponse public function operations(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
{ {
// chart properties for cache: // chart properties for cache:

View File

@ -97,8 +97,7 @@ class JavascriptController extends Controller
* Show some common variables to be used in scripts. * Show some common variables to be used in scripts.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * * @throws ContainerExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function variables(Request $request, AccountRepositoryInterface $repository): Response public function variables(Request $request, AccountRepositoryInterface $repository): Response

View File

@ -65,8 +65,7 @@ class ReconcileController extends Controller
* Overview of reconciliation. * Overview of reconciliation.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function overview(Request $request, Account $account = null, Carbon $start = null, Carbon $end = null): JsonResponse public function overview(Request $request, Account $account = null, Carbon $start = null, Carbon $end = null): JsonResponse
{ {
$startBalance = $request->get('startBalance'); $startBalance = $request->get('startBalance');
@ -166,8 +165,7 @@ class ReconcileController extends Controller
* @return JsonResponse * @return JsonResponse
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function transactions(Account $account, Carbon $start = null, Carbon $end = null) public function transactions(Account $account, Carbon $start = null, Carbon $end = null)
{ {
if (null === $start || null === $end) { if (null === $start || null === $end) {

View File

@ -74,8 +74,7 @@ class IndexController extends Controller
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function index() public function index()
{ {
$this->cleanupObjectGroups(); $this->cleanupObjectGroups();

View File

@ -66,8 +66,7 @@ class ShowController extends Controller
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function show(PiggyBank $piggyBank) public function show(PiggyBank $piggyBank)
{ {
/** @var Carbon $end */ /** @var Carbon $end */

View File

@ -66,8 +66,7 @@ class BudgetController extends Controller
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function accountPerBudget(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end) public function accountPerBudget(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end)
{ {
/** @var BudgetReportGenerator $generator */ /** @var BudgetReportGenerator $generator */
@ -258,8 +257,7 @@ class BudgetController extends Controller
* @return string * @return string
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function general(Collection $accounts, Carbon $start, Carbon $end) public function general(Collection $accounts, Carbon $start, Carbon $end)
{ {
/** @var BudgetReportGenerator $generator */ /** @var BudgetReportGenerator $generator */

View File

@ -98,8 +98,7 @@ class CreateController extends Controller
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * * @throws ContainerExceptionInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function create(?string $objectType) public function create(?string $objectType)

View File

@ -221,8 +221,7 @@ class AccountRepository implements AccountRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function getCashAccount(): Account public function getCashAccount(): Account
{ {
/** @var AccountType $type */ /** @var AccountType $type */
@ -343,8 +342,7 @@ class AccountRepository implements AccountRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function getReconciliation(Account $account): ?Account public function getReconciliation(Account $account): ?Account
{ {
if (AccountType::ASSET !== $account->accountType->type) { if (AccountType::ASSET !== $account->accountType->type) {
@ -619,8 +617,7 @@ class AccountRepository implements AccountRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function store(array $data): Account public function store(array $data): Account
{ {
/** @var AccountFactory $factory */ /** @var AccountFactory $factory */
@ -632,8 +629,7 @@ class AccountRepository implements AccountRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function update(Account $account, array $data): Account public function update(Account $account, array $data): Account
{ {
/** @var AccountUpdateService $service */ /** @var AccountUpdateService $service */

View File

@ -42,8 +42,7 @@ class AccountTasker implements AccountTaskerInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array
{ {
$yesterday = clone $start; $yesterday = clone $start;
@ -110,8 +109,7 @@ class AccountTasker implements AccountTaskerInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts): array public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts): array
{ {
// get all expenses for the given accounts in the given period! // get all expenses for the given accounts in the given period!
@ -142,8 +140,7 @@ class AccountTasker implements AccountTaskerInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): array public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): array
{ {
// get all incomes for the given accounts in the given period! // get all incomes for the given accounts in the given period!
@ -178,8 +175,7 @@ class AccountTasker implements AccountTaskerInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function groupExpenseByDestination(array $array): array private function groupExpenseByDestination(array $array): array
{ {
$defaultCurrency = app('amount')->getDefaultCurrencyByUserGroup($this->user->userGroup); $defaultCurrency = app('amount')->getDefaultCurrencyByUserGroup($this->user->userGroup);
@ -239,8 +235,7 @@ class AccountTasker implements AccountTaskerInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function groupIncomeBySource(array $array): array private function groupIncomeBySource(array $array): array
{ {
$defaultCurrency = app('amount')->getDefaultCurrencyByUserGroup($this->user->userGroup); $defaultCurrency = app('amount')->getDefaultCurrencyByUserGroup($this->user->userGroup);

View File

@ -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. * 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 public function nextExpectedMatch(Bill $bill, Carbon $date): Carbon
{ {
$cache = new CacheProperties(); $cache = new CacheProperties();
@ -464,8 +463,7 @@ class BillRepository implements BillRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function store(array $data): Bill public function store(array $data): Bill
{ {
/** @var BillFactory $factory */ /** @var BillFactory $factory */
@ -645,8 +643,7 @@ class BillRepository implements BillRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function update(Bill $bill, array $data): Bill public function update(Bill $bill, array $data): Bill
{ {
/** @var BillUpdateService $service */ /** @var BillUpdateService $service */

View File

@ -261,8 +261,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function store(array $data): BudgetLimit public function store(array $data): BudgetLimit
{ {
// if no currency has been provided, use the user's default currency: // if no currency has been provided, use the user's default currency:
@ -317,8 +316,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function update(BudgetLimit $budgetLimit, array $data): BudgetLimit public function update(BudgetLimit $budgetLimit, array $data): BudgetLimit
{ {
$budgetLimit->amount = array_key_exists('amount', $data) ? $data['amount'] : $budgetLimit->amount; $budgetLimit->amount = array_key_exists('amount', $data) ? $data['amount'] : $budgetLimit->amount;

View File

@ -233,8 +233,7 @@ class BudgetRepository implements BudgetRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function update(Budget $budget, array $data): Budget public function update(Budget $budget, array $data): Budget
{ {
app('log')->debug('Now in update()'); app('log')->debug('Now in update()');
@ -565,8 +564,7 @@ class BudgetRepository implements BudgetRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function store(array $data): Budget public function store(array $data): Budget
{ {
$order = $this->getMaxOrder(); $order = $this->getMaxOrder();
@ -752,8 +750,7 @@ class BudgetRepository implements BudgetRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function updateAutoBudget(Budget $budget, array $data): void private function updateAutoBudget(Budget $budget, array $data): void
{ {
// update or create auto-budget: // update or create auto-budget:

View File

@ -85,8 +85,7 @@ trait ModifiesPiggyBanks
} }
/** /**
* @throws \JsonException * */
*/
public function canAddAmount(PiggyBank $piggyBank, string $amount): bool public function canAddAmount(PiggyBank $piggyBank, string $amount): bool
{ {
$today = today(config('app.timezone')); $today = today(config('app.timezone'));

View File

@ -135,8 +135,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
* Used for connecting to a piggy bank. * Used for connecting to a piggy bank.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function getExactAmount(PiggyBank $piggyBank, PiggyBankRepetition $repetition, TransactionJournal $journal): string 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)); 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. * Get for piggy account what is left to put in piggies.
* *
* @throws \JsonException * */
*/
public function leftOnAccount(PiggyBank $piggyBank, Carbon $date): string public function leftOnAccount(PiggyBank $piggyBank, Carbon $date): string
{ {
$balance = app('steam')->balanceIgnoreVirtual($piggyBank->account, $date); $balance = app('steam')->balanceIgnoreVirtual($piggyBank->account, $date);

View File

@ -259,8 +259,7 @@ class RecurringRepository implements RecurringRepositoryInterface
/** /**
* Get the tags from the recurring transaction. * Get the tags from the recurring transaction.
* *
* @throws \JsonException * */
*/
public function getTags(RecurrenceTransaction $transaction): array public function getTags(RecurrenceTransaction $transaction): array
{ {
$tags = []; $tags = [];
@ -480,8 +479,7 @@ class RecurringRepository implements RecurringRepositoryInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function store(array $data): Recurrence public function store(array $data): Recurrence
{ {
/** @var RecurrenceFactory $factory */ /** @var RecurrenceFactory $factory */

View File

@ -255,8 +255,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
* Return all piggy bank events for all journals in the group. * Return all piggy bank events for all journals in the group.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function getPiggyEvents(TransactionGroup $group): array public function getPiggyEvents(TransactionGroup $group): array
{ {
$return = []; $return = [];
@ -319,8 +318,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
/** /**
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function store(array $data): TransactionGroup public function store(array $data): TransactionGroup
{ {
/** @var TransactionGroupFactory $factory */ /** @var TransactionGroupFactory $factory */

View File

@ -217,8 +217,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
* Find by object, ID or code. Returns user default or system default. * Find by object, ID or code. Returns user default or system default.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function findCurrency(?int $currencyId, ?string $currencyCode): TransactionCurrency public function findCurrency(?int $currencyId, ?string $currencyCode): TransactionCurrency
{ {
$result = $this->findCurrencyNull($currencyId, $currencyCode); $result = $this->findCurrencyNull($currencyId, $currencyCode);

View File

@ -188,8 +188,7 @@ trait AccountServiceTrait
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * *
*
* @deprecated * @deprecated
*/ */
protected function createOBGroup(Account $account, array $data): TransactionGroup protected function createOBGroup(Account $account, array $data): TransactionGroup
@ -337,8 +336,7 @@ trait AccountServiceTrait
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
protected function getCurrency(int $currencyId, string $currencyCode): TransactionCurrency protected function getCurrency(int $currencyId, string $currencyCode): TransactionCurrency
{ {
// find currency, or use default currency instead. // find currency, or use default currency instead.
@ -362,8 +360,7 @@ trait AccountServiceTrait
* Create the opposing "credit liability" transaction for credit liabilities. * Create the opposing "credit liability" transaction for credit liabilities.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
protected function updateCreditTransaction(Account $account, string $direction, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup protected function updateCreditTransaction(Account $account, string $direction, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); app('log')->debug(sprintf('Now in %s', __METHOD__));
@ -419,8 +416,7 @@ trait AccountServiceTrait
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
protected function createCreditTransaction(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup protected function createCreditTransaction(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{ {
app('log')->debug('Now going to create an createCreditTransaction.'); 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. * Since opening balance and date can still be empty strings, it may fail.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
protected function updateOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup protected function updateOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); app('log')->debug(sprintf('Now in %s', __METHOD__));
@ -571,8 +566,7 @@ trait AccountServiceTrait
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
protected function createOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup protected function createOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{ {
app('log')->debug('Now going to create an OB group.'); app('log')->debug('Now going to create an OB group.');

View File

@ -87,8 +87,7 @@ trait RecurringTransactionTrait
* Store transactions of a recurring transactions. It's complex but readable. * Store transactions of a recurring transactions. It's complex but readable.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
protected function createTransactions(Recurrence $recurrence, array $transactions): void protected function createTransactions(Recurrence $recurrence, array $transactions): void
{ {
app('log')->debug('Now in createTransactions()'); app('log')->debug('Now in createTransactions()');
@ -164,8 +163,7 @@ trait RecurringTransactionTrait
} }
/** /**
* @throws \JsonException * */
*/
protected function findAccount(array $expectedTypes, ?int $accountId, ?string $accountName): Account protected function findAccount(array $expectedTypes, ?int $accountId, ?string $accountName): Account
{ {
$result = null; $result = null;

View File

@ -63,8 +63,7 @@ class AccountUpdateService
* Update account data. * Update account data.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function update(Account $account, array $data): Account public function update(Account $account, array $data): Account
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); app('log')->debug(sprintf('Now in %s', __METHOD__));

View File

@ -46,8 +46,7 @@ class BillUpdateService
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function update(Bill $bill, array $data): Bill public function update(Bill $bill, array $data): Bill
{ {
$this->user = $bill->user; $this->user = $bill->user;

View File

@ -41,8 +41,7 @@ class GroupUpdateService
* *
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function update(TransactionGroup $transactionGroup, array $data): TransactionGroup public function update(TransactionGroup $transactionGroup, array $data): TransactionGroup
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); app('log')->debug(sprintf('Now in %s', __METHOD__));
@ -150,8 +149,7 @@ class GroupUpdateService
/** /**
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function updateTransactions(TransactionGroup $transactionGroup, array $transactions): array private function updateTransactions(TransactionGroup $transactionGroup, array $transactions): array
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); app('log')->debug(sprintf('Now in %s', __METHOD__));
@ -208,8 +206,7 @@ class GroupUpdateService
/** /**
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function createTransactionJournal(TransactionGroup $transactionGroup, array $data): ?TransactionJournal private function createTransactionJournal(TransactionGroup $transactionGroup, array $data): ?TransactionJournal
{ {
$submission = [ $submission = [

View File

@ -192,8 +192,7 @@ class RecurrenceUpdateService
* TODO this method is very complex. * TODO this method is very complex.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function updateTransactions(Recurrence $recurrence, array $transactions): void private function updateTransactions(Recurrence $recurrence, array $transactions): void
{ {
app('log')->debug('Now in updateTransactions()'); app('log')->debug('Now in updateTransactions()');

View File

@ -40,8 +40,7 @@ trait ChartGeneration
* Shows an overview of the account balances for a set of accounts. * Shows an overview of the account balances for a set of accounts.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
protected function accountBalanceChart(Collection $accounts, Carbon $start, Carbon $end): array // chart helper method. protected function accountBalanceChart(Collection $accounts, Carbon $start, Carbon $end): array // chart helper method.
{ {
// chart properties for cache: // chart properties for cache:

View File

@ -134,8 +134,7 @@ class BudgetReportGenerator
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function setUser(User $user): void public function setUser(User $user): void
{ {
$this->repository->setUser($user); $this->repository->setUser($user);

View File

@ -89,8 +89,7 @@ class Steam
* [yyyy-mm-dd] => 123,2 * [yyyy-mm-dd] => 123,2
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function balanceInRange(Account $account, Carbon $start, Carbon $end, ?TransactionCurrency $currency = null): array public function balanceInRange(Account $account, Carbon $start, Carbon $end, ?TransactionCurrency $currency = null): array
{ {
$cache = new CacheProperties(); $cache = new CacheProperties();

View File

@ -121,8 +121,7 @@ class ConvertToDeposit implements ActionInterface
* Is converted to a deposit from C to A. * Is converted to a deposit from C to A.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function convertWithdrawalArray(TransactionJournal $journal): bool private function convertWithdrawalArray(TransactionJournal $journal): bool
{ {
$user = $journal->user; $user = $journal->user;
@ -211,8 +210,7 @@ class ConvertToDeposit implements ActionInterface
* The source account is replaced. * The source account is replaced.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function convertTransferArray(TransactionJournal $journal): bool private function convertTransferArray(TransactionJournal $journal): bool
{ {
$user = $journal->user; $user = $journal->user;

View File

@ -116,8 +116,7 @@ class ConvertToWithdrawal implements ActionInterface
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function convertDepositArray(TransactionJournal $journal): bool private function convertDepositArray(TransactionJournal $journal): bool
{ {
$user = $journal->user; $user = $journal->user;
@ -203,8 +202,7 @@ class ConvertToWithdrawal implements ActionInterface
* Output is a withdrawal from A to C. * Output is a withdrawal from A to C.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function convertTransferArray(TransactionJournal $journal): bool private function convertTransferArray(TransactionJournal $journal): bool
{ {
// find or create expense account. // find or create expense account.

View File

@ -49,8 +49,7 @@ class AccountTransformer extends AbstractTransformer
* Transform the account. * Transform the account.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function transform(Account $account): array public function transform(Account $account): array
{ {
$this->repository->setUser($account->user); $this->repository->setUser($account->user);
@ -157,8 +156,7 @@ class AccountTransformer extends AbstractTransformer
/** /**
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
private function getCurrency(Account $account): array private function getCurrency(Account $account): array
{ {
$currency = $this->repository->getAccountCurrency($account); $currency = $this->repository->getAccountCurrency($account);

View File

@ -49,8 +49,7 @@ class PiggyBankEventTransformer extends AbstractTransformer
* Convert piggy bank event. * Convert piggy bank event.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function transform(PiggyBankEvent $event): array public function transform(PiggyBankEvent $event): array
{ {
// get account linked to piggy bank // get account linked to piggy bank

View File

@ -50,8 +50,7 @@ class PiggyBankTransformer extends AbstractTransformer
* Transform the piggy bank. * Transform the piggy bank.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function transform(PiggyBank $piggyBank): array public function transform(PiggyBank $piggyBank): array
{ {
$account = $piggyBank->account; $account = $piggyBank->account;

View File

@ -139,8 +139,7 @@ class PiggyBankTransformer extends AbstractTransformer
* Transform the piggy bank. * Transform the piggy bank.
* *
* @throws FireflyException * @throws FireflyException
* @throws \JsonException * */
*/
public function transform(PiggyBank $piggyBank): array public function transform(PiggyBank $piggyBank): array
{ {
// $account = $piggyBank->account; // $account = $piggyBank->account;

View File

@ -30,8 +30,7 @@ use Illuminate\Validation\Validator;
trait ValidatesBulkTransactionQuery trait ValidatesBulkTransactionQuery
{ {
/** /**
* @throws \JsonException * */
*/
protected function validateTransactionQuery(Validator $validator): void protected function validateTransactionQuery(Validator $validator): void
{ {
$data = $validator->getData(); $data = $validator->getData();