mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Various code cleanup.
This commit is contained in:
parent
3589c9f60f
commit
e829d79589
@ -95,8 +95,9 @@ class TransactionJournalFactory
|
||||
* @param array $data
|
||||
*
|
||||
* @return Collection
|
||||
* @throws FireflyException
|
||||
* @throws DuplicateTransactionException
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function create(array $data): Collection
|
||||
{
|
||||
@ -388,15 +389,11 @@ class TransactionJournalFactory
|
||||
private function getCurrencyByAccount(string $type, ?TransactionCurrency $currency, Account $source, Account $destination): TransactionCurrency
|
||||
{
|
||||
Log::debug('Now ingetCurrencyByAccount()');
|
||||
switch ($type) {
|
||||
default:
|
||||
case TransactionType::WITHDRAWAL:
|
||||
case TransactionType::TRANSFER:
|
||||
return $this->getCurrency($currency, $source);
|
||||
case TransactionType::DEPOSIT:
|
||||
return $this->getCurrency($currency, $destination);
|
||||
|
||||
}
|
||||
return match ($type) {
|
||||
default => $this->getCurrency($currency, $source),
|
||||
TransactionType::DEPOSIT => $this->getCurrency($currency, $destination),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,6 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
* Generates the report.
|
||||
*
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function generate(): string
|
||||
@ -195,7 +194,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
#[ArrayShape(['journals' => "array", 'currency' => "mixed", 'exists' => "bool", 'end' => "string", 'endBalance' => "mixed", 'dayBefore' => "string",
|
||||
'dayBeforeBalance' => "mixed"])] public function getAuditReport(Account $account, Carbon $date): array
|
||||
|
@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Handlers\Events;
|
||||
|
||||
|
||||
use FireflyIII\Events\StoredAccount;
|
||||
use FireflyIII\Events\UpdatedAccount;
|
||||
use FireflyIII\Services\Internal\Support\CreditRecalculateService;
|
||||
|
||||
|
@ -114,7 +114,7 @@ class UserEventHandler
|
||||
* @param Login $event
|
||||
*
|
||||
* @return bool
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function demoUserBackToEnglish(Login $event): bool
|
||||
{
|
||||
@ -136,7 +136,7 @@ class UserEventHandler
|
||||
/**
|
||||
* @param DetectedNewIPAddress $event
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function notifyNewIPAddress(DetectedNewIPAddress $event): void
|
||||
{
|
||||
@ -178,7 +178,7 @@ class UserEventHandler
|
||||
* @param UserChangedEmail $event
|
||||
*
|
||||
* @return bool
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function sendEmailChangeConfirmMail(UserChangedEmail $event): bool
|
||||
{
|
||||
@ -204,7 +204,7 @@ class UserEventHandler
|
||||
* @param UserChangedEmail $event
|
||||
*
|
||||
* @return bool
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function sendEmailChangeUndoMail(UserChangedEmail $event): bool
|
||||
{
|
||||
@ -286,7 +286,7 @@ class UserEventHandler
|
||||
* @param RegisteredUser $event
|
||||
*
|
||||
* @return bool
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function sendRegistrationMail(RegisteredUser $event): bool
|
||||
{
|
||||
@ -319,7 +319,7 @@ class UserEventHandler
|
||||
/**
|
||||
* @param Login $event
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function storeUserIPAddress(Login $event): void
|
||||
{
|
||||
|
@ -29,7 +29,6 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Helpers\Update\UpdateTrait;
|
||||
use FireflyIII\Models\Configuration;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
|
@ -67,6 +67,7 @@ class FiscalHelper implements FiscalHelperInterface
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return Carbon date object
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function startOfFiscalYear(Carbon $date): Carbon
|
||||
{
|
||||
|
@ -62,6 +62,7 @@ class NetWorth implements NetWorthInterface
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return array
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function getNetWorthByCurrency(Collection $accounts, Carbon $date): array
|
||||
{
|
||||
|
@ -135,6 +135,7 @@ class CreateController extends Controller
|
||||
* @param AccountFormRequest $request
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function store(AccountFormRequest $request)
|
||||
{
|
||||
|
@ -72,6 +72,7 @@ class IndexController extends Controller
|
||||
* @param string $objectType
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function inactive(Request $request, string $objectType)
|
||||
{
|
||||
|
@ -53,6 +53,7 @@ class HomeController extends Controller
|
||||
* Index of the admin.
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
@ -31,8 +31,6 @@ use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\View\View;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* Class HomeController.
|
||||
|
@ -194,7 +194,7 @@ class LoginController extends Controller
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|Response|View
|
||||
* @return Factory|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\View|\Illuminate\Routing\Redirector|RedirectResponse
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function showLoginForm(Request $request)
|
||||
|
@ -78,7 +78,7 @@ class RegisterController extends Controller
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|RedirectResponse|Redirector|View
|
||||
* @return \Illuminate\Contracts\Foundation\Application|Redirector|RedirectResponse
|
||||
* @throws FireflyException
|
||||
* @throws ValidationException
|
||||
*/
|
||||
|
@ -29,11 +29,9 @@ use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Http\Requests\BillStoreRequest;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
|
@ -29,11 +29,9 @@ use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Http\Requests\BillUpdateRequest;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
/**
|
||||
* Class EditController
|
||||
|
@ -24,10 +24,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Bill;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Repositories\ObjectGroup\OrganisesObjectGroups;
|
||||
use FireflyIII\Transformers\BillTransformer;
|
||||
@ -145,6 +143,7 @@ class IndexController extends Controller
|
||||
* @param array $bills
|
||||
*
|
||||
* @return array
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
private function getSums(array $bills): array
|
||||
{
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Http\Controllers\Bill;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Attachment;
|
||||
@ -124,6 +123,7 @@ class ShowController extends Controller
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function show(Request $request, Bill $bill)
|
||||
{
|
||||
|
@ -133,7 +133,7 @@ class AvailableBudgetController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AvailableBudget $availableBudget
|
||||
* @param Request $request
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
*/
|
||||
|
@ -90,6 +90,7 @@ class IndexController extends Controller
|
||||
* @param Carbon|null $end
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function index(Request $request, Carbon $start = null, Carbon $end = null)
|
||||
{
|
||||
|
@ -78,6 +78,7 @@ class ShowController extends Controller
|
||||
* @param Carbon|null $end
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function noBudget(Request $request, Carbon $start = null, Carbon $end = null)
|
||||
{
|
||||
@ -113,6 +114,7 @@ class ShowController extends Controller
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function noBudgetAll(Request $request)
|
||||
{
|
||||
@ -141,6 +143,7 @@ class ShowController extends Controller
|
||||
* @param Budget $budget
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function show(Request $request, Budget $budget)
|
||||
{
|
||||
|
@ -66,6 +66,7 @@ class IndexController extends Controller
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
|
@ -74,6 +74,7 @@ class NoCategoryController extends Controller
|
||||
* @param Carbon|null $end
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function show(Request $request, Carbon $start = null, Carbon $end = null)
|
||||
{
|
||||
@ -111,6 +112,7 @@ class NoCategoryController extends Controller
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function showAll(Request $request)
|
||||
{
|
||||
|
@ -76,6 +76,7 @@ class ShowController extends Controller
|
||||
* @param Carbon|null $end
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function show(Request $request, Category $category, Carbon $start = null, Carbon $end = null)
|
||||
{
|
||||
@ -115,6 +116,7 @@ class ShowController extends Controller
|
||||
* @param Category $category
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function showAll(Request $request, Category $category)
|
||||
{
|
||||
|
@ -83,6 +83,7 @@ class AccountController extends Controller
|
||||
* This chart is (multi) currency aware.
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function expenseAccounts(): JsonResponse
|
||||
{
|
||||
@ -194,6 +195,7 @@ class AccountController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function expenseBudget(Account $account, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
@ -268,6 +270,7 @@ class AccountController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function expenseCategory(Account $account, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
@ -322,6 +325,7 @@ class AccountController extends Controller
|
||||
* @param AccountRepositoryInterface $repository
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function frontpage(AccountRepositoryInterface $repository): JsonResponse
|
||||
{
|
||||
@ -364,6 +368,7 @@ class AccountController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function incomeCategory(Account $account, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
@ -421,6 +426,8 @@ class AccountController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function period(Account $account, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
@ -458,6 +465,8 @@ class AccountController extends Controller
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
* @return array
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
private function periodByCurrency(Carbon $start, Carbon $end, Account $account, TransactionCurrency $currency): array
|
||||
{
|
||||
@ -528,6 +537,7 @@ class AccountController extends Controller
|
||||
* This chart is multi-currency aware.
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function revenueAccounts(): JsonResponse
|
||||
{
|
||||
|
@ -57,6 +57,7 @@ class BillController extends Controller
|
||||
* @param BillRepositoryInterface $repository
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function frontpage(BillRepositoryInterface $repository): JsonResponse
|
||||
{
|
||||
@ -102,6 +103,7 @@ class BillController extends Controller
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function single(Bill $bill): JsonResponse
|
||||
{
|
||||
|
@ -84,6 +84,7 @@ class BudgetController extends Controller
|
||||
* @param Budget $budget
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function budget(Budget $budget): JsonResponse
|
||||
{
|
||||
@ -152,6 +153,7 @@ class BudgetController extends Controller
|
||||
* @return JsonResponse
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function budgetLimit(Budget $budget, BudgetLimit $budgetLimit): JsonResponse
|
||||
{
|
||||
@ -202,6 +204,7 @@ class BudgetController extends Controller
|
||||
* @param BudgetLimit|null $budgetLimit
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function expenseAsset(Budget $budget, ?BudgetLimit $budgetLimit = null): JsonResponse
|
||||
{
|
||||
@ -270,6 +273,7 @@ class BudgetController extends Controller
|
||||
* @param BudgetLimit|null $budgetLimit
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function expenseCategory(Budget $budget, ?BudgetLimit $budgetLimit = null): JsonResponse
|
||||
{
|
||||
@ -334,6 +338,7 @@ class BudgetController extends Controller
|
||||
* @param BudgetLimit|null $budgetLimit
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function expenseExpense(Budget $budget, ?BudgetLimit $budgetLimit = null): JsonResponse
|
||||
{
|
||||
@ -397,7 +402,7 @@ class BudgetController extends Controller
|
||||
* Shows a budget list with spent/left/overspent.
|
||||
*
|
||||
* @return JsonResponse
|
||||
*
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function frontpage(): JsonResponse
|
||||
{
|
||||
@ -435,6 +440,7 @@ class BudgetController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function period(Budget $budget, TransactionCurrency $currency, Collection $accounts, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
@ -510,6 +516,7 @@ class BudgetController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function periodNoBudget(TransactionCurrency $currency, Collection $accounts, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
|
@ -63,11 +63,13 @@ class CategoryController extends Controller
|
||||
|
||||
/**
|
||||
* Show an overview for a category for all time, per month/week/year.
|
||||
* See reference nr. 59
|
||||
* See reference nr. 59
|
||||
*
|
||||
* @param Category $category
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function all(Category $category): JsonResponse
|
||||
{
|
||||
@ -111,9 +113,10 @@ class CategoryController extends Controller
|
||||
|
||||
/**
|
||||
* Shows the category chart on the front page.
|
||||
* See reference nr. 60
|
||||
* See reference nr. 60
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function frontPage(): JsonResponse
|
||||
{
|
||||
@ -138,7 +141,7 @@ class CategoryController extends Controller
|
||||
|
||||
/**
|
||||
* Chart report.
|
||||
* See reference nr. 61
|
||||
* See reference nr. 61
|
||||
*
|
||||
* @param Category $category
|
||||
* @param Collection $accounts
|
||||
@ -146,6 +149,7 @@ class CategoryController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function reportPeriod(Category $category, Collection $accounts, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
@ -254,13 +258,14 @@ class CategoryController extends Controller
|
||||
|
||||
/**
|
||||
* Chart for period for transactions without a category.
|
||||
* See reference nr. 62
|
||||
* See reference nr. 62
|
||||
*
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function reportPeriodNoCategory(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
@ -281,12 +286,14 @@ class CategoryController extends Controller
|
||||
|
||||
/**
|
||||
* Chart for a specific period.
|
||||
* See reference nr. 63
|
||||
* See reference nr. 63
|
||||
*
|
||||
* @param Category $category
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function specificPeriod(Category $category, Carbon $date): JsonResponse
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ class ExpenseReportController extends Controller
|
||||
/**
|
||||
* Main chart that shows income and expense for a combination of expense/revenue accounts.
|
||||
*
|
||||
* See reference nr. 58
|
||||
* See reference nr. 58
|
||||
*
|
||||
* @param Collection $accounts
|
||||
* @param Collection $expense
|
||||
@ -77,7 +77,7 @@ class ExpenseReportController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
*
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function mainChart(Collection $accounts, Collection $expense, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
|
@ -31,7 +31,6 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use FireflyIII\Support\Http\Controllers\DateCalculation;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class PiggyBankController.
|
||||
@ -58,13 +57,13 @@ class PiggyBankController extends Controller
|
||||
/**
|
||||
* Shows the piggy bank history.
|
||||
*
|
||||
* See reference nr. 53
|
||||
* See reference nr. 53
|
||||
*
|
||||
* @param PiggyBankRepositoryInterface $repository
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
* @return JsonResponse
|
||||
*
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function history(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank): JsonResponse
|
||||
{
|
||||
|
@ -68,6 +68,7 @@ class ReportController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function netWorth(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
@ -142,6 +143,7 @@ class ReportController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function operations(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
|
@ -56,6 +56,7 @@ class TransactionController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function budgets(Carbon $start, Carbon $end)
|
||||
{
|
||||
@ -100,6 +101,7 @@ class TransactionController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function categories(string $objectType, Carbon $start, Carbon $end)
|
||||
{
|
||||
@ -158,6 +160,7 @@ class TransactionController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function destinationAccounts(string $objectType, Carbon $start, Carbon $end)
|
||||
{
|
||||
@ -215,6 +218,7 @@ class TransactionController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function sourceAccounts(string $objectType, Carbon $start, Carbon $end)
|
||||
{
|
||||
|
@ -99,10 +99,10 @@ class CurrencyController extends Controller
|
||||
/**
|
||||
* Make currency the default currency.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param TransactionCurrency $currency
|
||||
* @param Request $request
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function defaultCurrency(Request $request)
|
||||
{
|
||||
@ -328,6 +328,7 @@ class CurrencyController extends Controller
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
|
@ -67,9 +67,7 @@ class IndexController extends Controller
|
||||
|
||||
/**
|
||||
* @return LaravelResponse
|
||||
* @throws CannotInsertRecord
|
||||
* @throws FireflyException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function export(): LaravelResponse
|
||||
{
|
||||
|
@ -35,6 +35,7 @@ class HelpController extends Controller
|
||||
* @param string $route
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function show(string $route): JsonResponse
|
||||
{
|
||||
|
@ -28,17 +28,12 @@ use FireflyIII\Events\RequestedVersionCheckStatus;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Http\Middleware\Installer;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\GroupMembership;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\View\View;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
|
@ -46,6 +46,7 @@ class JavascriptController extends Controller
|
||||
* @param CurrencyRepositoryInterface $currencyRepository
|
||||
*
|
||||
* @return Response
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function accounts(AccountRepositoryInterface $repository, CurrencyRepositoryInterface $currencyRepository): Response
|
||||
{
|
||||
@ -128,6 +129,7 @@ class JavascriptController extends Controller
|
||||
* @param CurrencyRepositoryInterface $currencyRepository
|
||||
*
|
||||
* @return Response
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function variables(Request $request, AccountRepositoryInterface $repository, CurrencyRepositoryInterface $currencyRepository): Response
|
||||
{
|
||||
|
@ -23,10 +23,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Http\Controllers\Json;
|
||||
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Class AutoCompleteController.
|
||||
|
@ -51,6 +51,7 @@ class BoxController extends Controller
|
||||
* 2) if the user has no available amount set this period: spent per day
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function available(): JsonResponse
|
||||
{
|
||||
@ -129,6 +130,7 @@ class BoxController extends Controller
|
||||
* @param CurrencyRepositoryInterface $repository
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function balance(CurrencyRepositoryInterface $repository): JsonResponse
|
||||
{
|
||||
|
@ -103,6 +103,7 @@ class IntroController extends Controller
|
||||
* @param string|null $specialPage
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function postEnable(string $route, string $specialPage = null): JsonResponse
|
||||
{
|
||||
@ -126,6 +127,7 @@ class IntroController extends Controller
|
||||
* @param string|null $specialPage
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function postFinished(string $route, string $specialPage = null): JsonResponse
|
||||
{
|
||||
|
@ -215,7 +215,8 @@ class ReconcileController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function transactions(Account $account, Carbon $start, Carbon $end)
|
||||
{
|
||||
|
@ -86,6 +86,7 @@ class NewUserController extends Controller
|
||||
* @param CurrencyRepositoryInterface $currencyRepository
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function submit(NewUserFormRequest $request, CurrencyRepositoryInterface $currencyRepository)
|
||||
{
|
||||
|
@ -27,11 +27,9 @@ namespace FireflyIII\Http\Controllers\ObjectGroup;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\ObjectGroup;
|
||||
use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
|
@ -51,26 +51,14 @@ class ReportController extends Controller
|
||||
app('view')->share('start', $attributes['startDate']);
|
||||
app('view')->share('end', $attributes['endDate']);
|
||||
|
||||
switch ($attributes['location']) {
|
||||
default:
|
||||
$html = sprintf('Firefly III cannot handle "%s"-popups.', $attributes['location']);
|
||||
break;
|
||||
case 'budget-spent-amount':
|
||||
$html = $this->budgetSpentAmount($attributes);
|
||||
break;
|
||||
case 'expense-entry':
|
||||
$html = $this->expenseEntry($attributes);
|
||||
break;
|
||||
case 'income-entry':
|
||||
$html = $this->incomeEntry($attributes);
|
||||
break;
|
||||
case 'category-entry':
|
||||
$html = $this->categoryEntry($attributes);
|
||||
break;
|
||||
case 'budget-entry':
|
||||
$html = $this->budgetEntry($attributes);
|
||||
break;
|
||||
}
|
||||
$html = match ($attributes['location']) {
|
||||
default => sprintf('Firefly III cannot handle "%s"-popups.', $attributes['location']),
|
||||
'budget-spent-amount' => $this->budgetSpentAmount($attributes),
|
||||
'expense-entry' => $this->expenseEntry($attributes),
|
||||
'income-entry' => $this->incomeEntry($attributes),
|
||||
'category-entry' => $this->categoryEntry($attributes),
|
||||
'budget-entry' => $this->budgetEntry($attributes),
|
||||
};
|
||||
|
||||
return response()->json(['html' => $html]);
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ class PreferencesController extends Controller
|
||||
* @param AccountRepositoryInterface $repository
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function index(AccountRepositoryInterface $repository)
|
||||
{
|
||||
@ -144,7 +145,7 @@ class PreferencesController extends Controller
|
||||
* @param Request $request
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function postIndex(Request $request)
|
||||
{
|
||||
|
@ -389,7 +389,10 @@ class ProfileController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function newBackupCodes(Request $request)
|
||||
{
|
||||
@ -506,6 +509,7 @@ class ProfileController extends Controller
|
||||
* @param TokenFormRequest $request
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function postCode(TokenFormRequest $request)
|
||||
{
|
||||
@ -657,9 +661,10 @@ class ProfileController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* See reference nr. 64
|
||||
* See reference nr. 64
|
||||
*
|
||||
* @param string $mfaCode
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function addToMFAHistory(string $mfaCode): void
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ class AccountController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return mixed|string
|
||||
*
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function general(Collection $accounts, Carbon $start, Carbon $end)
|
||||
{
|
||||
|
@ -307,6 +307,7 @@ class BudgetController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return mixed|string
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function period(Collection $accounts, Carbon $start, Carbon $end)
|
||||
{
|
||||
|
@ -488,6 +488,7 @@ class CategoryController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return mixed|string
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function expenses(Collection $accounts, Carbon $start, Carbon $end)
|
||||
{
|
||||
@ -568,6 +569,7 @@ class CategoryController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return string
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function income(Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
@ -646,7 +648,7 @@ class CategoryController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return mixed|string
|
||||
*
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function operations(Collection $accounts, Carbon $start, Carbon $end)
|
||||
{
|
||||
|
@ -66,6 +66,7 @@ class OperationsController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return mixed|string
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function expenses(Collection $accounts, Carbon $start, Carbon $end)
|
||||
{
|
||||
@ -101,6 +102,7 @@ class OperationsController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return string
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function income(Collection $accounts, Carbon $start, Carbon $end): string
|
||||
{
|
||||
@ -136,6 +138,7 @@ class OperationsController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return mixed|string
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function operations(Collection $accounts, Carbon $start, Carbon $end)
|
||||
{
|
||||
|
@ -260,6 +260,7 @@ class ReportController extends Controller
|
||||
* @param AccountRepositoryInterface $repository
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function index(AccountRepositoryInterface $repository)
|
||||
{
|
||||
@ -305,23 +306,13 @@ class ReportController extends Controller
|
||||
*/
|
||||
public function options(string $reportType)
|
||||
{
|
||||
switch ($reportType) {
|
||||
default:
|
||||
$result = $this->noReportOptions();
|
||||
break;
|
||||
case 'category':
|
||||
$result = $this->categoryReportOptions();
|
||||
break;
|
||||
case 'budget':
|
||||
$result = $this->budgetReportOptions();
|
||||
break;
|
||||
case 'tag':
|
||||
$result = $this->tagReportOptions();
|
||||
break;
|
||||
case 'double':
|
||||
$result = $this->doubleReportOptions();
|
||||
break;
|
||||
}
|
||||
$result = match ($reportType) {
|
||||
default => $this->noReportOptions(),
|
||||
'category' => $this->categoryReportOptions(),
|
||||
'budget' => $this->budgetReportOptions(),
|
||||
'tag' => $this->tagReportOptions(),
|
||||
'double' => $this->doubleReportOptions(),
|
||||
};
|
||||
|
||||
return response()->json(['html' => $result]);
|
||||
}
|
||||
@ -383,27 +374,14 @@ class ReportController extends Controller
|
||||
return prefixView('error')->with('message', (string)trans('firefly.end_after_start_date'));
|
||||
}
|
||||
|
||||
switch ($reportType) {
|
||||
default:
|
||||
case 'default':
|
||||
$uri = route('reports.report.default', [$accounts, $start, $end]);
|
||||
break;
|
||||
case 'category':
|
||||
$uri = route('reports.report.category', [$accounts, $categories, $start, $end]);
|
||||
break;
|
||||
case 'audit':
|
||||
$uri = route('reports.report.audit', [$accounts, $start, $end]);
|
||||
break;
|
||||
case 'budget':
|
||||
$uri = route('reports.report.budget', [$accounts, $budgets, $start, $end]);
|
||||
break;
|
||||
case 'tag':
|
||||
$uri = route('reports.report.tag', [$accounts, $tags, $start, $end]);
|
||||
break;
|
||||
case 'double':
|
||||
$uri = route('reports.report.double', [$accounts, $double, $start, $end]);
|
||||
break;
|
||||
}
|
||||
$uri = match ($reportType) {
|
||||
default => route('reports.report.default', [$accounts, $start, $end]),
|
||||
'category' => route('reports.report.category', [$accounts, $categories, $start, $end]),
|
||||
'audit' => route('reports.report.audit', [$accounts, $start, $end]),
|
||||
'budget' => route('reports.report.budget', [$accounts, $budgets, $start, $end]),
|
||||
'tag' => route('reports.report.tag', [$accounts, $tags, $start, $end]),
|
||||
'double' => route('reports.report.double', [$accounts, $double, $start, $end]),
|
||||
};
|
||||
|
||||
return redirect($uri);
|
||||
}
|
||||
|
@ -22,14 +22,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Rule;
|
||||
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
|
||||
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Controllers\RuleManagement;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
@ -272,7 +272,7 @@ class TagController extends Controller
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return Factory|View
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function showAll(Request $request, Tag $tag)
|
||||
{
|
||||
|
@ -31,7 +31,6 @@ use FireflyIII\Services\Internal\Update\GroupCloneService;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\View\View;
|
||||
|
||||
/**
|
||||
* Class CreateController
|
||||
@ -88,6 +87,7 @@ class CreateController extends Controller
|
||||
* @param string|null $objectType
|
||||
*
|
||||
* @return Factory|\Illuminate\Contracts\View\View
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function create(?string $objectType)
|
||||
{
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Support\System\GeneratesInstallationId;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
@ -24,7 +24,6 @@ namespace FireflyIII\Http\Middleware;
|
||||
|
||||
use Fideloper\Proxy\TrustProxies as Middleware;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Class TrustProxies
|
||||
|
@ -328,6 +328,8 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
* @param array $occurrences
|
||||
*
|
||||
* @return Collection
|
||||
* @throws DuplicateTransactionException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function handleOccurrences(Recurrence $recurrence, RecurrenceRepetition $repetition, array $occurrences): Collection
|
||||
{
|
||||
|
@ -34,16 +34,16 @@ use Illuminate\Support\Carbon;
|
||||
/**
|
||||
* Class GroupMembership
|
||||
*
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
* @property int $user_id
|
||||
* @property int $user_group_id
|
||||
* @property int $user_role_id
|
||||
* @property-read User $user
|
||||
* @property-read \FireflyIII\Models\UserGroup $userGroup
|
||||
* @property-read \FireflyIII\Models\UserRole $userRole
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
* @property int $user_id
|
||||
* @property int $user_group_id
|
||||
* @property int $user_role_id
|
||||
* @property-read User $user
|
||||
* @property-read UserGroup $userGroup
|
||||
* @property-read UserRole $userRole
|
||||
* @method static Builder|GroupMembership newModelQuery()
|
||||
* @method static Builder|GroupMembership newQuery()
|
||||
* @method static Builder|GroupMembership query()
|
||||
|
@ -156,7 +156,6 @@ class TransactionJournal extends Model
|
||||
* @param string $value
|
||||
*
|
||||
* @return TransactionJournal
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public static function routeBinder(string $value): TransactionJournal
|
||||
|
@ -34,13 +34,13 @@ use Illuminate\Support\Carbon;
|
||||
/**
|
||||
* Class UserGroup
|
||||
*
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
* @property string $title
|
||||
* @property-read Collection|\FireflyIII\Models\GroupMembership[] $groupMemberships
|
||||
* @property-read int|null $group_memberships_count
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
* @property string $title
|
||||
* @property-read Collection|GroupMembership[] $groupMemberships
|
||||
* @property-read int|null $group_memberships_count
|
||||
* @method static Builder|UserGroup newModelQuery()
|
||||
* @method static Builder|UserGroup newQuery()
|
||||
* @method static Builder|UserGroup query()
|
||||
|
@ -34,13 +34,13 @@ use Illuminate\Support\Carbon;
|
||||
/**
|
||||
* Class UserRole
|
||||
*
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
* @property string $title
|
||||
* @property-read Collection|\FireflyIII\Models\GroupMembership[] $groupMemberships
|
||||
* @property-read int|null $group_memberships_count
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
* @property string $title
|
||||
* @property-read Collection|GroupMembership[] $groupMemberships
|
||||
* @property-read int|null $group_memberships_count
|
||||
* @method static Builder|UserRole newModelQuery()
|
||||
* @method static Builder|UserRole newQuery()
|
||||
* @method static Builder|UserRole query()
|
||||
|
@ -730,6 +730,8 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
* @param array $data
|
||||
*
|
||||
* @return Account
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function update(Account $account, array $data): Account
|
||||
{
|
||||
|
@ -623,6 +623,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return Carbon
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function nextDateMatch(Bill $bill, Carbon $date): Carbon
|
||||
{
|
||||
@ -651,6 +652,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return Carbon
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function nextExpectedMatch(Bill $bill, Carbon $date): Carbon
|
||||
{
|
||||
|
@ -30,7 +30,6 @@ use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -309,6 +309,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
* @param array $data
|
||||
*
|
||||
* @return Category
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update(Category $category, array $data): Category
|
||||
{
|
||||
|
@ -65,6 +65,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
* @return bool
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function currencyInUse(TransactionCurrency $currency): bool
|
||||
{
|
||||
|
@ -117,6 +117,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
|
||||
* @param string $field
|
||||
*
|
||||
* @return null|Carbon
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function getMetaDate(TransactionJournal $journal, string $field): ?Carbon
|
||||
{
|
||||
@ -160,6 +161,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface
|
||||
* @param string $field
|
||||
*
|
||||
* @return null|string
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function getMetaField(TransactionJournal $journal, string $field): ?string
|
||||
{
|
||||
|
@ -129,6 +129,7 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return string
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function getJournalTotal(TransactionJournal $journal): string
|
||||
{
|
||||
@ -185,6 +186,7 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
* @param string $field
|
||||
*
|
||||
* @return null|Carbon
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function getMetaDateById(int $journalId, string $field): ?Carbon
|
||||
{
|
||||
|
@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\ObjectGroup;
|
||||
|
||||
use FireflyIII\Models\ObjectGroup;
|
||||
use FireflyIII\User;
|
||||
|
||||
/**
|
||||
* Trait CreatesObjectGroups
|
||||
|
@ -348,6 +348,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
* @param array $data
|
||||
*
|
||||
* @return User
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function update(User $user, array $data): User
|
||||
{
|
||||
|
@ -71,6 +71,8 @@ class IsValidBulkClause implements Rule
|
||||
/**
|
||||
* Does basic rule based validation.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function basicValidation(string $value): bool
|
||||
|
@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Services\FireflyIIIOrg\Update;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use JsonException;
|
||||
|
@ -25,7 +25,6 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
|
||||
use Exception;
|
||||
use FireflyIII\Models\Bill;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
|
@ -26,7 +26,6 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
use DB;
|
||||
use Exception;
|
||||
use FireflyIII\Models\Budget;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class BudgetDestroyService
|
||||
|
@ -26,7 +26,6 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
use DB;
|
||||
use Exception;
|
||||
use FireflyIII\Models\Category;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class CategoryDestroyService
|
||||
|
@ -25,7 +25,6 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
|
||||
use Exception;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class CurrencyDestroyService
|
||||
|
@ -26,7 +26,6 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
use Exception;
|
||||
use FireflyIII\Models\Recurrence;
|
||||
use FireflyIII\Models\RecurrenceTransaction;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
|
@ -39,7 +39,6 @@ use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Services\Internal\Destroy\TransactionGroupDestroyService;
|
||||
use JsonException;
|
||||
use Log;
|
||||
use Validator;
|
||||
|
||||
|
@ -27,7 +27,6 @@ use Exception;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
|
@ -262,7 +262,7 @@ class CreditRecalculateService
|
||||
// if it's a credit, we don't care, because sending more money
|
||||
// to a credit-liability doesn't increase the amount (yet)
|
||||
if (
|
||||
in_array($type, [TransactionType::WITHDRAWAL])
|
||||
$type === TransactionType::WITHDRAWAL
|
||||
&& (int)$account->id === (int)$transaction->account_id
|
||||
&& 1 === bccomp($transaction->amount, '0')
|
||||
&& 'credit' === $direction
|
||||
@ -274,7 +274,7 @@ class CreditRecalculateService
|
||||
|
||||
// likewise deposit into a credit debt does not change the amount
|
||||
if (
|
||||
in_array($type, [TransactionType::DEPOSIT])
|
||||
$type === TransactionType::DEPOSIT
|
||||
&& (int)$account->id === (int)$transaction->account_id
|
||||
&& -1 === bccomp($transaction->amount, '0')
|
||||
&& 'credit' === $direction
|
||||
|
@ -79,7 +79,6 @@ class AccountUpdateService
|
||||
*
|
||||
* @return Account
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function update(Account $account, array $data): Account
|
||||
{
|
||||
|
@ -122,6 +122,7 @@ class GroupUpdateService
|
||||
* @param array $transactions
|
||||
*
|
||||
* @return array
|
||||
* @throws DuplicateTransactionException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function updateTransactions(TransactionGroup $transactionGroup, array $transactions): array
|
||||
|
@ -109,6 +109,8 @@ class Amount
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function getCurrencyCode(): string
|
||||
{
|
||||
@ -145,6 +147,8 @@ class Amount
|
||||
* @param User $user
|
||||
*
|
||||
* @return TransactionCurrency
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
public function getDefaultCurrencyByUser(User $user): TransactionCurrency
|
||||
{
|
||||
|
@ -44,8 +44,7 @@ class RemoteUserGuard implements Guard
|
||||
* Create a new authentication guard.
|
||||
*
|
||||
* @param UserProvider $provider
|
||||
*
|
||||
* @return void
|
||||
* @param Application $app
|
||||
*/
|
||||
// @phpstan-ignore-next-line
|
||||
public function __construct(UserProvider $provider, Application $app) // @phpstan-ignore-line
|
||||
|
@ -74,7 +74,6 @@ class CacheProperties
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function has(): bool
|
||||
{
|
||||
|
@ -24,8 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Support\Cronjobs;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
|
||||
/**
|
||||
* Class AbstractCronjob
|
||||
|
@ -190,6 +190,7 @@ trait AugumentData
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
* @throws \JsonException
|
||||
*/
|
||||
protected function getLimits(Budget $budget, Carbon $start, Carbon $end): Collection // get data + augment with info
|
||||
{
|
||||
|
@ -45,7 +45,8 @@ trait ChartGeneration
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
protected function accountBalanceChart(Collection $accounts, Carbon $start, Carbon $end): array // chart helper method.
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ trait GetConfigurationData
|
||||
* Get config for date range.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
protected function getDateRangeConfig(): array // get configuration + get preferences.
|
||||
{
|
||||
|
@ -78,6 +78,7 @@ trait PeriodOverview
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
protected function getAccountPeriodOverview(Account $account, Carbon $start, Carbon $end): array
|
||||
{
|
||||
@ -269,6 +270,7 @@ trait PeriodOverview
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
protected function getCategoryPeriodOverview(Category $category, Carbon $start, Carbon $end): array
|
||||
{
|
||||
@ -347,6 +349,7 @@ trait PeriodOverview
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
protected function getNoBudgetPeriodOverview(Carbon $start, Carbon $end): array
|
||||
{
|
||||
@ -400,6 +403,7 @@ trait PeriodOverview
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
protected function getNoCategoryPeriodOverview(Carbon $theDate): array
|
||||
{
|
||||
@ -480,6 +484,7 @@ trait PeriodOverview
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
protected function getTagPeriodOverview(Tag $tag, Carbon $start, Carbon $end): array // period overview for tags.
|
||||
{
|
||||
@ -554,6 +559,7 @@ trait PeriodOverview
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
protected function getTransactionPeriodOverview(string $transactionType, Carbon $start, Carbon $end): array
|
||||
{
|
||||
|
@ -162,6 +162,7 @@ trait RequestInformation
|
||||
* Returns if user has seen demo.
|
||||
*
|
||||
* @return bool
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
final protected function hasSeenDemo(): bool // get request info + get preference
|
||||
{
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Http\Controllers;
|
||||
|
||||
use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
|
||||
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
|
||||
use FireflyIII\Support\Search\OperatorQuerySearch;
|
||||
use Illuminate\Http\Request;
|
||||
|
@ -51,6 +51,7 @@ class ParseDateString
|
||||
* @param string $date
|
||||
*
|
||||
* @return Carbon
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function parseDate(string $date): Carbon
|
||||
{
|
||||
@ -265,31 +266,20 @@ class ParseDateString
|
||||
protected function parseKeyword(string $keyword): Carbon
|
||||
{
|
||||
$today = Carbon::today()->startOfDay();
|
||||
switch ($keyword) {
|
||||
default:
|
||||
case 'today':
|
||||
return $today;
|
||||
case 'yesterday':
|
||||
return $today->subDay();
|
||||
case 'tomorrow':
|
||||
return $today->addDay();
|
||||
case 'start of this week':
|
||||
return $today->startOfWeek();
|
||||
case 'end of this week':
|
||||
return $today->endOfWeek();
|
||||
case 'start of this month':
|
||||
return $today->startOfMonth();
|
||||
case 'end of this month':
|
||||
return $today->endOfMonth();
|
||||
case 'start of this quarter':
|
||||
return $today->startOfQuarter();
|
||||
case 'end of this quarter':
|
||||
return $today->endOfQuarter();
|
||||
case 'start of this year':
|
||||
return $today->startOfYear();
|
||||
case 'end of this year':
|
||||
return $today->endOfYear();
|
||||
}
|
||||
|
||||
return match ($keyword) {
|
||||
default => $today,
|
||||
'yesterday' => $today->subDay(),
|
||||
'tomorrow' => $today->addDay(),
|
||||
'start of this week' => $today->startOfWeek(),
|
||||
'end of this week' => $today->endOfWeek(),
|
||||
'start of this month' => $today->startOfMonth(),
|
||||
'end of this month' => $today->endOfMonth(),
|
||||
'start of this quarter' => $today->startOfQuarter(),
|
||||
'end of this quarter' => $today->endOfQuarter(),
|
||||
'start of this year' => $today->startOfYear(),
|
||||
'end of this year' => $today->endOfYear(),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@ -371,7 +361,6 @@ class ParseDateString
|
||||
],
|
||||
];
|
||||
|
||||
/** @var string $part */
|
||||
foreach ($parts as $part) {
|
||||
Log::debug(sprintf('Now parsing part "%s"', $part));
|
||||
$part = trim($part);
|
||||
|
@ -28,7 +28,6 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use PDOException;
|
||||
use Session;
|
||||
|
||||
@ -107,6 +106,7 @@ class Preferences
|
||||
* @param mixed $default
|
||||
*
|
||||
* @return Preference|null
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getFresh(string $name, $default = null): ?Preference
|
||||
{
|
||||
@ -207,6 +207,7 @@ class Preferences
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function lastActivity(): string
|
||||
{
|
||||
|
@ -25,7 +25,6 @@ namespace FireflyIII\Support\Request;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Carbon\Exceptions\InvalidFormatException;
|
||||
use Exception;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
|
@ -166,7 +166,6 @@ class OperatorQuerySearch implements SearchInterface
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function searchTransactions(): LengthAwarePaginator
|
||||
{
|
||||
|
@ -49,7 +49,6 @@ class Steam
|
||||
* @param TransactionCurrency|null $currency
|
||||
*
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function balance(Account $account, Carbon $date, ?TransactionCurrency $currency = null): string
|
||||
@ -97,6 +96,7 @@ class Steam
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return string
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function balanceIgnoreVirtual(Account $account, Carbon $date): string
|
||||
{
|
||||
@ -164,6 +164,8 @@ class Steam
|
||||
* @param TransactionCurrency|null $currency
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function balanceInRange(Account $account, Carbon $start, Carbon $end, ?TransactionCurrency $currency = null): array
|
||||
{
|
||||
@ -246,6 +248,7 @@ class Steam
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return array
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function balancePerCurrency(Account $account, Carbon $date): array
|
||||
{
|
||||
@ -279,6 +282,8 @@ class Steam
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function balancesByAccounts(Collection $accounts, Carbon $date): array
|
||||
{
|
||||
@ -311,6 +316,7 @@ class Steam
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return array
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function balancesPerCurrencyByAccounts(Collection $accounts, Carbon $date): array
|
||||
{
|
||||
@ -444,6 +450,7 @@ class Steam
|
||||
* Get user's language.
|
||||
*
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getLanguage(): string // get preference
|
||||
{
|
||||
@ -454,6 +461,7 @@ class Steam
|
||||
* Get user's locale.
|
||||
*
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getLocale(): string // get preference
|
||||
{
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\TransactionRules\Actions;
|
||||
|
||||
use DB;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\TransactionRules\Actions;
|
||||
|
||||
use DB;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\TransactionRules\Actions;
|
||||
|
||||
use DB;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Log;
|
||||
|
||||
|
@ -24,7 +24,6 @@ namespace FireflyIII\TransactionRules\Actions;
|
||||
|
||||
use DB;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user