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
52 changed files with 105 additions and 211 deletions

View File

@@ -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 */

View File

@@ -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);

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.
*
* @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 */

View File

@@ -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;

View File

@@ -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:

View File

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

View File

@@ -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);

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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);