1 | <?php |
||
11 | trait Response |
||
12 | { |
||
13 | /** |
||
14 | * Make a JSON response. |
||
15 | * |
||
16 | * @param $statusCode |
||
17 | * |
||
18 | * @return IlluminateJsonResponse |
||
19 | */ |
||
20 | protected function makeJsonResponse($statusCode) |
||
27 | |||
28 | /** |
||
29 | * Make the status code, to respond accordingly. |
||
30 | * |
||
31 | * @return int |
||
32 | */ |
||
33 | 7 | protected function makeStatusCode() |
|
43 | |||
44 | /** |
||
45 | * Make a web response. |
||
46 | * |
||
47 | * @param $statusCode |
||
48 | * |
||
49 | * @return \Illuminate\Http\Response |
||
50 | */ |
||
51 | 7 | protected function makeHtmlResponse($statusCode) |
|
61 | |||
62 | /** |
||
63 | * Create a response to request the OTP. |
||
64 | * |
||
65 | * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse |
||
66 | */ |
||
67 | 7 | public function makeRequestOneTimePasswordResponse() |
|
83 | |||
84 | /** |
||
85 | * Get the OTP view. |
||
86 | * |
||
87 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
88 | */ |
||
89 | 7 | private function getView() |
|
93 | |||
94 | abstract protected function getErrorBagForStatusCode($statusCode); |
||
95 | |||
96 | abstract protected function inputHasOneTimePassword(); |
||
97 | |||
98 | abstract public function checkOTP(); |
||
99 | |||
100 | abstract protected function getUser(); |
||
101 | |||
102 | abstract public function getRequest(); |
||
103 | |||
104 | abstract protected function config($string, $children = []); |
||
105 | } |
||
106 |
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: