Skip to content

Commit

Permalink
docs: add return types to arrow functions (#70)
Browse files Browse the repository at this point in the history
and fix a minor code style
  • Loading branch information
carusogabriel authored Jan 8, 2024
1 parent 06e4b3c commit 99856ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ class MyTest extends KernelTestCase // or WebTestCase
// get specific envelope
$queue->first(); // TestEnvelope - first one on the collection
$queue->first(MyMessage::class); // TestEnvelope - first where message class is MyMessage
$queue->first(function(Envelope $e) {
$queue->first(function(Envelope $e): bool {
return $e->getMessage() instanceof MyMessage && $e->getMessage()->isSomething();
}); // TestEnvelope - first that matches the filter callback
// Equivalent to above - use the message class as the filter function typehint to
// auto-filter to this message type.
$queue->first(fn(MyMessage $m) => $m->isSomething()); // TestEnvelope
$queue->first(fn(MyMessage $m): bool => $m->isSomething()); // TestEnvelope
// TestEnvelope stamp assertions
$queue->first()->assertHasStamp(DelayStamp::class);
Expand Down Expand Up @@ -407,7 +407,7 @@ class TestDelayedActions extends KernelTestCase
// ...
// 3. assert nothing happens yet
$transport=$this->transport('async');
$transport = $this->transport('async');
$transport->process();
$transport->queue()->assertCount(2);
Expand Down

0 comments on commit 99856ba

Please sign in to comment.