chore: major code cleanup and type safety using phpstan
This commit is contained in:
1 parent
060cbea9da
commit
3da73d626b
103 files changed
+976
-1192
No files matched your search
@@ -23,18 +23,18 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
|
||||
public function testGetFieldName(): void
|
||||
{
|
||||
$this->assertSame('parking', $this->handler->getFieldName());
|
||||
self::assertSame('parking', $this->handler->getFieldName());
|
||||
}
|
||||
|
||||
public function testGetDependencies(): void
|
||||
{
|
||||
$this->assertSame(['transportationOutbound', 'transportationInbound', 'dateOfBirth'], $this->handler->getDependencies());
|
||||
self::assertSame(['transportationOutbound', 'transportationInbound', 'dateOfBirth'], $this->handler->getDependencies());
|
||||
}
|
||||
|
||||
public function testShouldProcessAlwaysReturnsTrue(): void
|
||||
{
|
||||
$this->assertTrue($this->handler->shouldProcess([], BookingDto::MODE_CREATE, 0));
|
||||
$this->assertTrue($this->handler->shouldProcess(['some' => 'data'], BookingDto::MODE_EDIT, 5));
|
||||
self::assertTrue($this->handler->shouldProcess([], BookingDto::MODE_CREATE, 0));
|
||||
self::assertTrue($this->handler->shouldProcess(['some' => 'data'], BookingDto::MODE_EDIT, 5));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
*/
|
||||
public function testNormalizeCheckboxValueReturnsTrueWhenChecked(mixed $value): void
|
||||
{
|
||||
$this->assertTrue($this->invokeNormalizeCheckboxValue($value));
|
||||
self::assertTrue($this->invokeNormalizeCheckboxValue($value));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
*/
|
||||
public function testNormalizeCheckboxValueReturnsFalseWhenUnchecked(mixed $value): void
|
||||
{
|
||||
$this->assertFalse($this->invokeNormalizeCheckboxValue($value));
|
||||
self::assertFalse($this->invokeNormalizeCheckboxValue($value));
|
||||
}
|
||||
|
||||
public function testProcessFieldWithoutParticipant(): void
|
||||
@@ -81,8 +81,8 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
|
||||
$this->handler->processField($submittedData, $bookingDto, 0);
|
||||
|
||||
$this->assertFalse($participant->parking);
|
||||
$this->assertNull($participant->parkingService);
|
||||
self::assertFalse($participant->parking);
|
||||
self::assertNull($participant->parkingService);
|
||||
}
|
||||
|
||||
public function testProcessFieldClearsParkingWhenParticipantIsUnder18(): void
|
||||
@@ -103,8 +103,8 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
|
||||
$this->handler->processField($submittedData, $bookingDto, 0);
|
||||
|
||||
$this->assertFalse($participant->parking);
|
||||
$this->assertNull($participant->parkingService);
|
||||
self::assertFalse($participant->parking);
|
||||
self::assertNull($participant->parkingService);
|
||||
}
|
||||
|
||||
public function testProcessFieldClearsParkingWhenParticipantIsExactly17(): void
|
||||
@@ -130,7 +130,7 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
|
||||
$this->handler->processField($submittedData, $bookingDto, 0);
|
||||
|
||||
$this->assertFalse($participant->parking);
|
||||
self::assertFalse($participant->parking);
|
||||
}
|
||||
|
||||
public function testProcessFieldAllowsParkingForAdultWithPkw(): void
|
||||
@@ -150,7 +150,7 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
|
||||
$this->handler->processField($submittedData, $bookingDto, 0);
|
||||
|
||||
$this->assertTrue($participant->parking);
|
||||
self::assertTrue($participant->parking);
|
||||
}
|
||||
|
||||
public function testProcessFieldAllowsParkingForExactly18YearOld(): void
|
||||
@@ -170,7 +170,7 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
|
||||
$this->handler->processField($submittedData, $bookingDto, 0);
|
||||
|
||||
$this->assertTrue($participant->parking);
|
||||
self::assertTrue($participant->parking);
|
||||
}
|
||||
|
||||
public function testProcessFieldClearsParkingWhenNoDateOfBirth(): void
|
||||
@@ -190,8 +190,8 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
|
||||
$this->handler->processField($submittedData, $bookingDto, 0);
|
||||
|
||||
$this->assertFalse($participant->parking);
|
||||
$this->assertNull($participant->parkingService);
|
||||
self::assertFalse($participant->parking);
|
||||
self::assertNull($participant->parkingService);
|
||||
}
|
||||
|
||||
public function testProcessFieldClearsParkingWhenBabyParticipant(): void
|
||||
@@ -212,8 +212,8 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
|
||||
$this->handler->processField($submittedData, $bookingDto, 0);
|
||||
|
||||
$this->assertFalse($participant->parking);
|
||||
$this->assertNull($participant->parkingService);
|
||||
self::assertFalse($participant->parking);
|
||||
self::assertNull($participant->parkingService);
|
||||
}
|
||||
|
||||
public function testProcessFieldClearsParkingForChildParticipant(): void
|
||||
@@ -234,7 +234,7 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
|
||||
$this->handler->processField($submittedData, $bookingDto, 0);
|
||||
|
||||
$this->assertFalse($participant->parking);
|
||||
self::assertFalse($participant->parking);
|
||||
}
|
||||
|
||||
public function testProcessFieldSetsParkingToFalseWhenNotSelected(): void
|
||||
@@ -253,8 +253,8 @@ class ParticipantParkingFieldHandlerTest extends TestCase
|
||||
|
||||
$this->handler->processField($submittedData, $bookingDto, 0);
|
||||
|
||||
$this->assertFalse($participant->parking);
|
||||
$this->assertNull($participant->parkingService);
|
||||
self::assertFalse($participant->parking);
|
||||
self::assertNull($participant->parkingService);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user