chore: code cleanup with rector and php-cs-fixer

This commit is contained in:
Björn Fromme
2026-05-04 17:20:01 +02:00
parent d211425ff2
commit 1fa8f88a6d
38 changed files with 130 additions and 98 deletions
+17 -12
View File
@@ -4,6 +4,11 @@ declare(strict_types=1);
namespace App\Tests\Form\Model;
use App\BusProNet\Model\Booking;
use App\BusProNet\Model\Address;
use App\Form\Model\AddressDto;
use App\BusProNet\Model\Service;
use App\BusProNet\Model\Insurance;
use App\BusProNet\Model\Travel;
use App\BusProNet\XmlLoader\AgencyLoader;
use App\Form\Model\BookingDto;
@@ -314,7 +319,7 @@ class ParticipantEditDtoTest extends TestCase
$bookingDto = new BookingDto($travel, 1); // hotelId must be int
// Create mock booking to simulate edit mode
$mockBooking = new \App\BusProNet\Model\Booking();
$mockBooking = new Booking();
$bookingDto->booking = $mockBooking;
// Create valid participants with all required fields for strict validation
@@ -322,7 +327,7 @@ class ParticipantEditDtoTest extends TestCase
$participant1->index = 0;
$participant1->mutable = false; // Immutable - strict validation applies
$participant1->mobile = '+49 123 456789'; // Required for applicant
$participant1->address = new \App\BusProNet\Model\Address();
$participant1->address = new Address();
$participant1->address->street = 'Test Street 1';
$participant1->address->postCode = '12345';
$participant1->address->city = 'Test City';
@@ -489,7 +494,7 @@ class ParticipantEditDtoTest extends TestCase
$participant->dateOfBirth = $travel->dateFrom->modify('-2 years');
$participant->index = 0;
$participant->mobile = '+49 123 456789';
$participant->address = new \App\BusProNet\Model\Address();
$participant->address = new Address();
$participant->address->street = 'Test Street 1';
$participant->address->postCode = '12345';
$participant->address->city = 'Test City';
@@ -526,7 +531,7 @@ class ParticipantEditDtoTest extends TestCase
$participant->dateOfBirth = $travel->dateFrom->modify('-3 years');
$participant->index = 0;
$participant->mobile = '+49 123 456789';
$participant->address = new \App\BusProNet\Model\Address();
$participant->address = new Address();
$participant->address->street = 'Test Street 1';
$participant->address->postCode = '12345';
$participant->address->city = 'Test City';
@@ -559,7 +564,7 @@ class ParticipantEditDtoTest extends TestCase
$bookingDto = new BookingDto($travel, 1);
// Create mock booking to simulate edit mode
$mockBooking = new \App\BusProNet\Model\Booking();
$mockBooking = new Booking();
$bookingDto->booking = $mockBooking;
// Create adult participant without ski pass in edit mode
@@ -568,7 +573,7 @@ class ParticipantEditDtoTest extends TestCase
$participant->index = 0;
$participant->mutable = false;
$participant->mobile = '+49 123 456789';
$participant->address = new \App\BusProNet\Model\Address();
$participant->address = new Address();
$participant->address->street = 'Test Street 1';
$participant->address->postCode = '12345';
$participant->address->city = 'Test City';
@@ -606,7 +611,7 @@ class ParticipantEditDtoTest extends TestCase
$participant->dateOfBirth = new \DateTimeImmutable('2023-06-02');
$participant->index = 0;
$participant->mobile = '+49 123 456789';
$participant->address = new \App\BusProNet\Model\Address();
$participant->address = new Address();
$participant->address->street = 'Test Street 1';
$participant->address->postCode = '12345';
$participant->address->city = 'Test City';
@@ -647,7 +652,7 @@ class ParticipantEditDtoTest extends TestCase
$participant->mobile = '+49 123 456789';
if (null === $participant->address) {
$participant->address = new \App\Form\Model\AddressDto();
$participant->address = new AddressDto();
}
$participant->address->street = 'Test Street 1';
$participant->address->postCode = '12345';
@@ -712,9 +717,9 @@ class ParticipantEditDtoTest extends TestCase
return $participant;
}
private function createMockService(): \App\BusProNet\Model\Service
private function createMockService(): Service
{
$service = new \App\BusProNet\Model\Service();
$service = new Service();
$service->id = 1;
$service->label = 'Test Service';
$service->subType = 'TEST';
@@ -723,9 +728,9 @@ class ParticipantEditDtoTest extends TestCase
return $service;
}
private function createMockInsurance(): \App\BusProNet\Model\Insurance
private function createMockInsurance(): Insurance
{
$insurance = new \App\BusProNet\Model\Insurance();
$insurance = new Insurance();
$insurance->id = '1';
$insurance->label = 'Test Insurance';
$insurance->price = 10.0;