1 | <?php |
||
22 | abstract class Request extends FormRequest |
||
23 | { |
||
24 | /** |
||
25 | * An instance of Form. |
||
26 | * |
||
27 | * @var FormInterface |
||
28 | */ |
||
29 | protected $form; |
||
30 | |||
31 | /** |
||
32 | * Class name of the form. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $formClassName; |
||
37 | |||
38 | /** |
||
39 | * Set the instance of the form. |
||
40 | * |
||
41 | * @param FormInterface $form |
||
42 | * |
||
43 | * @return $this |
||
44 | */ |
||
45 | 27 | public function setForm(FormInterface $form) |
|
51 | |||
52 | /** |
||
53 | * Returns an instance of the form. |
||
54 | * |
||
55 | * @return FormInterface |
||
56 | */ |
||
57 | 27 | public function getForm() |
|
61 | |||
62 | /** |
||
63 | * Returns the class name of the form. |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | 27 | public function getFormClassName() |
|
71 | |||
72 | /** |
||
73 | * @return array |
||
74 | */ |
||
75 | 27 | public function rules() |
|
79 | |||
80 | /** |
||
81 | * @return bool |
||
82 | */ |
||
83 | 23 | public function authorize() |
|
88 | |||
89 | /** |
||
90 | * @param array $errors |
||
91 | * |
||
92 | * @return mixed |
||
93 | */ |
||
94 | 3 | public function response(array $errors) |
|
98 | |||
99 | /** |
||
100 | * @return string |
||
101 | */ |
||
102 | 1 | protected function getRedirectUrl() |
|
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: