File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 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
287287
288288 /**
289289 * Cast the response to a DTO.
290+ *
291+ * @template T of object
292+ * @return ($dto is class-string<T> ? T : object)
290293 */
291- public function dto (): mixed
294+ public function dto (? string $ dto = null ): mixed
292295 {
293296 $ request = $ this ->pendingRequest ->getRequest ();
294297 $ connector = $ this ->pendingRequest ->getConnector ();
@@ -304,8 +307,11 @@ public function dto(): mixed
304307
305308 /**
306309 * 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)
307313 */
308- public function dtoOrFail (): mixed
314+ public function dtoOrFail (? string $ dto = null ): mixed
309315 {
310316 if ($ this ->failed ()) {
311317 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