diff --git a/app/Http/Controllers/Json/RecurrenceController.php b/app/Http/Controllers/Json/RecurrenceController.php index e2372d7b7a..7eafb0069b 100644 --- a/app/Http/Controllers/Json/RecurrenceController.php +++ b/app/Http/Controllers/Json/RecurrenceController.php @@ -107,17 +107,16 @@ class RecurrenceController extends Controller $repetition->weekend = (int)$request->get('weekend'); $actualEnd = clone $end; - if('until_date' === $endsAt) { + if ('until_date' === $endsAt) { $actualEnd = $endDate ?? clone $end; $occurrences = $this->recurring->getOccurrencesInRange($repetition, $actualStart, $actualEnd); } - if('times' === $endsAt) { + if ('times' === $endsAt) { $occurrences = $this->recurring->getXOccurrences($repetition, $actualStart, $repetitions); } - if('times' !== $endsAt && 'until_date' !== $endsAt) { + if ('times' !== $endsAt && 'until_date' !== $endsAt) { // 'forever' $occurrences = $this->recurring->getOccurrencesInRange($repetition, $actualStart, $actualEnd); - } /** @var Carbon $current */ diff --git a/app/Http/Requests/RecurrenceFormRequest.php b/app/Http/Requests/RecurrenceFormRequest.php index 58d510ada1..16076efd43 100644 --- a/app/Http/Requests/RecurrenceFormRequest.php +++ b/app/Http/Requests/RecurrenceFormRequest.php @@ -315,22 +315,22 @@ class RecurrenceFormRequest extends FormRequest // TODO either use 'withdrawal' or the strtolower() variant, not both. $type = $this->convertString('transaction_type'); $throwError = true; - if('withdrawal' === $type) { + if ('withdrawal' === $type) { $throwError = false; $sourceId = (int)$data['source_id']; $destinationId = (int)$data['withdrawal_destination_id']; } - if('deposit' === $type) { + if ('deposit' === $type) { $throwError = false; $sourceId = (int)$data['deposit_source_id']; $destinationId = (int)$data['destination_id']; } - if('transfer' === $type) { + if ('transfer' === $type) { $throwError = false; $sourceId = (int)$data['source_id']; $destinationId = (int)$data['destination_id']; } - if(true === $throwError) { + if (true === $throwError) { throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->convertString('transaction_type'))); } diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 4ba3a787ce..cef6d344a5 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -331,7 +331,7 @@ class BudgetRepository implements BudgetRepositoryInterface return; } if (null !== $dbNote) { - $dbNote->delete(); + $dbNote->delete(); } } diff --git a/app/Services/Internal/Destroy/BillDestroyService.php b/app/Services/Internal/Destroy/BillDestroyService.php index 929242a6b7..d2b2522584 100644 --- a/app/Services/Internal/Destroy/BillDestroyService.php +++ b/app/Services/Internal/Destroy/BillDestroyService.php @@ -37,6 +37,6 @@ class BillDestroyService */ public function destroy(Bill $bill): void { - $bill->delete(); + $bill->delete(); } } diff --git a/app/Services/Internal/Destroy/BudgetDestroyService.php b/app/Services/Internal/Destroy/BudgetDestroyService.php index fe6bbd1126..cea4e6fd3e 100644 --- a/app/Services/Internal/Destroy/BudgetDestroyService.php +++ b/app/Services/Internal/Destroy/BudgetDestroyService.php @@ -39,7 +39,7 @@ class BudgetDestroyService */ public function destroy(Budget $budget): void { - $budget->delete(); + $budget->delete(); // also delete auto budget: foreach ($budget->autoBudgets()->get() as $autoBudget) { diff --git a/app/Services/Internal/Destroy/CategoryDestroyService.php b/app/Services/Internal/Destroy/CategoryDestroyService.php index 376ba11e60..ee00647357 100644 --- a/app/Services/Internal/Destroy/CategoryDestroyService.php +++ b/app/Services/Internal/Destroy/CategoryDestroyService.php @@ -39,7 +39,7 @@ class CategoryDestroyService */ public function destroy(Category $category): void { - $category->delete(); + $category->delete(); // also delete all relations between categories and transaction journals: DB::table('category_transaction_journal')->where('category_id', (int)$category->id)->delete(); diff --git a/app/Services/Internal/Destroy/CurrencyDestroyService.php b/app/Services/Internal/Destroy/CurrencyDestroyService.php index a62dc2a070..70ecf99d43 100644 --- a/app/Services/Internal/Destroy/CurrencyDestroyService.php +++ b/app/Services/Internal/Destroy/CurrencyDestroyService.php @@ -38,6 +38,6 @@ class CurrencyDestroyService */ public function destroy(TransactionCurrency $currency): void { - $currency->delete(); + $currency->delete(); } } diff --git a/app/Services/Internal/Support/RecurringTransactionTrait.php b/app/Services/Internal/Support/RecurringTransactionTrait.php index a6701c49a3..bb7157aa5e 100644 --- a/app/Services/Internal/Support/RecurringTransactionTrait.php +++ b/app/Services/Internal/Support/RecurringTransactionTrait.php @@ -61,7 +61,7 @@ trait RecurringTransactionTrait if ('' === $note) { $dbNote = $recurrence->notes()->first(); if (null !== $dbNote) { - $dbNote->delete(); + $dbNote->delete(); } return true; @@ -373,8 +373,7 @@ trait RecurringTransactionTrait foreach ($recurrence->recurrenceTransactions as $transaction) { $transaction->recurrenceTransactionMeta()->delete(); - $transaction->delete(); - + $transaction->delete(); } } } diff --git a/app/Services/Internal/Update/CategoryUpdateService.php b/app/Services/Internal/Update/CategoryUpdateService.php index 5d01c99bf7..e8bc406803 100644 --- a/app/Services/Internal/Update/CategoryUpdateService.php +++ b/app/Services/Internal/Update/CategoryUpdateService.php @@ -153,9 +153,7 @@ class CategoryUpdateService if ('' === $note) { $dbNote = $category->notes()->first(); if (null !== $dbNote) { - - $dbNote->delete(); - + $dbNote->delete(); } return; diff --git a/app/Services/Internal/Update/RecurrenceUpdateService.php b/app/Services/Internal/Update/RecurrenceUpdateService.php index 03f9a73874..dfce5f715f 100644 --- a/app/Services/Internal/Update/RecurrenceUpdateService.php +++ b/app/Services/Internal/Update/RecurrenceUpdateService.php @@ -132,7 +132,7 @@ class RecurrenceUpdateService return; } if (null !== $dbNote && '' === $text) { - $dbNote->delete(); + $dbNote->delete(); } } diff --git a/app/Support/FireflyConfig.php b/app/Support/FireflyConfig.php index 90ca98e25a..ec559a59c9 100644 --- a/app/Support/FireflyConfig.php +++ b/app/Support/FireflyConfig.php @@ -46,7 +46,7 @@ class FireflyConfig if (Cache::has($fullName)) { Cache::forget($fullName); } - Configuration::where('name', $name)->forceDelete(); + Configuration::where('name', $name)->forceDelete(); } /** diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index 4d43830659..10390fe799 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -113,7 +113,7 @@ class Preferences if (Cache::has($fullName)) { Cache::forget($fullName); } - Preference::where('user_id', auth()->user()->id)->where('name', $name)->delete(); + Preference::where('user_id', auth()->user()->id)->where('name', $name)->delete(); return true; } @@ -145,7 +145,7 @@ class Preferences $pref = Preference::where('user_id', $user->id)->where('name', $name)->first(['id', 'name', 'data', 'updated_at', 'created_at']); if (null !== $pref && null === $value) { - $pref->delete(); + $pref->delete(); return new Preference(); }