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() |
|
44 | |||
45 | /** |
||
46 | * Make a web response. |
||
47 | * |
||
48 | * @param $statusCode |
||
49 | * |
||
50 | * @return \Illuminate\Http\Response |
||
51 | */ |
||
52 | 7 | protected function makeHtmlResponse($statusCode) |
|
62 | |||
63 | /** |
||
64 | * Create a response to request the OTP. |
||
65 | * |
||
66 | * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse |
||
67 | */ |
||
68 | 7 | public function makeRequestOneTimePasswordResponse() |
|
84 | |||
85 | /** |
||
86 | * Get the OTP view. |
||
87 | * |
||
88 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
89 | */ |
||
90 | 7 | private function getView() |
|
94 | |||
95 | abstract protected function getErrorBagForStatusCode($statusCode); |
||
96 | |||
97 | abstract protected function inputHasOneTimePassword(); |
||
98 | |||
99 | abstract public function checkOTP(); |
||
100 | |||
101 | abstract protected function getUser(); |
||
102 | |||
103 | abstract public function getRequest(); |
||
104 | |||
105 | abstract protected function config($string, $children = []); |
||
106 | } |
||
107 |
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: