diff --git a/src/Illuminate/Http/Client/Factory.php b/src/Illuminate/Http/Client/Factory.php index 84b8fc61a15d..b466b1e816c8 100644 --- a/src/Illuminate/Http/Client/Factory.php +++ b/src/Illuminate/Http/Client/Factory.php @@ -62,14 +62,14 @@ class Factory /** * The recorded response array. * - * @var array + * @var list */ protected $recorded = []; /** * All created response sequences. * - * @var array + * @var list<\Illuminate\Http\Client\ResponseSequence> */ protected $responseSequences = []; @@ -170,7 +170,7 @@ public static function response($body = null, $status = 200, $headers = []) * Create a new connection exception for use during stubbing. * * @param string|null $message - * @return \GuzzleHttp\Promise\PromiseInterface + * @return \Closure(\Illuminate\Http\Client\Request): \GuzzleHttp\Promise\PromiseInterface */ public static function failedConnection($message = null) { @@ -196,7 +196,7 @@ public function sequence(array $responses = []) /** * Register a stub callable that will intercept requests and be able to return stub responses. * - * @param callable|array|null $callback + * @param callable|array|null $callback * @return $this */ public function fake($callback = null) @@ -258,7 +258,7 @@ public function fakeSequence($url = '*') * Stub the given URL using the given callback. * * @param string $url - * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable|int|string|array $callback + * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable|int|string|array|\Illuminate\Http\Client\ResponseSequence $callback * @return $this */ public function stubUrl($url, $callback) @@ -346,7 +346,7 @@ public function recordRequestResponsePair($request, $response) /** * Assert that a request / response pair was recorded matching a given truth test. * - * @param callable $callback + * @param callable|(\Closure(\Illuminate\Http\Client\Request, \Illuminate\Http\Client\Response|null): bool) $callback * @return void */ public function assertSent($callback) @@ -360,7 +360,7 @@ public function assertSent($callback) /** * Assert that the given request was sent in the given order. * - * @param array $callbacks + * @param list $callbacks * @return void */ public function assertSentInOrder($callbacks) @@ -382,7 +382,7 @@ public function assertSentInOrder($callbacks) /** * Assert that a request / response pair was not recorded matching a given truth test. * - * @param callable $callback + * @param callable|(\Closure(\Illuminate\Http\Client\Request, \Illuminate\Http\Client\Response|null): bool) $callback * @return void */ public function assertNotSent($callback) @@ -435,8 +435,8 @@ public function assertSequencesAreEmpty() /** * Get a collection of the request / response pairs matching the given truth test. * - * @param callable $callback - * @return \Illuminate\Support\Collection + * @param (\Closure(\Illuminate\Http\Client\Request, \Illuminate\Http\Client\Response|null): bool)|callable $callback + * @return \Illuminate\Support\Collection */ public function recorded($callback = null) { diff --git a/src/Illuminate/Http/Client/Pool.php b/src/Illuminate/Http/Client/Pool.php index b5f00258fbab..a540827576b2 100644 --- a/src/Illuminate/Http/Client/Pool.php +++ b/src/Illuminate/Http/Client/Pool.php @@ -26,7 +26,7 @@ class Pool /** * The pool of requests. * - * @var array + * @var array */ protected $pool = []; @@ -66,7 +66,7 @@ protected function asyncRequest() /** * Retrieve the requests in the pool. * - * @return array + * @return array */ public function getRequests() { diff --git a/src/Illuminate/Http/Client/Response.php b/src/Illuminate/Http/Client/Response.php index ac51d9c7ade8..c33c219616bb 100644 --- a/src/Illuminate/Http/Client/Response.php +++ b/src/Illuminate/Http/Client/Response.php @@ -236,7 +236,7 @@ public function serverError() /** * Execute the given callback if there was a server or client error. * - * @param callable $callback + * @param callable|(\Closure(\Illuminate\Http\Client\Response): mixed) $callback * @return $this */ public function onError(callable $callback) @@ -340,7 +340,7 @@ public function throwIf($condition) /** * Throw an exception if the response status code matches the given code. * - * @param callable|int $statusCode + * @param int|(\Closure(int, \Illuminate\Http\Client\Response): bool)|callable $statusCode * @return $this * * @throws \Illuminate\Http\Client\RequestException @@ -358,7 +358,7 @@ public function throwIfStatus($statusCode) /** * Throw an exception unless the response status code matches the given code. * - * @param callable|int $statusCode + * @param int|(\Closure(int, \Illuminate\Http\Client\Response): bool)|callable $statusCode * @return $this * * @throws \Illuminate\Http\Client\RequestException