mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-09 20:11:22 +00:00
Fix various phpstan things
This commit is contained in:
@@ -106,12 +106,11 @@ class BudgetLimitController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param BudgetLimit $budgetLimit
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
*/
|
||||
public function delete(Request $request, BudgetLimit $budgetLimit)
|
||||
public function delete(BudgetLimit $budgetLimit)
|
||||
{
|
||||
$this->blRepository->destroyBudgetLimit($budgetLimit);
|
||||
session()->flash('success', trans('firefly.deleted_bl'));
|
||||
|
||||
@@ -87,8 +87,6 @@ class IndexController extends Controller
|
||||
/**
|
||||
* Show all budgets.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @param Carbon|null $start
|
||||
* @param Carbon|null $end
|
||||
*
|
||||
@@ -98,7 +96,7 @@ class IndexController extends Controller
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function index(Request $request, Carbon $start = null, Carbon $end = null)
|
||||
public function index(Carbon $start = null, Carbon $end = null)
|
||||
{
|
||||
$this->abRepository->cleanup();
|
||||
app('log')->debug(sprintf('Start of IndexController::index("%s", "%s")', $start?->format('Y-m-d'), $end?->format('Y-m-d')));
|
||||
@@ -137,7 +135,7 @@ class IndexController extends Controller
|
||||
|
||||
// get budgeted for default currency:
|
||||
if (0 === count($availableBudgets)) {
|
||||
$budgeted = $this->blRepository->budgeted($start, $end, $defaultCurrency, );
|
||||
$budgeted = $this->blRepository->budgeted($start, $end, $defaultCurrency,);
|
||||
$spentArr = $this->opsRepository->sumExpenses($start, $end, null, null, $defaultCurrency);
|
||||
$spent = $spentArr[$defaultCurrency->id]['sum'] ?? '0';
|
||||
unset($spentArr);
|
||||
@@ -196,7 +194,7 @@ class IndexController extends Controller
|
||||
$array['spent'] = $spentArr[$entry->transaction_currency_id]['sum'] ?? '0';
|
||||
|
||||
// budgeted in period:
|
||||
$budgeted = $this->blRepository->budgeted($entry->start_date, $entry->end_date, $entry->transactionCurrency, );
|
||||
$budgeted = $this->blRepository->budgeted($entry->start_date, $entry->end_date, $entry->transactionCurrency,);
|
||||
$array['budgeted'] = $budgeted;
|
||||
$availableBudgets[] = $array;
|
||||
unset($spentArr);
|
||||
@@ -320,10 +318,9 @@ class IndexController extends Controller
|
||||
}
|
||||
// final calculation for 'left':
|
||||
/**
|
||||
* @var int $currencyId
|
||||
* @var array $info
|
||||
* @var int $currencyId
|
||||
*/
|
||||
foreach ($sums['budgeted'] as $currencyId => $info) {
|
||||
foreach (array_keys($sums['budgeted']) as $currencyId) {
|
||||
$spent = $sums['spent'][$currencyId]['amount'] ?? '0';
|
||||
$budgeted = $sums['budgeted'][$currencyId]['amount'] ?? '0';
|
||||
$sums['left'][$currencyId]['amount'] = bcadd($spent, $budgeted);
|
||||
|
||||
@@ -115,12 +115,10 @@ class DebugController extends Controller
|
||||
/**
|
||||
* Show debug info.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index()
|
||||
{
|
||||
$table = $this->generateTable();
|
||||
$table = str_replace(["\n", "\t", ' '], '', $table);
|
||||
|
||||
@@ -48,13 +48,12 @@ class JavascriptController extends Controller
|
||||
* Show info about accounts.
|
||||
*
|
||||
* @param AccountRepositoryInterface $repository
|
||||
* @param CurrencyRepositoryInterface $currencyRepository
|
||||
*
|
||||
* @return Response
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function accounts(AccountRepositoryInterface $repository, CurrencyRepositoryInterface $currencyRepository): Response
|
||||
public function accounts(AccountRepositoryInterface $repository): Response
|
||||
{
|
||||
$accounts = $repository->getAccountsByType(
|
||||
[AccountType::DEFAULT, AccountType::ASSET, AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::CREDITCARD]
|
||||
@@ -104,7 +103,6 @@ class JavascriptController extends Controller
|
||||
*
|
||||
* @param Request $request
|
||||
* @param AccountRepositoryInterface $repository
|
||||
* @param CurrencyRepositoryInterface $currencyRepository
|
||||
*
|
||||
* @return Response
|
||||
* @throws FireflyException
|
||||
@@ -112,7 +110,7 @@ class JavascriptController extends Controller
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function variables(Request $request, AccountRepositoryInterface $repository, CurrencyRepositoryInterface $currencyRepository): Response
|
||||
public function variables(Request $request, AccountRepositoryInterface $repository): Response
|
||||
{
|
||||
$account = $repository->find((int)$request->get('account'));
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
@@ -147,11 +145,9 @@ class JavascriptController extends Controller
|
||||
/**
|
||||
* Bit of a hack but OK.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function variablesV2(Request $request): Response
|
||||
public function variablesV2(): Response
|
||||
{
|
||||
/** @var Carbon $start */
|
||||
$start = clone session('start', today(config('app.timezone'))->startOfMonth());
|
||||
|
||||
@@ -74,13 +74,11 @@ class IndexController extends Controller
|
||||
*
|
||||
* TODO very complicated function.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index()
|
||||
{
|
||||
$this->cleanupObjectGroups();
|
||||
$this->piggyRepos->resetOrder();
|
||||
|
||||
@@ -76,13 +76,12 @@ class ShowController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param TransactionGroup $transactionGroup
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function show(Request $request, TransactionGroup $transactionGroup)
|
||||
public function show( TransactionGroup $transactionGroup)
|
||||
{
|
||||
/** @var TransactionJournal|null $first */
|
||||
$first = $transactionGroup->transactionJournals()->first(['transaction_journals.*']);
|
||||
@@ -105,7 +104,7 @@ class ShowController extends Controller
|
||||
$amounts = $this->getAmounts($groupArray);
|
||||
$accounts = $this->getAccounts($groupArray);
|
||||
|
||||
foreach ($groupArray['transactions'] as $index => $transaction) {
|
||||
foreach (array_keys($groupArray['transactions']) as $index) {
|
||||
$groupArray['transactions'][$index]['tags'] = $this->repository->getTagObjects(
|
||||
$groupArray['transactions'][$index]['transaction_journal_id']
|
||||
);
|
||||
|
||||
@@ -53,13 +53,9 @@ class IndexController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Show debug info.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index()
|
||||
{
|
||||
return view('webhooks.index');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user