From 3eced3c0537b0d564e8dfdfdea671f0b49d2fb1d Mon Sep 17 00:00:00 2001 From: Luke Kuzmish <42181698+cosmastech@users.noreply.github.com> Date: Fri, 20 Dec 2024 07:37:16 -0500 Subject: [PATCH] Allow passing bool to Http@preventStrayRequests() --- src/Illuminate/Support/Facades/Http.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Support/Facades/Http.php b/src/Illuminate/Support/Facades/Http.php index 83217a04b22..60489694d3c 100644 --- a/src/Illuminate/Support/Facades/Http.php +++ b/src/Illuminate/Support/Facades/Http.php @@ -138,12 +138,13 @@ public static function fakeSequence(string $urlPattern = '*') /** * Indicate that an exception should be thrown if any request is not faked. * + * @param bool $prevent * @return \Illuminate\Http\Client\Factory */ - public static function preventStrayRequests() + public static function preventStrayRequests($prevent = true) { - return tap(static::getFacadeRoot(), function ($fake) { - static::swap($fake->preventStrayRequests()); + return tap(static::getFacadeRoot(), function ($fake) use ($prevent) { + static::swap($fake->preventStrayRequests($prevent)); }); }