chore: major code cleanup and type safety using phpstan

This commit is contained in:
Björn Fromme committed 2026-04-16 17:11:16 +02:00
1 parent 060cbea9da
commit 3da73d626b
103 files changed
+976 -1192

No files matched your search

@@ -59,9 +59,9 @@ class ParticipantFieldOptionsProviderMandatoryServiceTest extends TestCase
$choiceAttr = $options['choice_attr'];
$attributes = $choiceAttr($mandatoryService);
$this->assertTrue($attributes['readonly']);
$this->assertSame('Diese Leistung ist nicht abwählbar', $attributes['data-tooltip']);
$this->assertArrayNotHasKey('checked', $attributes);
self::assertTrue($attributes['readonly']);
self::assertSame('Diese Leistung ist nicht abwählbar', $attributes['data-tooltip']);
self::assertArrayNotHasKey('checked', $attributes);
}
public function testMandatoryServiceNotSelectedHasNoReadonlyOrChecked(): void
@@ -80,9 +80,9 @@ class ParticipantFieldOptionsProviderMandatoryServiceTest extends TestCase
$choiceAttr = $options['choice_attr'];
$attributes = $choiceAttr($mandatoryService);
$this->assertArrayNotHasKey('readonly', $attributes);
$this->assertArrayNotHasKey('checked', $attributes);
$this->assertArrayNotHasKey('data-tooltip', $attributes);
self::assertArrayNotHasKey('readonly', $attributes);
self::assertArrayNotHasKey('checked', $attributes);
self::assertArrayNotHasKey('data-tooltip', $attributes);
}
public function testNonMandatoryServiceUnaffected(): void
@@ -109,8 +109,8 @@ class ParticipantFieldOptionsProviderMandatoryServiceTest extends TestCase
$choiceAttr = $options['choice_attr'];
$attributes = $choiceAttr($nonMandatoryService);
$this->assertArrayNotHasKey('readonly', $attributes);
$this->assertArrayNotHasKey('checked', $attributes);
self::assertArrayNotHasKey('readonly', $attributes);
self::assertArrayNotHasKey('checked', $attributes);
}
public function testParkingLabelIncludesPrice(): void
@@ -144,7 +144,7 @@ class ParticipantFieldOptionsProviderMandatoryServiceTest extends TestCase
// Do not set participant — age filtering cannot determine choices, returns empty
$options = $this->provider->getFieldOptions('additionalServices', $bookingDto, 0);
$this->assertEmpty($options);
self::assertEmpty($options);
}
private function createMandatoryService(int $id, string $label): Service
@@ -160,6 +160,9 @@ class ParticipantFieldOptionsProviderMandatoryServiceTest extends TestCase
return $service;
}
/**
* @param list<Service> $services
*/
private function createTravelWithAdditionalServices(array $services): Travel
{
$travel = new Travel();