diff --git a/src/Command/BpnXmlSyncCommand.php b/src/Command/BpnXmlSyncCommand.php index e1db483..001c506 100644 --- a/src/Command/BpnXmlSyncCommand.php +++ b/src/Command/BpnXmlSyncCommand.php @@ -193,6 +193,7 @@ class BpnXmlSyncCommand extends Command /** * @return array + * * @throws FilesystemException */ private function syncFiles(SymfonyStyle $io): array diff --git a/src/Controller/Account/PersonalDataController.php b/src/Controller/Account/PersonalDataController.php index 6efadf5..8e950b7 100644 --- a/src/Controller/Account/PersonalDataController.php +++ b/src/Controller/Account/PersonalDataController.php @@ -14,9 +14,9 @@ use App\Form\PersonalDataType; use App\Repository\NewsletterOptInConfirmationRepository; use App\Security\Crypt; use App\Service\BookingEditDataLoader; -use App\Service\ProfileCompletenessChecker; use App\Service\MailjetApiClient; use App\Service\NewsletterManager; +use App\Service\ProfileCompletenessChecker; use Doctrine\ORM\EntityManagerInterface; use Psr\Log\LoggerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -37,12 +37,12 @@ class PersonalDataController extends AbstractController public const SESSION_REDIRECT_KEY = '_profile_completion_redirect'; /** - * @param ApiClient $apiClient BusProNet API client for data operations - * @param Crypt $crypt Encryption service for password handling - * @param BookingEditDataLoader $dataLoader Data loader for cache invalidation - * @param ProfileCompletenessChecker $completenessChecker Profile validation service - * @param EntityManagerInterface $entityManager Entity manager for persisting user changes - * @param LoggerInterface $logger Logger for audit trails and debugging + * @param ApiClient $apiClient BusProNet API client for data operations + * @param Crypt $crypt Encryption service for password handling + * @param BookingEditDataLoader $dataLoader Data loader for cache invalidation + * @param ProfileCompletenessChecker $completenessChecker Profile validation service + * @param EntityManagerInterface $entityManager Entity manager for persisting user changes + * @param LoggerInterface $logger Logger for audit trails and debugging */ public function __construct( private readonly ApiClient $apiClient, diff --git a/src/Controller/Booking/Create/Step4Controller.php b/src/Controller/Booking/Create/Step4Controller.php index a233a12..f0926ae 100644 --- a/src/Controller/Booking/Create/Step4Controller.php +++ b/src/Controller/Booking/Create/Step4Controller.php @@ -182,8 +182,7 @@ class Step4Controller extends AbstractController FormInterface $form, bool $newsletterOptInVisible, ?string $newsletterTargetEmail, - ): Response - { + ): Response { $bookingCreateContext = $this->createContextFactory->createWithParticipantPrices($bookingCreateDto); return $this->render('booking/create/step_4.html.twig', [ diff --git a/src/Email/Mailer.php b/src/Email/Mailer.php index 1eb60b0..e2f0a31 100644 --- a/src/Email/Mailer.php +++ b/src/Email/Mailer.php @@ -86,6 +86,7 @@ class Mailer /** * @param array $options + * * @return array */ private function resolveConfig(array $options): array diff --git a/src/Form/Model/BookingSummaryPricingDto.php b/src/Form/Model/BookingSummaryPricingDto.php index 0d0ca8c..b7fc203 100644 --- a/src/Form/Model/BookingSummaryPricingDto.php +++ b/src/Form/Model/BookingSummaryPricingDto.php @@ -10,10 +10,10 @@ namespace App\Form\Model; final class BookingSummaryPricingDto { /** - * @param array> $rooms - * @param array> $services + * @param array> $rooms + * @param array> $services * @param array>|null $surcharges - * @param array $assignmentCounts + * @param array $assignmentCounts */ public function __construct( public readonly array $rooms, diff --git a/src/Form/Service/EditFieldStateProvider.php b/src/Form/Service/EditFieldStateProvider.php index 926ceb8..e6084e3 100644 --- a/src/Form/Service/EditFieldStateProvider.php +++ b/src/Form/Service/EditFieldStateProvider.php @@ -22,8 +22,8 @@ use App\Form\Service\Condition\RentalSelectionCondition; use App\Form\Service\Condition\RoomSelectionCondition; use App\Form\Service\Condition\ServiceSubTypeCondition; use App\Form\Service\Condition\SkiPassSelectionCondition; -use App\Form\Service\Condition\TravelStartCutoffReachedCondition; use App\Form\Service\Condition\TransportationServicesMutabilityCondition; +use App\Form\Service\Condition\TravelStartCutoffReachedCondition; /** * Field state provider for the booking edit workflow. diff --git a/src/Form/Service/ParticipantFieldOptionsProvider.php b/src/Form/Service/ParticipantFieldOptionsProvider.php index 918bb5f..2a3f557 100644 --- a/src/Form/Service/ParticipantFieldOptionsProvider.php +++ b/src/Form/Service/ParticipantFieldOptionsProvider.php @@ -16,8 +16,8 @@ use App\Form\Model\RoomSelectionDto; use App\Form\Service\Abstract\AbstractFieldOptionsProvider; use App\Service\BookingPriceCalculator; use App\Service\InsuranceManager; -use App\Service\ServiceLabelFormatter; use App\Service\ServiceAvailabilityCalculator; +use App\Service\ServiceLabelFormatter; use Symfony\Contracts\Translation\TranslatorInterface; /** diff --git a/src/Form/Service/ParticipantRentalsFieldHandler.php b/src/Form/Service/ParticipantRentalsFieldHandler.php index cf75211..a0c28ca 100644 --- a/src/Form/Service/ParticipantRentalsFieldHandler.php +++ b/src/Form/Service/ParticipantRentalsFieldHandler.php @@ -222,8 +222,8 @@ class ParticipantRentalsFieldHandler extends AbstractParticipantFieldHandler * - rental.dateFrom === skipass.dateFrom * - rental.dateTo === skipass.dateTo * - * @param array $rentals All available rental services - * @param \App\Form\Model\ParticipantDto $participant The participant with skipass selection + * @param array $rentals All available rental services + * @param ParticipantDto $participant The participant with skipass selection * * @return array Filtered rentals matching the skipass duration */ diff --git a/src/Service/BookingConfigurator.php b/src/Service/BookingConfigurator.php index 1de6687..f852255 100644 --- a/src/Service/BookingConfigurator.php +++ b/src/Service/BookingConfigurator.php @@ -13,8 +13,8 @@ use App\BusProNet\XmlLoader\AgencyLoader; use App\Exception\NoRoomsAvailableException; use App\Form\Model\BookingDto; use App\Form\Model\ParticipantDto; -use App\Form\Service\ServiceAgeEvaluator; use App\Form\Model\RoomSelectionDto; +use App\Form\Service\ServiceAgeEvaluator; use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -539,8 +539,7 @@ class BookingConfigurator BookingDto $bookingDto, int $participantIndex, ServiceAgeEvaluator $ageEvaluator, - ): bool - { + ): bool { if (false === $ageEvaluator->canEvaluate($service)) { return true; } @@ -640,5 +639,4 @@ class BookingConfigurator $bookingDto->bookingStatus = $this->bookingStatusRuleRegistry->evaluateStatus($bookingDto); } - } diff --git a/src/Service/BookingCreateContextFactory.php b/src/Service/BookingCreateContextFactory.php index f8c6a82..6870039 100644 --- a/src/Service/BookingCreateContextFactory.php +++ b/src/Service/BookingCreateContextFactory.php @@ -25,8 +25,7 @@ class BookingCreateContextFactory public function create( BookingDto $bookingDto, string $pricingMode = RoomPricingCalculator::PRICING_MODE_ASSIGNMENT, - ): BookingCreateContext - { + ): BookingCreateContext { $baseContext = $this->buildBaseContext($bookingDto, $pricingMode); return new BookingCreateContext( diff --git a/src/Service/BookingEditContextFactory.php b/src/Service/BookingEditContextFactory.php index 199f43a..1976a9e 100644 --- a/src/Service/BookingEditContextFactory.php +++ b/src/Service/BookingEditContextFactory.php @@ -7,8 +7,8 @@ namespace App\Service; use App\BusProNet\Model\Booking; use App\Form\Model\BookingDto; use App\Form\Model\BookingEditContext; -use App\Form\Model\BookingSummaryDto; use App\Form\Model\BookingMutabilityDto; +use App\Form\Model\BookingSummaryDto; /** * Prepares the shared booking edit flow context. diff --git a/src/Service/BookingEditDataLoader.php b/src/Service/BookingEditDataLoader.php index e1a4711..5da4e9d 100644 --- a/src/Service/BookingEditDataLoader.php +++ b/src/Service/BookingEditDataLoader.php @@ -88,7 +88,7 @@ class BookingEditDataLoader // Refresh availability and mutability data to ensure current state. // Availability is refreshed on every load; mutability is patched from cache. $this->travelDataService->enrichWithFreshAvailabilities($formData->travel); - + $bookingData = $this->fetchBookingData($bookingId, $user); if (null !== $bookingData && !($bookingData instanceof Notification)) { $mutableData = $this->travelDataService->getMutabilityData($bookingData->dateId, cached: true); diff --git a/src/Service/BookingPricingAssembler.php b/src/Service/BookingPricingAssembler.php index 5357fe3..5417923 100644 --- a/src/Service/BookingPricingAssembler.php +++ b/src/Service/BookingPricingAssembler.php @@ -241,6 +241,7 @@ class BookingPricingAssembler * Groups services by their subtypes for display, separating positive costs and discounts. * * @param array> $serviceAggregation + * * @return array> */ private function groupServicesBySubtype(array $serviceAggregation): array @@ -387,6 +388,7 @@ class BookingPricingAssembler /** * @param array $serviceData + * * @return array */ private function createServicePricingLineItem(array $serviceData): array diff --git a/src/Service/BookingSummaryAssembler.php b/src/Service/BookingSummaryAssembler.php index b233207..0fa9b21 100644 --- a/src/Service/BookingSummaryAssembler.php +++ b/src/Service/BookingSummaryAssembler.php @@ -42,8 +42,7 @@ class BookingSummaryAssembler public function getSummaryData( BookingDto $bookingDto, string $roomPricingMode = RoomPricingCalculator::PRICING_MODE_ASSIGNMENT, - ): BookingSummaryDto - { + ): BookingSummaryDto { // Get selected rooms (for Step1 controller compatibility) $selectedRooms = $bookingDto->getSelectedRooms(); diff --git a/src/Service/BpnXmlAnonymizer.php b/src/Service/BpnXmlAnonymizer.php index 586ea5a..2180d31 100644 --- a/src/Service/BpnXmlAnonymizer.php +++ b/src/Service/BpnXmlAnonymizer.php @@ -161,8 +161,6 @@ class BpnXmlAnonymizer } /** - * @param string $personId - * * @return array{firstName: string, lastName: string, street: string, postalCode: string, city: string, email: string, mobilePhone: string} */ private function getOrCreateIdentity(string $personId): array diff --git a/src/Service/MailjetApiClient.php b/src/Service/MailjetApiClient.php index 61f46b5..a11a76c 100644 --- a/src/Service/MailjetApiClient.php +++ b/src/Service/MailjetApiClient.php @@ -157,19 +157,13 @@ class MailjetApiClient $payload = $response->toArray(false); if ($statusCode >= 400) { - $payloadSummary = is_array($payload) - ? json_encode($payload, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) - : null; + $payloadSummary = json_encode($payload, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + $payloadSummary = false === $payloadSummary ? null : $payloadSummary; - throw new NewsletterProviderException(sprintf( - 'Mailjet request failed with status %d for resource %s%s', - $statusCode, - $resource, - null !== $payloadSummary ? sprintf(' (%s)', $payloadSummary) : '' - )); + throw new NewsletterProviderException(sprintf('Mailjet request failed with status %d for resource %s%s', $statusCode, $resource, null !== $payloadSummary ? sprintf(' (%s)', $payloadSummary) : '')); } - return is_array($payload) ? $payload : []; + return $payload; } catch (\Throwable $exception) { if ($allow404 && str_contains($exception->getMessage(), '404')) { return []; @@ -179,10 +173,7 @@ class MailjetApiClient throw $exception; } - throw new NewsletterProviderException( - sprintf('Mailjet request error for resource %s', $resource), - previous: $exception - ); + throw new NewsletterProviderException(sprintf('Mailjet request error for resource %s', $resource), previous: $exception); } } diff --git a/src/Service/NewsletterManager.php b/src/Service/NewsletterManager.php index 090f579..6a25e4d 100644 --- a/src/Service/NewsletterManager.php +++ b/src/Service/NewsletterManager.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace App\Service; use App\Email\Mailer; -use App\Exception\NewsletterProviderException; use App\Entity\NewsletterOptInConfirmation; +use App\Exception\NewsletterProviderException; use App\Model\NewsletterConfirmationResult; use App\Repository\NewsletterOptInConfirmationRepository; use Doctrine\ORM\EntityManagerInterface; diff --git a/src/Service/ParticipantCardAssembler.php b/src/Service/ParticipantCardAssembler.php index 32d09b1..edc4a09 100644 --- a/src/Service/ParticipantCardAssembler.php +++ b/src/Service/ParticipantCardAssembler.php @@ -26,8 +26,6 @@ class ParticipantCardAssembler /** * Get card data for a single participant. - * - * @return ParticipantCardDataDto */ public function getCardData(BookingDto $bookingDto, int $index): ParticipantCardDataDto { @@ -124,8 +122,6 @@ class ParticipantCardAssembler * * Returns a dash marker when the price is zero and no room is assigned, * indicating incomplete configuration rather than a zero-cost booking. - * - * @return ParticipantCardPriceDto */ private function getPriceData(BookingDto $bookingDto, int $index): ParticipantCardPriceDto { @@ -169,8 +165,6 @@ class ParticipantCardAssembler /** * Get card data for a single participant with validation state. - * - * @return ParticipantCardDataDto */ public function getCardDataWithValidation(BookingDto $bookingDto, int $index): ParticipantCardDataDto { diff --git a/src/Service/RoomPricingCalculator.php b/src/Service/RoomPricingCalculator.php index 9e2a3ad..785ef62 100644 --- a/src/Service/RoomPricingCalculator.php +++ b/src/Service/RoomPricingCalculator.php @@ -28,8 +28,7 @@ class RoomPricingCalculator public function calculateRoomPricing( BookingDto $bookingDto, string $pricingMode = self::PRICING_MODE_ASSIGNMENT, - ): array - { + ): array { // In edit mode, use room data from the booking entity if (BookingDto::MODE_EDIT === $bookingDto->getMode() && null !== $bookingDto->booking) { return $this->calculateRoomPricingFromBooking($bookingDto); @@ -45,8 +44,7 @@ class RoomPricingCalculator public function calculateRoomTotal( BookingDto $bookingDto, string $pricingMode = self::PRICING_MODE_ASSIGNMENT, - ): float - { + ): float { $roomPricing = $this->calculateRoomPricing($bookingDto, $pricingMode); return array_sum(array_column($roomPricing, 'totalPrice')); diff --git a/src/Service/ServiceLabelFormatter.php b/src/Service/ServiceLabelFormatter.php index 2773e89..aa92a9e 100644 --- a/src/Service/ServiceLabelFormatter.php +++ b/src/Service/ServiceLabelFormatter.php @@ -40,7 +40,7 @@ final class ServiceLabelFormatter return $fallbackLabel; } - if (!($service instanceof Service)) { + if (!$service instanceof Service) { return $fallbackLabel; } diff --git a/src/Service/TravelDataProvider.php b/src/Service/TravelDataProvider.php index c05bafe..76f11a8 100644 --- a/src/Service/TravelDataProvider.php +++ b/src/Service/TravelDataProvider.php @@ -85,9 +85,9 @@ class TravelDataProvider * * @return Travel|null The travel data or null on unexpected failure * - * @throws TravelNotFoundException When the travel date is not found - * @throws HotelNotFoundException When the requested hotel is not found - * @throws HotelNotInTravelException When the hotel does not belong to this travel + * @throws TravelNotFoundException When the travel date is not found + * @throws HotelNotFoundException When the requested hotel is not found + * @throws HotelNotInTravelException When the hotel does not belong to this travel */ public function getTravelDataFromXml(int $dateId, ?int $hotelId = null): ?Travel { diff --git a/src/Service/TravelSnapshotManager.php b/src/Service/TravelSnapshotManager.php index 9085c92..e993741 100644 --- a/src/Service/TravelSnapshotManager.php +++ b/src/Service/TravelSnapshotManager.php @@ -162,14 +162,16 @@ class TravelSnapshotManager /** * Refreshes snapshot payloads with extended availability data. + * * @param array|null $xmlAvailableDateIds + * * @return array{processed:int,updated:int,failed:int} */ public function refreshExtendedSnapshots( int $limit = 500, bool $force = false, int $refreshAfterMinutes = 360, - ?array $xmlAvailableDateIds = null + ?array $xmlAvailableDateIds = null, ): array { $dateToThreshold = new \DateTimeImmutable('today'); $refreshBefore = new \DateTimeImmutable(sprintf('-%d minutes', $refreshAfterMinutes)); diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php index 57eac10..b0ded76 100644 --- a/src/Twig/AppRuntime.php +++ b/src/Twig/AppRuntime.php @@ -14,7 +14,6 @@ use App\Model\DomainConfig; use App\Service\ParticipantEligibilityChecker; use Symfony\Component\Form\FormView; use Symfony\Component\HttpFoundation\RequestStack; -use Twig\Environment; use Twig\Extension\RuntimeExtensionInterface; use Twig\Extra\Intl\IntlExtension; diff --git a/src/Validator/Constraints/MandatoryAdditionalServicesSelected.php b/src/Validator/Constraints/MandatoryAdditionalServicesSelected.php index 4e93e5a..70497d5 100644 --- a/src/Validator/Constraints/MandatoryAdditionalServicesSelected.php +++ b/src/Validator/Constraints/MandatoryAdditionalServicesSelected.php @@ -22,4 +22,3 @@ class MandatoryAdditionalServicesSelected extends Constraint return static::CLASS_CONSTRAINT; } } - diff --git a/src/Validator/Constraints/MandatoryAdditionalServicesSelectedValidator.php b/src/Validator/Constraints/MandatoryAdditionalServicesSelectedValidator.php index c42d31d..e0133a4 100644 --- a/src/Validator/Constraints/MandatoryAdditionalServicesSelectedValidator.php +++ b/src/Validator/Constraints/MandatoryAdditionalServicesSelectedValidator.php @@ -83,4 +83,3 @@ class MandatoryAdditionalServicesSelectedValidator extends ConstraintValidator } } } - diff --git a/tests/Service/BookingEditSubmitterTest.php b/tests/Service/BookingEditSubmitterTest.php index 6120ccc..1171b10 100644 --- a/tests/Service/BookingEditSubmitterTest.php +++ b/tests/Service/BookingEditSubmitterTest.php @@ -423,11 +423,11 @@ class BookingEditSubmitterTest extends TestCase private function createService( ?\App\BusProNet\ApiClient $apiClient = null, - ?BookingEditDataLoader $dataLoader = null, - ?BookingEditDraftManager $draftService = null, - ?TravelDataProvider $travelDataService = null, - ?BookingEditSubmitGuard $submitGuard = null, - ?BookingSessionStore $bookingSessionService = null, + ?BookingEditDataLoader $dataLoader = null, + ?BookingEditDraftManager $draftService = null, + ?TravelDataProvider $travelDataService = null, + ?BookingEditSubmitGuard $submitGuard = null, + ?BookingSessionManager $bookingSessionService = null, ): BookingEditSubmitter { return new BookingEditSubmitter( $apiClient ?? $this->createMock(\App\BusProNet\ApiClient::class),