We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aeca748 commit f1c415bCopy full SHA for f1c415b
examples/4-projection.phpt
@@ -24,7 +24,8 @@ $eventsProduced = $book->getRecordedEvents();
24
// normally loaded from persistent storage
25
$loadedEvents = $eventsProduced;
26
27
-$lentTo = false;
+/** @var null|\Library\UserId $lentTo */
28
+$lentTo = null;
29
30
foreach($loadedEvents as $event) {
31
@@ -48,7 +49,8 @@ foreach($loadedEvents as $event) {
48
49
50
function whoHasTheBook(\Library\BookId $id): ?\Library\UserId {
51
$data = \file_get_contents(__DIR__ . '/data/'. $id);
- if ($data === false) {
52
+ \assert($data !== false);
53
+ if ($data === '') {
54
return null;
55
}
56
return \Library\UserId::reconstitute($data);
0 commit comments