Various code cleanup.

This commit is contained in:
James Cole
2025-10-05 12:57:58 +02:00
parent 072212c112
commit 6341743cf9
169 changed files with 482 additions and 305 deletions

View File

@@ -61,8 +61,11 @@ class ExportController extends Controller
} }
/** /**
* @throws FireflyException * @param ExportRequest $request
* *
* @return LaravelResponse
* @throws DatetimeException
* @throws FireflyException
* @SuppressWarnings("PHPMD.UnusedFormalParameter") * @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/ */
public function accounts(ExportRequest $request): LaravelResponse public function accounts(ExportRequest $request): LaravelResponse
@@ -100,8 +103,11 @@ class ExportController extends Controller
} }
/** /**
* @throws FireflyException * @param ExportRequest $request
* *
* @return LaravelResponse
* @throws DatetimeException
* @throws FireflyException
* @SuppressWarnings("PHPMD.UnusedFormalParameter") * @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/ */
public function bills(ExportRequest $request): LaravelResponse public function bills(ExportRequest $request): LaravelResponse
@@ -112,8 +118,11 @@ class ExportController extends Controller
} }
/** /**
* @throws FireflyException * @param ExportRequest $request
* *
* @return LaravelResponse
* @throws DatetimeException
* @throws FireflyException
* @SuppressWarnings("PHPMD.UnusedFormalParameter") * @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/ */
public function budgets(ExportRequest $request): LaravelResponse public function budgets(ExportRequest $request): LaravelResponse
@@ -124,8 +133,11 @@ class ExportController extends Controller
} }
/** /**
* @throws FireflyException * @param ExportRequest $request
* *
* @return LaravelResponse
* @throws DatetimeException
* @throws FireflyException
* @SuppressWarnings("PHPMD.UnusedFormalParameter") * @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/ */
public function categories(ExportRequest $request): LaravelResponse public function categories(ExportRequest $request): LaravelResponse
@@ -136,8 +148,11 @@ class ExportController extends Controller
} }
/** /**
* @throws FireflyException * @param ExportRequest $request
* *
* @return LaravelResponse
* @throws DatetimeException
* @throws FireflyException
* @SuppressWarnings("PHPMD.UnusedFormalParameter") * @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/ */
public function piggyBanks(ExportRequest $request): LaravelResponse public function piggyBanks(ExportRequest $request): LaravelResponse
@@ -148,8 +163,11 @@ class ExportController extends Controller
} }
/** /**
* @throws FireflyException * @param ExportRequest $request
* *
* @return LaravelResponse
* @throws DatetimeException
* @throws FireflyException
* @SuppressWarnings("PHPMD.UnusedFormalParameter") * @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/ */
public function recurring(ExportRequest $request): LaravelResponse public function recurring(ExportRequest $request): LaravelResponse
@@ -160,8 +178,11 @@ class ExportController extends Controller
} }
/** /**
* @throws FireflyException * @param ExportRequest $request
* *
* @return LaravelResponse
* @throws DatetimeException
* @throws FireflyException
* @SuppressWarnings("PHPMD.UnusedFormalParameter") * @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/ */
public function rules(ExportRequest $request): LaravelResponse public function rules(ExportRequest $request): LaravelResponse
@@ -172,8 +193,11 @@ class ExportController extends Controller
} }
/** /**
* @throws FireflyException * @param ExportRequest $request
* *
* @return LaravelResponse
* @throws DatetimeException
* @throws FireflyException
* @SuppressWarnings("PHPMD.UnusedFormalParameter") * @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/ */
public function tags(ExportRequest $request): LaravelResponse public function tags(ExportRequest $request): LaravelResponse
@@ -184,6 +208,10 @@ class ExportController extends Controller
} }
/** /**
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws DatetimeException
* @throws FireflyException * @throws FireflyException
*/ */
public function transactions(ExportRequest $request): LaravelResponse public function transactions(ExportRequest $request): LaravelResponse

View File

@@ -71,7 +71,6 @@ class ListController extends Controller
} }
/** /**
* @throws FireflyException
*/ */
public function attachments(Account $account): JsonResponse public function attachments(Account $account): JsonResponse
{ {
@@ -97,7 +96,6 @@ class ListController extends Controller
} }
/** /**
* @throws FireflyException
*/ */
public function piggyBanks(Account $account): JsonResponse public function piggyBanks(Account $account): JsonResponse
{ {
@@ -136,7 +134,6 @@ class ListController extends Controller
/** /**
* Show all transaction groups related to the account. * Show all transaction groups related to the account.
* *
* @throws FireflyException
*/ */
public function transactions(Request $request, Account $account): JsonResponse public function transactions(Request $request, Account $account): JsonResponse
{ {

View File

@@ -69,7 +69,6 @@ class ShowController extends Controller
/** /**
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function index(ShowRequest $request): JsonResponse public function index(ShowRequest $request): JsonResponse
{ {

View File

@@ -120,7 +120,6 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -68,7 +68,6 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -72,7 +72,6 @@ class ListController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function attachments(Bill $bill): JsonResponse public function attachments(Bill $bill): JsonResponse
{ {
@@ -103,7 +102,6 @@ class ListController extends Controller
* *
* List all of them. * List all of them.
* *
* @throws FireflyException
*/ */
public function rules(Bill $bill): JsonResponse public function rules(Bill $bill): JsonResponse
{ {
@@ -136,7 +134,6 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @throws FireflyException
*/ */
public function transactions(Request $request, Bill $bill): JsonResponse public function transactions(Request $request, Bill $bill): JsonResponse
{ {

View File

@@ -66,7 +66,6 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -74,7 +74,6 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listAttachmentByBudget * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listAttachmentByBudget
* *
* @throws FireflyException
*/ */
public function attachments(Budget $budget): JsonResponse public function attachments(Budget $budget): JsonResponse
{ {
@@ -105,7 +104,6 @@ class ListController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function budgetLimits(Budget $budget): JsonResponse public function budgetLimits(Budget $budget): JsonResponse
{ {
@@ -141,7 +139,6 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @throws FireflyException
*/ */
public function transactions(Request $request, Budget $budget): JsonResponse public function transactions(Request $request, Budget $budget): JsonResponse
{ {
@@ -203,7 +200,6 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @throws FireflyException
*/ */
public function withoutBudget(Request $request): JsonResponse public function withoutBudget(Request $request): JsonResponse
{ {

View File

@@ -70,7 +70,6 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -50,7 +50,6 @@ class ListController extends Controller
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionByBudgetLimit * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionByBudgetLimit
* Show all transactions. * Show all transactions.
* *
* @throws FireflyException
*/ */
public function transactions(Request $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse public function transactions(Request $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse
{ {

View File

@@ -69,7 +69,6 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listAttachmentByCategory * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listAttachmentByCategory
* *
* @throws FireflyException
*/ */
public function attachments(Category $category): JsonResponse public function attachments(Category $category): JsonResponse
{ {
@@ -100,7 +99,6 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @throws FireflyException
*/ */
public function transactions(Request $request, Category $category): JsonResponse public function transactions(Request $request, Category $category): JsonResponse
{ {

View File

@@ -66,7 +66,6 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -69,7 +69,6 @@ class ListController extends Controller
* *
* List all bills in this object group * List all bills in this object group
* *
* @throws FireflyException
*/ */
public function bills(ObjectGroup $objectGroup): JsonResponse public function bills(ObjectGroup $objectGroup): JsonResponse
{ {
@@ -110,7 +109,6 @@ class ListController extends Controller
* *
* List all piggies under the object group. * List all piggies under the object group.
* *
* @throws FireflyException
*/ */
public function piggyBanks(ObjectGroup $objectGroup): JsonResponse public function piggyBanks(ObjectGroup $objectGroup): JsonResponse
{ {

View File

@@ -68,7 +68,6 @@ class ListController extends Controller
* *
* List single resource. * List single resource.
* *
* @throws FireflyException
*/ */
public function accounts(PiggyBank $piggyBank): JsonResponse public function accounts(PiggyBank $piggyBank): JsonResponse
{ {
@@ -106,7 +105,6 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAttachmentByPiggyBank * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAttachmentByPiggyBank
* *
* @throws FireflyException
*/ */
public function attachments(PiggyBank $piggyBank): JsonResponse public function attachments(PiggyBank $piggyBank): JsonResponse
{ {
@@ -137,7 +135,6 @@ class ListController extends Controller
* *
* List single resource. * List single resource.
* *
* @throws FireflyException
*/ */
public function piggyBankEvents(PiggyBank $piggyBank): JsonResponse public function piggyBankEvents(PiggyBank $piggyBank): JsonResponse
{ {

View File

@@ -66,7 +66,6 @@ class ShowController extends Controller
* *
* List all of them. * List all of them.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -69,7 +69,6 @@ class ListController extends Controller
* *
* Show transactions for this recurrence. * Show transactions for this recurrence.
* *
* @throws FireflyException
*/ */
public function transactions(Request $request, Recurrence $recurrence): JsonResponse public function transactions(Request $request, Recurrence $recurrence): JsonResponse
{ {

View File

@@ -66,7 +66,6 @@ class ShowController extends Controller
* *
* List all of them. * List all of them.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -87,9 +87,7 @@ class TriggerController extends Controller
// enrich groups and return them: // enrich groups and return them:
if (0 === $groups->count()) { $paginator = new LengthAwarePaginator(new Collection(), 0, 1);
$paginator = new LengthAwarePaginator(new Collection(), 0, 1);
}
if ($groups->count() > 0) { if ($groups->count() > 0) {
/** @var User $admin */ /** @var User $admin */
$admin = auth()->user(); $admin = auth()->user();

View File

@@ -68,7 +68,6 @@ class ShowController extends Controller
* *
* List all of them. * List all of them.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -65,7 +65,6 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rule_groups/listRuleByGroup * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rule_groups/listRuleByGroup
* *
* @throws FireflyException
*/ */
public function rules(RuleGroup $group): JsonResponse public function rules(RuleGroup $group): JsonResponse
{ {

View File

@@ -67,7 +67,6 @@ class ShowController extends Controller
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rule_groups/listRuleGroup * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rule_groups/listRuleGroup
* List all of them. * List all of them.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -72,7 +72,6 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/tags/listAttachmentByTag * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/tags/listAttachmentByTag
* *
* @throws FireflyException
*/ */
public function attachments(Tag $tag): JsonResponse public function attachments(Tag $tag): JsonResponse
{ {
@@ -103,7 +102,6 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @throws FireflyException
*/ */
public function transactions(Request $request, Tag $tag): JsonResponse public function transactions(Request $request, Tag $tag): JsonResponse
{ {

View File

@@ -68,7 +68,6 @@ class ShowController extends Controller
* *
* List all of them. * List all of them.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -70,7 +70,6 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listAttachmentByTransaction * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listAttachmentByTransaction
* *
* @throws FireflyException
*/ */
public function attachments(TransactionGroup $transactionGroup): JsonResponse public function attachments(TransactionGroup $transactionGroup): JsonResponse
{ {
@@ -102,7 +101,6 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listEventByTransaction * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listEventByTransaction
* *
* @throws FireflyException
*/ */
public function piggyBankEvents(TransactionGroup $transactionGroup): JsonResponse public function piggyBankEvents(TransactionGroup $transactionGroup): JsonResponse
{ {
@@ -145,7 +143,6 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listLinksByJournal * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/listLinksByJournal
* *
* @throws FireflyException
*/ */
public function transactionLinks(TransactionJournal $transactionJournal): JsonResponse public function transactionLinks(TransactionJournal $transactionJournal): JsonResponse
{ {

View File

@@ -53,7 +53,6 @@ class ShowController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @throws FireflyException
*/ */
public function index(Request $request): JsonResponse public function index(Request $request): JsonResponse
{ {

View File

@@ -72,7 +72,6 @@ class ListController extends Controller
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listAccountByCurrency * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listAccountByCurrency
* Display a list of accounts. * Display a list of accounts.
* *
* @throws FireflyException
*/ */
public function accounts(Request $request, TransactionCurrency $currency): JsonResponse public function accounts(Request $request, TransactionCurrency $currency): JsonResponse
{ {
@@ -130,7 +129,6 @@ class ListController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function availableBudgets(TransactionCurrency $currency): JsonResponse public function availableBudgets(TransactionCurrency $currency): JsonResponse
{ {
@@ -165,7 +163,6 @@ class ListController extends Controller
* *
* List all bills * List all bills
* *
* @throws FireflyException
*/ */
public function bills(TransactionCurrency $currency): JsonResponse public function bills(TransactionCurrency $currency): JsonResponse
{ {
@@ -212,7 +209,6 @@ class ListController extends Controller
* *
* List all budget limits * List all budget limits
* *
* @throws FireflyException
*/ */
public function budgetLimits(TransactionCurrency $currency): JsonResponse public function budgetLimits(TransactionCurrency $currency): JsonResponse
{ {
@@ -250,7 +246,6 @@ class ListController extends Controller
* *
* List all recurring transactions. * List all recurring transactions.
* *
* @throws FireflyException
*/ */
public function recurrences(TransactionCurrency $currency): JsonResponse public function recurrences(TransactionCurrency $currency): JsonResponse
{ {
@@ -303,7 +298,6 @@ class ListController extends Controller
* *
* List all of them. * List all of them.
* *
* @throws FireflyException
*/ */
public function rules(TransactionCurrency $currency): JsonResponse public function rules(TransactionCurrency $currency): JsonResponse
{ {
@@ -348,7 +342,6 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @throws FireflyException
*/ */
public function transactions(Request $request, TransactionCurrency $currency): JsonResponse public function transactions(Request $request, TransactionCurrency $currency): JsonResponse
{ {

View File

@@ -70,7 +70,6 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {
@@ -100,7 +99,6 @@ class ShowController extends Controller
* *
* Show a currency. * Show a currency.
* *
* @throws FireflyException
*/ */
public function show(TransactionCurrency $currency): JsonResponse public function show(TransactionCurrency $currency): JsonResponse
{ {
@@ -124,7 +122,6 @@ class ShowController extends Controller
/** /**
* Show a currency. * Show a currency.
* *
* @throws FireflyException
*/ */
public function showPrimary(): JsonResponse public function showPrimary(): JsonResponse
{ {

View File

@@ -67,7 +67,6 @@ class StoreController extends Controller
* *
* Store new currency. * Store new currency.
* *
* @throws FireflyException
*/ */
public function store(StoreRequest $request): JsonResponse public function store(StoreRequest $request): JsonResponse
{ {

View File

@@ -99,7 +99,6 @@ class UpdateController extends Controller
} }
/** /**
* @throws FireflyException
*/ */
public function makePrimary(TransactionCurrency $currency): JsonResponse public function makePrimary(TransactionCurrency $currency): JsonResponse
{ {
@@ -128,7 +127,6 @@ class UpdateController extends Controller
* *
* Enable a currency. * Enable a currency.
* *
* @throws FireflyException
*/ */
public function enable(TransactionCurrency $currency): JsonResponse public function enable(TransactionCurrency $currency): JsonResponse
{ {

View File

@@ -70,7 +70,6 @@ class ShowController extends Controller
* *
* List all transaction links there are. * List all transaction links there are.
* *
* @throws FireflyException
*/ */
public function index(Request $request): JsonResponse public function index(Request $request): JsonResponse
{ {

View File

@@ -69,7 +69,6 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listTransactionByLinkType * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listTransactionByLinkType
* *
* @throws FireflyException
*/ */
public function transactions(Request $request, LinkType $linkType): JsonResponse public function transactions(Request $request, LinkType $linkType): JsonResponse
{ {

View File

@@ -68,7 +68,6 @@ class ShowController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listLinkType * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/links/listLinkType
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -43,7 +43,6 @@ class TransactionController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/search/searchTransactions * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/search/searchTransactions
* *
* @throws FireflyException
*/ */
public function search(Request $request, SearchInterface $searcher): JsonResponse public function search(Request $request, SearchInterface $searcher): JsonResponse
{ {

View File

@@ -91,7 +91,6 @@ class UserController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -50,7 +50,6 @@ class PreferencesController extends Controller
* *
* List all of them. * List all of them.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -63,7 +63,6 @@ class MessageController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/webhooks/getWebhookMessages * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/webhooks/getWebhookMessages
* *
* @throws FireflyException
*/ */
public function index(Webhook $webhook): JsonResponse public function index(Webhook $webhook): JsonResponse
{ {

View File

@@ -71,7 +71,6 @@ class ShowController extends Controller
* *
* Display a listing of the webhooks of the user. * Display a listing of the webhooks of the user.
* *
* @throws FireflyException
*/ */
public function index(): JsonResponse public function index(): JsonResponse
{ {

View File

@@ -92,7 +92,6 @@ class ConvertsDatesToUTC extends Command
$this->friendlyInfo(sprintf('Converting field "%s" of model "%s" to UTC.', $field, $shortModel)); $this->friendlyInfo(sprintf('Converting field "%s" of model "%s" to UTC.', $field, $shortModel));
$items->each( $items->each(
function ($item) use ($field, $timezoneField): void { function ($item) use ($field, $timezoneField): void {
/** @var Carbon $date */
$date = Carbon::parse($item->{$field}, $item->{$timezoneField}); // @phpstan-ignore-line $date = Carbon::parse($item->{$field}, $item->{$timezoneField}); // @phpstan-ignore-line
$date->setTimezone('UTC'); $date->setTimezone('UTC');
$item->{$field} = $date->format('Y-m-d H:i:s'); // @phpstan-ignore-line $item->{$field} = $date->format('Y-m-d H:i:s'); // @phpstan-ignore-line

View File

@@ -135,9 +135,7 @@ class RemovesOrphanedTransactions extends Command
// delete journals // delete journals
/** @var null|TransactionJournal $journal */ /** @var null|TransactionJournal $journal */
$journal = TransactionJournal::find($transaction->transaction_journal_id); $journal = TransactionJournal::find($transaction->transaction_journal_id);
if (null !== $journal) { $journal?->delete();
$journal->delete();
}
Transaction::where('transaction_journal_id', $transaction->transaction_journal_id)->delete(); Transaction::where('transaction_journal_id', $transaction->transaction_journal_id)->delete();
$this->friendlyWarning( $this->friendlyWarning(
sprintf( sprintf(

View File

@@ -40,6 +40,7 @@ use Exception;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use InvalidArgumentException; use InvalidArgumentException;
use Safe\Exceptions\FilesystemException;
use function Safe\file_put_contents; use function Safe\file_put_contents;
class ExportsData extends Command class ExportsData extends Command
@@ -275,7 +276,11 @@ class ExportsData extends Command
} }
/** /**
* @param array $options
* @param array $data
*
* @throws FireflyException * @throws FireflyException
* @throws FilesystemException
*/ */
private function exportData(array $options, array $data): void private function exportData(array $options, array $data): void
{ {

View File

@@ -42,7 +42,7 @@ class CallsLaravelPassportKeys extends Command
*/ */
public function handle(): int public function handle(): int
{ {
Artisan::call('passport:keys --no-interaction', []); Artisan::call('passport:keys --no-interaction');
$result = Artisan::output(); $result = Artisan::output();
if (str_contains($result, 'Encryption keys already exist')) { if (str_contains($result, 'Encryption keys already exist')) {
$this->friendlyInfo('Encryption keys exist already.'); $this->friendlyInfo('Encryption keys exist already.');

View File

@@ -156,7 +156,6 @@ class ForcesDecimalSize extends Command
*/ */
private function correctAmountsByCurrency(): void private function correctAmountsByCurrency(): void
{ {
/** @var Collection $enabled */
$enabled = TransactionCurrency::whereEnabled(1)->get(); $enabled = TransactionCurrency::whereEnabled(1)->get();
/** @var TransactionCurrency $currency */ /** @var TransactionCurrency $currency */
@@ -301,7 +300,7 @@ class ForcesDecimalSize extends Command
} }
); );
$result = $query->get(['*']); $result = $query->get();
if (0 === $result->count()) { if (0 === $result->count()) {
$this->friendlyPositive(sprintf('All %s in %s are OK', $table, $currency->code)); $this->friendlyPositive(sprintf('All %s in %s are OK', $table, $currency->code));
@@ -533,7 +532,7 @@ class ForcesDecimalSize extends Command
DB::raw(sprintf($this->regularExpression, $currency->decimal_places)) DB::raw(sprintf($this->regularExpression, $currency->decimal_places))
); );
$result = $query->get(['*']); $result = $query->get();
if (0 === $result->count()) { if (0 === $result->count()) {
$this->friendlyPositive(sprintf('All transactions in foreign currency %s are OK', $currency->code)); $this->friendlyPositive(sprintf('All transactions in foreign currency %s are OK', $currency->code));

View File

@@ -31,6 +31,7 @@ use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use League\Flysystem\FilesystemException; use League\Flysystem\FilesystemException;
use Safe\Exceptions\JsonException;
use function Safe\json_decode; use function Safe\json_decode;
class VerifySecurityAlerts extends Command class VerifySecurityAlerts extends Command
@@ -44,7 +45,9 @@ class VerifySecurityAlerts extends Command
/** /**
* Execute the console command. * Execute the console command.
* *
* @return int
* @throws FilesystemException * @throws FilesystemException
* @throws JsonException
*/ */
public function handle(): int public function handle(): int
{ {

View File

@@ -54,7 +54,6 @@ class AddsTransactionIdentifiers extends Command
* When either of these are the same amount, FF3 can't keep them apart: +3/-3, +3/-3, +3/-3. This happens more * When either of these are the same amount, FF3 can't keep them apart: +3/-3, +3/-3, +3/-3. This happens more
* often than you would think. So each set gets a number (1,2,3) to keep them apart. * often than you would think. So each set gets a number (1,2,3) to keep them apart.
* *
* @throws FireflyException
*/ */
public function handle(): int public function handle(): int
{ {
@@ -101,11 +100,8 @@ class AddsTransactionIdentifiers extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
/** /**

View File

@@ -99,11 +99,8 @@ class RemovesDatabaseDecryption extends Command
} catch (FireflyException $e) { } catch (FireflyException $e) {
Log::error($e->getMessage()); Log::error($e->getMessage());
} }
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function decryptField(string $table, string $field): void private function decryptField(string $table, string $field): void

View File

@@ -100,7 +100,6 @@ class UpgradesAccountCurrencies extends Command
} }
/** /**
* @throws FireflyException
*/ */
private function updateCurrenciesForUser(User $user): void private function updateCurrenciesForUser(User $user): void
{ {

View File

@@ -83,11 +83,8 @@ class UpgradesAccountMetaData extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function markAsExecuted(): void private function markAsExecuted(): void

View File

@@ -93,11 +93,8 @@ class UpgradesAttachments extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function markAsExecuted(): void private function markAsExecuted(): void

View File

@@ -99,17 +99,13 @@ class UpgradesBillsToRules extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
/** /**
* Migrate bills to new rule structure for a specific user. * Migrate bills to new rule structure for a specific user.
* *
* @throws FireflyException
*/ */
private function migrateUser(User $user): void private function migrateUser(User $user): void
{ {

View File

@@ -85,11 +85,8 @@ class UpgradesBudgetLimits extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function markAsExecuted(): void private function markAsExecuted(): void

View File

@@ -66,11 +66,8 @@ class UpgradesCurrencyPreferences extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool)$configVar->data;
}
return false;
} }
private function runUpgrade(): void private function runUpgrade(): void

View File

@@ -87,11 +87,8 @@ class UpgradesJournalNotes extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function markAsExecuted(): void private function markAsExecuted(): void

View File

@@ -62,11 +62,8 @@ class UpgradesLiabilities extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function upgradeLiabilities(): void private function upgradeLiabilities(): void

View File

@@ -64,11 +64,8 @@ class UpgradesLiabilitiesEight extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function upgradeLiabilities(): void private function upgradeLiabilities(): void

View File

@@ -65,11 +65,8 @@ class UpgradesMultiPiggyBanks extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function upgradePiggyBanks(): void private function upgradePiggyBanks(): void

View File

@@ -61,11 +61,8 @@ class UpgradesPrimaryCurrencyAmounts extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function markAsExecuted(): void private function markAsExecuted(): void

View File

@@ -66,11 +66,8 @@ class UpgradesRecurrenceMetaData extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function migrateMetaData(): int private function migrateMetaData(): int

View File

@@ -64,11 +64,8 @@ class UpgradesRuleActions extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function replaceEqualSign(): void private function replaceEqualSign(): void

View File

@@ -58,11 +58,8 @@ class UpgradesTagLocations extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
private function migrateTagLocations(): void private function migrateTagLocations(): void

View File

@@ -98,11 +98,8 @@ class UpgradesToGroups extends Command
private function isMigrated(): bool private function isMigrated(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
/** /**

View File

@@ -106,11 +106,8 @@ class UpgradesTransferCurrencies extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
/** /**

View File

@@ -87,11 +87,8 @@ class UpgradesVariousCurrencyInformation extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool) $configVar->data;
}
return false;
} }
/** /**

View File

@@ -64,11 +64,8 @@ class UpgradesWebhooks extends Command
private function isExecuted(): bool private function isExecuted(): bool
{ {
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false); $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
if (null !== $configVar) { return (bool)$configVar?->data;
return (bool)$configVar->data;
}
return false;
} }
private function upgradeWebhooks(): void private function upgradeWebhooks(): void

View File

@@ -65,7 +65,6 @@ trait VerifiesAccessToken
/** /**
* Returns false when given token does not match given user token. * Returns false when given token does not match given user token.
* *
* @throws FireflyException
*/ */
protected function verifyAccessToken(): bool protected function verifyAccessToken(): bool
{ {

View File

@@ -83,7 +83,6 @@ class AccountFactory
if (null === $return) { if (null === $return) {
Log::debug('Found nothing. Will create a new one.'); Log::debug('Found nothing. Will create a new one.');
/** @var Account $return */
$return = $this->create( $return = $this->create(
[ [
'user_id' => $this->user->id, 'user_id' => $this->user->id,

View File

@@ -343,7 +343,11 @@ class TransactionJournalFactory
/** /**
* If this transaction already exists, throw an error. * If this transaction already exists, throw an error.
* *
* @param string $hash
*
* @throws DuplicateTransactionException * @throws DuplicateTransactionException
* @throws JsonException
* @throws \Safe\Exceptions\JsonException
*/ */
private function errorIfDuplicate(string $hash): void private function errorIfDuplicate(string $hash): void
{ {
@@ -478,7 +482,6 @@ class TransactionJournalFactory
} }
/** /**
* @throws FireflyException
*/ */
private function getCurrency(?TransactionCurrency $currency, Account $account): TransactionCurrency private function getCurrency(?TransactionCurrency $currency, Account $account): TransactionCurrency
{ {

View File

@@ -165,7 +165,6 @@ class UserEventHandler
/** /**
* Set the demo user back to English. * Set the demo user back to English.
* *
* @throws FireflyException
*/ */
public function demoUserBackToEnglish(Login $event): void public function demoUserBackToEnglish(Login $event): void
{ {
@@ -183,7 +182,6 @@ class UserEventHandler
} }
/** /**
* @throws FireflyException
*/ */
public function notifyNewIPAddress(DetectedNewIPAddress $event): void public function notifyNewIPAddress(DetectedNewIPAddress $event): void
{ {
@@ -448,7 +446,6 @@ class UserEventHandler
} }
/** /**
* @throws FireflyException
*/ */
public function storeUserIPAddress(ActuallyLoggedIn $event): void public function storeUserIPAddress(ActuallyLoggedIn $event): void
{ {

View File

@@ -31,6 +31,8 @@ use FireflyIII\Helpers\Update\UpdateTrait;
use FireflyIII\Models\Configuration; use FireflyIII\Models\Configuration;
use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class VersionCheckEventHandler * Class VersionCheckEventHandler
@@ -42,7 +44,11 @@ class VersionCheckEventHandler
/** /**
* Checks with GitHub to see if there is a new version. * Checks with GitHub to see if there is a new version.
* *
* @param RequestedVersionCheckStatus $event
*
* @throws ContainerExceptionInterface
* @throws FireflyException * @throws FireflyException
* @throws NotFoundExceptionInterface
*/ */
#[Deprecated(message: '?')] #[Deprecated(message: '?')]
public function checkForUpdates(RequestedVersionCheckStatus $event): void public function checkForUpdates(RequestedVersionCheckStatus $event): void
@@ -87,7 +93,11 @@ class VersionCheckEventHandler
} }
/** /**
* @param RequestedVersionCheckStatus $event
*
* @throws FireflyException * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
protected function warnToCheckForUpdates(RequestedVersionCheckStatus $event): void protected function warnToCheckForUpdates(RequestedVersionCheckStatus $event): void
{ {

View File

@@ -37,6 +37,7 @@ use Illuminate\Support\Facades\Storage;
use Illuminate\Support\MessageBag; use Illuminate\Support\MessageBag;
use Safe\Exceptions\FileinfoException; use Safe\Exceptions\FileinfoException;
use Safe\Exceptions\FilesystemException; use Safe\Exceptions\FilesystemException;
use Safe\Exceptions\StringsException;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
use function Safe\tmpfile; use function Safe\tmpfile;
@@ -222,8 +223,11 @@ class AttachmentHelper implements AttachmentHelperInterface
/** /**
* Process the upload of a file. * Process the upload of a file.
* *
* @throws FireflyException * @param UploadedFile $file
* @throws EncryptException * @param Model $model
*
* @return Attachment|null
* @throws StringsException
*/ */
protected function processFile(UploadedFile $file, Model $model): ?Attachment protected function processFile(UploadedFile $file, Model $model): ?Attachment
{ {

View File

@@ -43,7 +43,6 @@ trait AccountCollection
Log::warning(sprintf('GroupCollector will be SLOW: accountBalanceIs: "%s" "%s" "%s"', $direction, $operator, $value)); Log::warning(sprintf('GroupCollector will be SLOW: accountBalanceIs: "%s" "%s" "%s"', $direction, $operator, $value));
/** /**
* @param int $index
* @param array $object * @param array $object
* *
* @return bool * @return bool

View File

@@ -41,7 +41,6 @@ trait AttachmentCollection
$this->withAttachmentInformation(); $this->withAttachmentInformation();
/** /**
* @param int $index
* @param array $object * @param array $object
* *
* @return bool * @return bool
@@ -120,7 +119,6 @@ trait AttachmentCollection
$this->withAttachmentInformation(); $this->withAttachmentInformation();
/** /**
* @param int $index
* @param array $object * @param array $object
* *
* @return bool * @return bool
@@ -155,7 +153,6 @@ trait AttachmentCollection
$this->withAttachmentInformation(); $this->withAttachmentInformation();
/** /**
* @param int $index
* @param array $object * @param array $object
* *
* @return bool * @return bool
@@ -190,7 +187,6 @@ trait AttachmentCollection
$this->withAttachmentInformation(); $this->withAttachmentInformation();
/** /**
* @param int $index
* @param array $object * @param array $object
* *
* @return bool * @return bool

View File

@@ -48,6 +48,7 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Override; use Override;
use Safe\Exceptions\JsonException;
use function Safe\json_decode; use function Safe\json_decode;
/** /**
@@ -564,7 +565,11 @@ class GroupCollector implements GroupCollectorInterface
} }
/** /**
* @param TransactionJournal $augumentedJournal
*
* @return array
* @throws FireflyException * @throws FireflyException
* @throws JsonException
*/ */
private function parseAugmentedJournal(TransactionJournal $augumentedJournal): array private function parseAugmentedJournal(TransactionJournal $augumentedJournal): array
{ {

View File

@@ -24,6 +24,8 @@ declare(strict_types=1);
namespace FireflyIII\Helpers\Fiscal; namespace FireflyIII\Helpers\Fiscal;
use Carbon\Carbon; use Carbon\Carbon;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class FiscalHelper. * Class FiscalHelper.
@@ -62,7 +64,11 @@ class FiscalHelper implements FiscalHelperInterface
} }
/** /**
* @param Carbon $date
*
* @return Carbon date object * @return Carbon date object
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function startOfFiscalYear(Carbon $date): Carbon public function startOfFiscalYear(Carbon $date): Carbon
{ {

View File

@@ -68,7 +68,7 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
// The actual JSON payload (i.e., the request body) // The actual JSON payload (i.e., the request body)
$timestamp = Carbon::now()->getTimestamp(); $timestamp = Carbon::now()->getTimestamp();
$payload = sprintf('%s.%s', $timestamp, $json); $payload = sprintf('%s.%s', $timestamp, $json);
$signature = hash_hmac('sha3-256', $payload, (string) $message->webhook->secret, false); $signature = hash_hmac('sha3-256', $payload, (string) $message->webhook->secret);
// signature string: // signature string:
// header included in each signed event contains a timestamp and one or more signatures. // header included in each signed event contains a timestamp and one or more signatures.

View File

@@ -37,6 +37,8 @@ use Illuminate\Http\Request;
use Illuminate\Routing\Redirector; use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class CreateController * Class CreateController
@@ -131,9 +133,12 @@ class CreateController extends Controller
/** /**
* Store the new account. * Store the new account.
* *
* @param AccountFormRequest $request
*
* @return Redirector|RedirectResponse * @return Redirector|RedirectResponse
* *
* @throws FireflyException * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function store(AccountFormRequest $request) public function store(AccountFormRequest $request)
{ {

View File

@@ -35,6 +35,8 @@ use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class IndexController * Class IndexController
@@ -66,10 +68,14 @@ class IndexController extends Controller
} }
/** /**
* @param Request $request
* @param string $objectType
*
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws ContainerExceptionInterface
* */ * @throws NotFoundExceptionInterface
*/
public function inactive(Request $request, string $objectType) public function inactive(Request $request, string $objectType)
{ {
$inactivePage = true; $inactivePage = true;
@@ -136,10 +142,14 @@ class IndexController extends Controller
/** /**
* Show list of accounts. * Show list of accounts.
* *
* @param Request $request
* @param string $objectType
*
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws ContainerExceptionInterface
* */ * @throws NotFoundExceptionInterface
*/
public function index(Request $request, string $objectType) public function index(Request $request, string $objectType)
{ {
app('log')->debug(sprintf('Now at %s', __METHOD__)); app('log')->debug(sprintf('Now at %s', __METHOD__));

View File

@@ -40,6 +40,8 @@ use Illuminate\Routing\Redirector;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/** /**
@@ -76,10 +78,17 @@ class ShowController extends Controller
/** /**
* Show an account. * Show an account.
* *
* @param Request $request
* @param Account $account
* @param Carbon|null $start
* @param Carbon|null $end
*
* @return Factory|Redirector|RedirectResponse|View * @return Factory|Redirector|RedirectResponse|View
* *
* @throws ContainerExceptionInterface
* @throws FireflyException * @throws FireflyException
* */ * @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)
{ {
if (0 === $account->id) { if (0 === $account->id) {
@@ -193,10 +202,14 @@ class ShowController extends Controller
/** /**
* Show an account. * Show an account.
* *
* @param Request $request
* @param Account $account
*
* @return Factory|Redirector|RedirectResponse|View * @return Factory|Redirector|RedirectResponse|View
* *
* @throws FireflyException * @throws ContainerExceptionInterface
* */ * @throws NotFoundExceptionInterface
*/
public function showAll(Request $request, Account $account) public function showAll(Request $request, Account $account)
{ {
if (!$this->isEditableAccount($account)) { if (!$this->isEditableAccount($account)) {

View File

@@ -28,6 +28,8 @@ use FireflyIII\Http\Middleware\IsDemoUser;
use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\Factory;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class HomeController. * Class HomeController.
@@ -47,6 +49,8 @@ class HomeController extends Controller
* Index of the admin. * Index of the admin.
* *
* @return Factory|View * @return Factory|View
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function index() public function index()
{ {

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin; namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Events\Admin\InvitationCreated; use FireflyIII\Events\Admin\InvitationCreated;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Http\Requests\InviteUserFormRequest; use FireflyIII\Http\Requests\InviteUserFormRequest;
@@ -37,6 +38,8 @@ use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Redirector; use Illuminate\Routing\Redirector;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class UserController. * Class UserController.
@@ -151,6 +154,9 @@ class UserController extends Controller
* Show index of user manager. * Show index of user manager.
* *
* @return Factory|View * @return Factory|View
* @throws ContainerExceptionInterface
* @throws FireflyException
* @throws NotFoundExceptionInterface
*/ */
public function index() public function index()
{ {

View File

@@ -194,7 +194,6 @@ class AttachmentController extends Controller
* View attachment in browser. * View attachment in browser.
* *
* @throws FireflyException * @throws FireflyException
* @throws BindingResolutionException
*/ */
public function view(Attachment $attachment): LaravelResponse public function view(Attachment $attachment): LaravelResponse
{ {

View File

@@ -33,6 +33,8 @@ use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Safe\Exceptions\UrlException; use Safe\Exceptions\UrlException;
use function Safe\parse_url; use function Safe\parse_url;
@@ -60,7 +62,11 @@ class ForgotPasswordController extends Controller
/** /**
* Send a reset link to the given user. * Send a reset link to the given user.
* *
* @param Request $request
* @param UserRepositoryInterface $repository
*
* @return Factory|RedirectResponse|View * @return Factory|RedirectResponse|View
* @throws FireflyException
*/ */
public function sendResetLinkEmail(Request $request, UserRepositoryInterface $repository) public function sendResetLinkEmail(Request $request, UserRepositoryInterface $repository)
{ {
@@ -126,6 +132,8 @@ class ForgotPasswordController extends Controller
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function showLinkRequestForm() public function showLinkRequestForm()
{ {

View File

@@ -46,6 +46,8 @@ use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\Validation\ValidationException; use Illuminate\Validation\ValidationException;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Symfony\Component\HttpFoundation\Response as ResponseAlias; use Symfony\Component\HttpFoundation\Response as ResponseAlias;
/** /**
@@ -151,7 +153,7 @@ class LoginController extends Controller
$this->sendFailedLoginResponse($request); $this->sendFailedLoginResponse($request);
// @noinspection PhpUnreachableStatementInspection // @noinspection PhpUnreachableStatementInspection
return response()->json([]); return response()->json();
} }
/** /**
@@ -219,9 +221,13 @@ class LoginController extends Controller
/** /**
* Show the application's login form. * Show the application's login form.
* *
* @param Request $request
*
* @return Application|Factory|Redirector|RedirectResponse|View * @return Application|Factory|Redirector|RedirectResponse|View
* *
* @throws FireflyException * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function showLoginForm(Request $request) public function showLoginForm(Request $request)
{ {

View File

@@ -140,9 +140,14 @@ class RegisterController extends Controller
/** /**
* Show the application registration form if the invitation code is valid. * Show the application registration form if the invitation code is valid.
* *
* @param Request $request
* @param string $code
*
* @return Factory|View * @return Factory|View
* *
* @throws ContainerExceptionInterface
* @throws FireflyException * @throws FireflyException
* @throws NotFoundExceptionInterface
*/ */
public function showInviteForm(Request $request, string $code) public function showInviteForm(Request $request, string $code)
{ {
@@ -172,9 +177,13 @@ class RegisterController extends Controller
/** /**
* Show the application registration form. * Show the application registration form.
* *
* @param Request|null $request
*
* @return Factory|View * @return Factory|View
* *
* @throws ContainerExceptionInterface
* @throws FireflyException * @throws FireflyException
* @throws NotFoundExceptionInterface
*/ */
public function showRegistrationForm(?Request $request = null) public function showRegistrationForm(?Request $request = null)
{ {

View File

@@ -34,6 +34,8 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\Password; use Illuminate\Support\Facades\Password;
use Illuminate\Validation\ValidationException; use Illuminate\Validation\ValidationException;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class ResetPasswordController * Class ResetPasswordController
@@ -112,11 +114,14 @@ class ResetPasswordController extends Controller
* *
* If no token is present, display the link request form. * If no token is present, display the link request form.
* *
* @param null $token * @param Request $request
* @param null $token
* *
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function showResetForm(Request $request, $token = null) public function showResetForm(Request $request, $token = null)
{ {

View File

@@ -37,6 +37,8 @@ use Illuminate\Http\Request;
use Illuminate\Routing\Redirector; use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use PragmaRX\Google2FALaravel\Support\Authenticator; use PragmaRX\Google2FALaravel\Support\Authenticator;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class TwoFactorController. * Class TwoFactorController.
@@ -59,7 +61,11 @@ class TwoFactorController extends Controller
} }
/** /**
* @param Request $request
*
* @return Redirector|RedirectResponse * @return Redirector|RedirectResponse
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function submitMFA(Request $request) public function submitMFA(Request $request)
{ {

View File

@@ -149,7 +149,6 @@ class IndexController extends Controller
} }
/** /**
* @throws FireflyException
*/ */
private function getSums(array $bills): array private function getSums(array $bills): array
{ {

View File

@@ -44,6 +44,8 @@ use Illuminate\View\View;
use League\Fractal\Manager; use League\Fractal\Manager;
use League\Fractal\Resource\Item; use League\Fractal\Resource\Item;
use League\Fractal\Serializer\DataArraySerializer; use League\Fractal\Serializer\DataArraySerializer;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\ParameterBag;
/** /**
@@ -113,7 +115,12 @@ class ShowController extends Controller
/** /**
* Show a bill. * Show a bill.
* *
* @param Request $request
* @param Bill $bill
*
* @return Factory|View * @return Factory|View
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function show(Request $request, Bill $bill) public function show(Request $request, Bill $bill)
{ {

View File

@@ -150,7 +150,7 @@ class BudgetLimitController extends Controller
$end = Carbon::createFromFormat('Y-m-d', $request->get('end')); $end = Carbon::createFromFormat('Y-m-d', $request->get('end'));
if (!$start instanceof Carbon || !$end instanceof Carbon) { if (!$start instanceof Carbon || !$end instanceof Carbon) {
return response()->json([]); return response()->json();
} }
$amount = (string) $request->get('amount'); $amount = (string) $request->get('amount');
@@ -158,7 +158,7 @@ class BudgetLimitController extends Controller
$end->startOfDay(); $end->startOfDay();
if ('' === $amount) { if ('' === $amount) {
return response()->json([]); return response()->json();
} }
app('log')->debug(sprintf('Start: %s, end: %s', $start->format('Y-m-d'), $end->format('Y-m-d'))); app('log')->debug(sprintf('Start: %s, end: %s', $start->format('Y-m-d'), $end->format('Y-m-d')));
@@ -172,7 +172,7 @@ class BudgetLimitController extends Controller
} }
// return empty=ish array: // return empty=ish array:
return response()->json([]); return response()->json();
} }
if ((int) $amount > 268435456) { // intentional cast to integer if ((int) $amount > 268435456) { // intentional cast to integer
$amount = '268435456'; $amount = '268435456';

View File

@@ -174,7 +174,7 @@ class IndexController extends Controller
$array['end_date'] = $entry->end_date; $array['end_date'] = $entry->end_date;
// spent in period: // spent in period:
$spentArr = $this->opsRepository->sumExpenses($entry->start_date, $entry->end_date, null, null, $entry->transactionCurrency, false); $spentArr = $this->opsRepository->sumExpenses($entry->start_date, $entry->end_date, null, null, $entry->transactionCurrency);
$array['spent'] = $spentArr[$entry->transaction_currency_id]['sum'] ?? '0'; $array['spent'] = $spentArr[$entry->transaction_currency_id]['sum'] ?? '0';
$array['pc_spent'] = $this->convertToPrimary && $entry->transaction_currency_id !== $this->primaryCurrency->id ? $converter->convert($entry->transactionCurrency, $this->primaryCurrency, $entry->start_date, $array['spent']) : null; $array['pc_spent'] = $this->convertToPrimary && $entry->transaction_currency_id !== $this->primaryCurrency->id ? $converter->convert($entry->transactionCurrency, $this->primaryCurrency, $entry->start_date, $array['spent']) : null;
// budgeted in period: // budgeted in period:
@@ -235,7 +235,7 @@ class IndexController extends Controller
/** @var TransactionCurrency $currency */ /** @var TransactionCurrency $currency */
foreach ($currencies as $currency) { foreach ($currencies as $currency) {
$spentArr = $this->opsRepository->sumExpenses($start, $end, null, new Collection()->push($current), $currency, false); $spentArr = $this->opsRepository->sumExpenses($start, $end, null, new Collection()->push($current), $currency);
if (array_key_exists($currency->id, $spentArr) && array_key_exists('sum', $spentArr[$currency->id])) { if (array_key_exists($currency->id, $spentArr) && array_key_exists('sum', $spentArr[$currency->id])) {
$array['spent'][$currency->id]['spent'] = $spentArr[$currency->id]['sum']; $array['spent'][$currency->id]['spent'] = $spentArr[$currency->id]['sum'];
$array['spent'][$currency->id]['currency_id'] = $currency->id; $array['spent'][$currency->id]['currency_id'] = $currency->id;

View File

@@ -39,6 +39,8 @@ use FireflyIII\Support\Http\Controllers\PeriodOverview;
use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class ShowController * Class ShowController
@@ -73,9 +75,15 @@ class ShowController extends Controller
/** /**
* Show transactions without a budget. * Show transactions without a budget.
* *
* @param Request $request
* @param Carbon|null $start
* @param Carbon|null $end
*
* @return Factory|View * @return Factory|View
* *
* @throws ContainerExceptionInterface
* @throws FireflyException * @throws FireflyException
* @throws NotFoundExceptionInterface
*/ */
public function noBudget(Request $request, ?Carbon $start = null, ?Carbon $end = null) public function noBudget(Request $request, ?Carbon $start = null, ?Carbon $end = null)
{ {
@@ -110,7 +118,11 @@ class ShowController extends Controller
/** /**
* Shows ALL transactions without a budget. * Shows ALL transactions without a budget.
* *
* @param Request $request
*
* @return Factory|View * @return Factory|View
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function noBudgetAll(Request $request) public function noBudgetAll(Request $request)
{ {
@@ -135,7 +147,12 @@ class ShowController extends Controller
/** /**
* Show a single budget. * Show a single budget.
* *
* @param Request $request
* @param Budget $budget
*
* @return Factory|View * @return Factory|View
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function show(Request $request, Budget $budget) public function show(Request $request, Budget $budget)
{ {
@@ -166,9 +183,15 @@ class ShowController extends Controller
/** /**
* Show a single budget by a budget limit. * Show a single budget by a budget limit.
* *
* @param Request $request
* @param Budget $budget
* @param BudgetLimit $budgetLimit
*
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function showByBudgetLimit(Request $request, Budget $budget, BudgetLimit $budgetLimit) public function showByBudgetLimit(Request $request, Budget $budget, BudgetLimit $budgetLimit)
{ {

View File

@@ -32,6 +32,8 @@ use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class IndexController * Class IndexController
@@ -62,7 +64,11 @@ class IndexController extends Controller
/** /**
* Show all categories. * Show all categories.
* *
* @param Request $request
*
* @return Factory|View * @return Factory|View
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function index(Request $request) public function index(Request $request)
{ {

View File

@@ -37,6 +37,8 @@ use Illuminate\Http\Request;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class NoCategoryController * Class NoCategoryController
@@ -69,9 +71,15 @@ class NoCategoryController extends Controller
/** /**
* Show transactions without a category. * Show transactions without a category.
* *
* @param Request $request
* @param Carbon|null $start
* @param Carbon|null $end
*
* @return Factory|View * @return Factory|View
* *
* @throws ContainerExceptionInterface
* @throws FireflyException * @throws FireflyException
* @throws NotFoundExceptionInterface
*/ */
public function show(Request $request, ?Carbon $start = null, ?Carbon $end = null) public function show(Request $request, ?Carbon $start = null, ?Carbon $end = null)
{ {
@@ -106,7 +114,11 @@ class NoCategoryController extends Controller
/** /**
* Show all transactions without a category. * Show all transactions without a category.
* *
* @param Request $request
*
* @return Factory|View * @return Factory|View
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function showAll(Request $request) public function showAll(Request $request)
{ {

View File

@@ -35,6 +35,8 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\View\View; use Illuminate\View\View;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class ShowController * Class ShowController
@@ -68,9 +70,16 @@ class ShowController extends Controller
/** /**
* Show a single category. * Show a single category.
* *
* @param Request $request
* @param Category $category
* @param Carbon|null $start
* @param Carbon|null $end
*
* @return Factory|View * @return Factory|View
* *
* @throws ContainerExceptionInterface
* @throws FireflyException * @throws FireflyException
* @throws NotFoundExceptionInterface
*/ */
public function show(Request $request, Category $category, ?Carbon $start = null, ?Carbon $end = null) public function show(Request $request, Category $category, ?Carbon $start = null, ?Carbon $end = null)
{ {
@@ -111,7 +120,12 @@ class ShowController extends Controller
/** /**
* Show all transactions within a category. * Show all transactions within a category.
* *
* @param Request $request
* @param Category $category
*
* @return Factory|View * @return Factory|View
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function showAll(Request $request, Category $category) public function showAll(Request $request, Category $category)
{ {

View File

@@ -45,6 +45,7 @@ use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Safe\Exceptions\JsonException;
use function Safe\json_encode; use function Safe\json_encode;
/** /**
@@ -482,7 +483,13 @@ class AccountController extends Controller
/** /**
* Shows overview of account during a single period. * Shows overview of account during a single period.
* *
* @param Account $account
* @param Carbon $start
* @param Carbon $end
*
* @return JsonResponse
* @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
{ {
@@ -571,7 +578,7 @@ class AccountController extends Controller
$label = $current->isoFormat($format); $label = $current->isoFormat($format);
$return[$key]['entries'][$label] = $amount; $return[$key]['entries'][$label] = $amount;
} }
$current = app('navigation')->addPeriod($current, $step, 0); $current = app('navigation')->addPeriod($current, $step);
// here too, to fix #8041, the data is corrected to the end of the period. // here too, to fix #8041, the data is corrected to the end of the period.
$current = app('navigation')->endOfX($current, $step, null); $current = app('navigation')->endOfX($current, $step, null);
} }

View File

@@ -40,6 +40,8 @@ use FireflyIII\Support\Http\Controllers\ChartGeneration;
use FireflyIII\Support\Http\Controllers\DateCalculation; use FireflyIII\Support\Http\Controllers\DateCalculation;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class CategoryController. * Class CategoryController.
@@ -66,7 +68,6 @@ class CategoryController extends Controller
* Show an overview for a category for all time, per month/week/year. * Show an overview for a category for all time, per month/week/year.
* TODO test method, for category refactor. * TODO test method, for category refactor.
* *
* @throws FireflyException
*/ */
public function all(Category $category): JsonResponse public function all(Category $category): JsonResponse
{ {
@@ -256,7 +257,12 @@ class CategoryController extends Controller
* Chart for a specific period. * Chart for a specific period.
* TODO test me, for category refactor. * TODO test me, for category refactor.
* *
* @throws FireflyException * @param Category $category
* @param Carbon $date
*
* @return JsonResponse
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function specificPeriod(Category $category, Carbon $date): JsonResponse public function specificPeriod(Category $category, Carbon $date): JsonResponse
{ {

View File

@@ -59,7 +59,6 @@ class PiggyBankController extends Controller
* *
* TODO this chart is not multi currency aware. * TODO this chart is not multi currency aware.
* *
* @throws FireflyException
*/ */
public function history(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank): JsonResponse public function history(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank): JsonResponse
{ {
@@ -95,7 +94,7 @@ class PiggyBankController extends Controller
$currentSum = $filtered->sum('amount'); $currentSum = $filtered->sum('amount');
$label = $oldest->isoFormat((string) trans('config.month_and_day_js', [], $locale)); $label = $oldest->isoFormat((string) trans('config.month_and_day_js', [], $locale));
$chartData[$label] = $currentSum; $chartData[$label] = $currentSum;
$oldest = app('navigation')->addPeriod($oldest, $step, 0); $oldest = app('navigation')->addPeriod($oldest, $step);
} }
$finalFiltered = $set->filter( $finalFiltered = $set->filter(
static fn (PiggyBankEvent $event) => $event->date->lte($today) static fn (PiggyBankEvent $event) => $event->date->lte($today)

View File

@@ -260,7 +260,7 @@ class ReportController extends Controller
$expense['entries'][$title] = '0'; $expense['entries'][$title] = '0';
} }
$currentStart = app('navigation')->addPeriod($currentStart, $preferredRange, 0); $currentStart = app('navigation')->addPeriod($currentStart, $preferredRange);
} }
Log::debug('End of sub-loop'); Log::debug('End of sub-loop');

View File

@@ -49,6 +49,7 @@ use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Illuminate\View\View; use Illuminate\View\View;
use Monolog\Handler\RotatingFileHandler; use Monolog\Handler\RotatingFileHandler;
use Safe\Exceptions\FilesystemException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use function Safe\file_get_contents; use function Safe\file_get_contents;
@@ -131,7 +132,7 @@ class DebugController extends Controller
* *
* @return Factory|View * @return Factory|View
* *
* @throws FireflyException * @throws FilesystemException
*/ */
public function index() public function index()
{ {

View File

@@ -33,6 +33,8 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Support\Http\Controllers\GetConfigurationData; use FireflyIII\Support\Http\Controllers\GetConfigurationData;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Response; use Illuminate\Http\Response;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* Class JavascriptController. * Class JavascriptController.
@@ -90,8 +92,14 @@ class JavascriptController extends Controller
/** /**
* Show some common variables to be used in scripts. * Show some common variables to be used in scripts.
* *
* @param Request $request
* @param AccountRepositoryInterface $repository
*
* @return Response
* @throws FireflyException * @throws FireflyException
* */ * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function variables(Request $request, AccountRepositoryInterface $repository): Response public function variables(Request $request, AccountRepositoryInterface $repository): Response
{ {
$account = $repository->find((int) $request->get('account')); $account = $repository->find((int) $request->get('account'));

View File

@@ -52,7 +52,7 @@ class BoxController extends Controller
#[Deprecated] #[Deprecated]
public function available(): JsonResponse public function available(): JsonResponse
{ {
return response()->json([]); return response()->json();
} }
/** /**

Some files were not shown because too many files have changed in this diff Show More