We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a98908 commit d6ecb78Copy full SHA for d6ecb78
src/Illuminate/Http/Client/Factory.php
@@ -469,12 +469,13 @@ public function recorded($callback = null)
469
return new Collection;
470
}
471
472
- $callback = $callback ?: function () {
473
- return true;
474
- };
+ $collect = new Collection($this->recorded);
+
+ if ($callback) {
475
+ return $collect->filter(fn ($pair) => $callback($pair[0], $pair[1]));
476
+ }
477
- return (new Collection($this->recorded))
- ->filter(fn ($pair) => $callback($pair[0], $pair[1]));
478
+ return $collect;
479
480
481
/**
0 commit comments