1 | <?php |
||
20 | final class AppResponse implements ResponsableContract |
||
21 | { |
||
22 | /** |
||
23 | * Create an HTTP response that represents the object. |
||
24 | * |
||
25 | * @param \Illuminate\Http\Request $request |
||
26 | * @return \Symfony\Component\HttpFoundation\Response |
||
27 | */ |
||
28 | public function toResponse($request) |
||
32 | |||
33 | private function toHtml(): IlluminateResponse |
||
42 | } |
||
43 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: