@@ -62,14 +62,14 @@ class Factory
62
62
/**
63
63
* The recorded response array.
64
64
*
65
- * @var array
65
+ * @var list< array{0: \Illuminate\Http\Client\Request, 1: \Illuminate\Http\Client\Response|null}>
66
66
*/
67
67
protected $ recorded = [];
68
68
69
69
/**
70
70
* All created response sequences.
71
71
*
72
- * @var array
72
+ * @var list<\Illuminate\Http\Client\ResponseSequence>
73
73
*/
74
74
protected $ responseSequences = [];
75
75
@@ -195,7 +195,7 @@ public static function failedRequest($body = null, $status = 200, $headers = [])
195
195
* Create a new connection exception for use during stubbing.
196
196
*
197
197
* @param string|null $message
198
- * @return \GuzzleHttp\Promise\PromiseInterface
198
+ * @return \Closure(\Illuminate\Http\Client\Request): \ GuzzleHttp\Promise\PromiseInterface
199
199
*/
200
200
public static function failedConnection ($ message = null )
201
201
{
@@ -221,7 +221,7 @@ public function sequence(array $responses = [])
221
221
/**
222
222
* Register a stub callable that will intercept requests and be able to return stub responses.
223
223
*
224
- * @param callable|array|null $callback
224
+ * @param callable|array<string, mixed> |null $callback
225
225
* @return $this
226
226
*/
227
227
public function fake ($ callback = null )
@@ -283,7 +283,7 @@ public function fakeSequence($url = '*')
283
283
* Stub the given URL using the given callback.
284
284
*
285
285
* @param string $url
286
- * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable|int|string|array $callback
286
+ * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable|int|string|array|\Illuminate\Http\Client\ResponseSequence $callback
287
287
* @return $this
288
288
*/
289
289
public function stubUrl ($ url , $ callback )
@@ -371,7 +371,7 @@ public function recordRequestResponsePair($request, $response)
371
371
/**
372
372
* Assert that a request / response pair was recorded matching a given truth test.
373
373
*
374
- * @param callable $callback
374
+ * @param callable|(\Closure(\Illuminate\Http\Client\Request, \Illuminate\Http\Client\Response|null): bool) $callback
375
375
* @return void
376
376
*/
377
377
public function assertSent ($ callback )
@@ -385,7 +385,7 @@ public function assertSent($callback)
385
385
/**
386
386
* Assert that the given request was sent in the given order.
387
387
*
388
- * @param array $callbacks
388
+ * @param list<string|(\Closure(\Illuminate\Http\Client\Request, \Illuminate\Http\Client\Response|null): bool)|callable> $callbacks
389
389
* @return void
390
390
*/
391
391
public function assertSentInOrder ($ callbacks )
@@ -407,7 +407,7 @@ public function assertSentInOrder($callbacks)
407
407
/**
408
408
* Assert that a request / response pair was not recorded matching a given truth test.
409
409
*
410
- * @param callable $callback
410
+ * @param callable|(\Closure(\Illuminate\Http\Client\Request, \Illuminate\Http\Client\Response|null): bool) $callback
411
411
* @return void
412
412
*/
413
413
public function assertNotSent ($ callback )
@@ -460,8 +460,8 @@ public function assertSequencesAreEmpty()
460
460
/**
461
461
* Get a collection of the request / response pairs matching the given truth test.
462
462
*
463
- * @param callable $callback
464
- * @return \Illuminate\Support\Collection
463
+ * @param (\Closure(\Illuminate\Http\Client\Request, \Illuminate\Http\Client\Response|null): bool)| callable $callback
464
+ * @return \Illuminate\Support\Collection<int, array{0: \Illuminate\Http\Client\Request, 1: \Illuminate\Http\Client\Response|null}>
465
465
*/
466
466
public function recorded ($ callback = null )
467
467
{
0 commit comments