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

+7 -7
View File
@@ -24,9 +24,9 @@ class BookingDtoTest extends TestCase
$bookingDto = new BookingDto($travel, 1);
$this->assertInstanceOf(BookingDto::class, $bookingDto);
$this->assertSame($travel, $bookingDto->travel);
$this->assertSame(BookingDto::MODE_CREATE, $bookingDto->getMode());
self::assertInstanceOf(BookingDto::class, $bookingDto);
self::assertSame($travel, $bookingDto->travel);
self::assertSame(BookingDto::MODE_CREATE, $bookingDto->getMode());
}
public function testUnserializeHandlesIntTravelId(): void
@@ -40,8 +40,8 @@ class BookingDtoTest extends TestCase
$serialized = serialize($dto);
$restored = unserialize($serialized);
$this->assertInstanceOf(BookingDto::class, $restored);
$this->assertSame(42, $restored->travel->id);
self::assertInstanceOf(BookingDto::class, $restored);
self::assertSame(42, $restored->travel->id);
}
public function testUnserializeHandlesLegacyTravelObject(): void
@@ -60,7 +60,7 @@ class BookingDtoTest extends TestCase
$dto = new BookingDto(new Travel(), 1);
$dto->__unserialize($data);
$this->assertSame($travel, $dto->travel);
$this->assertSame(42, $dto->travel->id);
self::assertSame($travel, $dto->travel);
self::assertSame(42, $dto->travel->id);
}
}