File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -287,8 +287,11 @@ public function collect(string|int|null $key = null): Collection
287
287
288
288
/**
289
289
* Cast the response to a DTO.
290
+ *
291
+ * @template T of object
292
+ * @return ($dto is class-string<T> ? T : object)
290
293
*/
291
- public function dto (): mixed
294
+ public function dto (? string $ dto = null ): mixed
292
295
{
293
296
$ request = $ this ->pendingRequest ->getRequest ();
294
297
$ connector = $ this ->pendingRequest ->getConnector ();
@@ -304,8 +307,11 @@ public function dto(): mixed
304
307
305
308
/**
306
309
* Convert the response into a DTO or throw a LogicException if the response failed
310
+ *
311
+ * @template T of object
312
+ * @return ($dto is class-string<T> ? T : object)
307
313
*/
308
- public function dtoOrFail (): mixed
314
+ public function dtoOrFail (? string $ dto = null ): mixed
309
315
{
310
316
if ($ this ->failed ()) {
311
317
throw new LogicException ('Unable to create data transfer object as the response has failed. ' , 0 , $ this ->toException ());
You can’t perform that action at this time.
0 commit comments