chore: fix phpstan errors
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use App\BusProNet\Model\Service;
|
||||
use App\BusProNet\Model\Travel;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Form\Model\ParticipantDto;
|
||||
@@ -21,6 +22,7 @@ use App\Form\Model\ParticipantDto;
|
||||
*/
|
||||
class BookingEditDraftMerger
|
||||
{
|
||||
/** @param array<string, mixed> $data */
|
||||
public function apply(
|
||||
BookingDto $bookingDto,
|
||||
int $participantIndex,
|
||||
@@ -79,6 +81,7 @@ class BookingEditDraftMerger
|
||||
return $participant->mutable;
|
||||
}
|
||||
|
||||
/** @param array<string, mixed> $data */
|
||||
private function applyPersonalData(ParticipantDto $participant, array $data): void
|
||||
{
|
||||
if (true === array_key_exists('firstName', $data)) {
|
||||
@@ -104,6 +107,7 @@ class BookingEditDraftMerger
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array<string, mixed> $data */
|
||||
private function applyAddressData(ParticipantDto $participant, array $data): void
|
||||
{
|
||||
$hasAddressData = null !== ($data['street'] ?? null)
|
||||
@@ -133,6 +137,7 @@ class BookingEditDraftMerger
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array<string, mixed> $data */
|
||||
private function applyBodyDimensions(ParticipantDto $participant, array $data): void
|
||||
{
|
||||
if (true === array_key_exists('height', $data)) {
|
||||
@@ -146,6 +151,7 @@ class BookingEditDraftMerger
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array<string, mixed> $data */
|
||||
private function applyRoomAssignment(ParticipantDto $participant, array $data): void
|
||||
{
|
||||
if (true === array_key_exists('assignedRoomId', $data)) {
|
||||
@@ -156,6 +162,7 @@ class BookingEditDraftMerger
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array<string, mixed> $data */
|
||||
private function applyVoucherCodes(ParticipantDto $participant, array $data): void
|
||||
{
|
||||
if (true === array_key_exists('purchaseVoucherCode', $data)) {
|
||||
@@ -177,6 +184,7 @@ class BookingEditDraftMerger
|
||||
* Multi-select fields (checkboxes) and booleans use overwrite strategy: draft values
|
||||
* always replace API data, since users can intentionally clear these selections.
|
||||
*/
|
||||
/** @param array<string, mixed> $data */
|
||||
private function applyServiceSelections(ParticipantDto $participant, array $data, Travel $travel): void
|
||||
{
|
||||
// Additional services category — only apply draft data when services are mutable.
|
||||
@@ -296,11 +304,11 @@ class BookingEditDraftMerger
|
||||
* The mandatory flag must be looked up from travel data since booking data
|
||||
* doesn't include the pflicht attribute.
|
||||
*
|
||||
* @param array $draftServices Services resolved from draft data
|
||||
* @param array $originalServices Services from fresh API data (booking assignments)
|
||||
* @param Travel $travel Travel data containing mandatory flag on services
|
||||
* @param list<Service> $draftServices Services resolved from draft data
|
||||
* @param list<Service> $originalServices Services from fresh API data (booking assignments)
|
||||
* @param Travel $travel Travel data containing mandatory flag on services
|
||||
*
|
||||
* @return array Merged array with draft services plus any missing mandatory services
|
||||
* @return list<Service> Merged array with draft services plus any missing mandatory services
|
||||
*/
|
||||
private function preserveMandatoryServices(array $draftServices, array $originalServices, Travel $travel): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user