chore: further cleanup and refactor

This commit is contained in:
Björn Fromme
2026-04-19 15:45:02 +02:00
parent 5a0bf11c81
commit 80969d1da0
21 changed files with 606 additions and 321 deletions
+5 -5
View File
@@ -27,7 +27,7 @@ class BookingEditDataLoader
{
public const string CACHE_TAG_USER_PREFIX = 'user_bookings_';
private bool $draftWasRestored = false;
private bool $draftRestored = false;
public function __construct(
private readonly ApiClient $apiClient,
@@ -48,9 +48,9 @@ class BookingEditDataLoader
* This flag is reset on each call to loadFormData() and can be used
* by the controller to show a flash message to the user.
*/
public function wasDraftRestored(): bool
public function isDraftRestored(): bool
{
return $this->draftWasRestored;
return $this->draftRestored;
}
/**
@@ -71,7 +71,7 @@ class BookingEditDataLoader
*/
public function loadFormData(Request $request, int $bookingId, User $user): ?BookingDto
{
$this->draftWasRestored = false;
$this->draftRestored = false;
$formData = $this->bookingSessionService->getBookingDto($request, BookingDto::MODE_EDIT);
@@ -154,7 +154,7 @@ class BookingEditDataLoader
if (null !== $draft) {
$applied = $this->draftService->applyDraftToDto($draft, $formData, $travelData);
if (true === $applied) {
$this->draftWasRestored = true;
$this->draftRestored = true;
}
}