Fix phpstan issues

This commit is contained in:
James Cole
2025-09-07 07:31:00 +02:00
parent b87b99a755
commit 296a64e284
103 changed files with 605 additions and 617 deletions

View File

@@ -47,8 +47,7 @@ class ShowController extends Controller
{
use GetConfigurationData;
/** @var RecurringRepositoryInterface Recurring repository */
private $recurring;
private RecurringRepositoryInterface $repository;
/**
* IndexController constructor.
@@ -64,7 +63,7 @@ class ShowController extends Controller
app('view')->share('mainTitleIcon', 'fa-paint-brush');
app('view')->share('title', (string) trans('firefly.recurrences'));
$this->recurring = app(RecurringRepositoryInterface::class);
$this->repository = app(RecurringRepositoryInterface::class);
return $next($request);
}
@@ -87,6 +86,7 @@ class ShowController extends Controller
$admin = auth()->user();
$enrichment = new RecurringEnrichment();
$enrichment->setUser($admin);
/** @var Recurrence $recurrence */
$recurrence = $enrichment->enrichSingle($recurrence);
/** @var RecurrenceTransformer $transformer */
@@ -95,10 +95,10 @@ class ShowController extends Controller
$array = $transformer->transform($recurrence);
$groups = $this->recurring->getTransactions($recurrence);
$groups = $this->repository->getTransactions($recurrence);
$today = today(config('app.timezone'));
$array['repeat_until'] = null !== $array['repeat_until'] ? new Carbon($array['repeat_until']) : null;
$array['journal_count'] = $this->recurring->getJournalCount($recurrence);
$array['journal_count'] = $this->repository->getJournalCount($recurrence);
// transform dates back to Carbon objects and expand information
foreach ($array['repetitions'] as $index => $repetition) {
@@ -106,8 +106,8 @@ class ShowController extends Controller
$date = new Carbon($occurrence)->startOfDay();
$set = [
'date' => $date,
'fired' => $this->recurring->createdPreviously($recurrence, $date)
|| $this->recurring->getJournalCount($recurrence, $date) > 0,
'fired' => $this->repository->createdPreviously($recurrence, $date)
|| $this->repository->getJournalCount($recurrence, $date) > 0,
];
$array['repetitions'][$index]['occurrences'][$item] = $set;
}