Skip to content

Commit dd90f8e

Browse files
committed
Demonstrate whenNull() chaining [skip ci]
1 parent e6d4c21 commit dd90f8e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ $user= $first->orUse(function() { return $this->currentUser(); });
6464
$name= $first
6565
->filter(function($user) { return !$user->isDeleted(); })
6666
->whenNull($this->currentUser)
67+
->whenNull(function() { return $this->guestUser(); })
6768
->map('com.example.User::name')
6869
->get()
6970
;

0 commit comments

Comments
 (0)