1 | <?php |
||
17 | trait ApprovePresenterTrait |
||
18 | { |
||
19 | use SecuredLinksPresenterTrait; |
||
20 | |||
21 | /** |
||
22 | * @var IApproveControlFactory |
||
23 | * @inject |
||
24 | */ |
||
25 | public $approveControlFactory; |
||
26 | |||
27 | /** |
||
28 | * @var IAuthorizationRequestSerializer |
||
29 | * @inject |
||
30 | */ |
||
31 | public $authorizationRequestSerializer; |
||
32 | |||
33 | /** |
||
34 | * @var RedirectConfig |
||
35 | * @inject |
||
36 | */ |
||
37 | public $redirectConfig; |
||
38 | |||
39 | /** |
||
40 | * @return ApproveControl |
||
41 | */ |
||
42 | protected function createComponentApprove(): ApproveControl |
||
77 | |||
78 | /** |
||
79 | * @param string|null $namespace |
||
80 | * @return Session|SessionSection |
||
81 | */ |
||
82 | abstract public function getSession($namespace = null); |
||
83 | |||
84 | /** |
||
85 | * @return User |
||
86 | */ |
||
87 | abstract public function getUser(); |
||
88 | |||
89 | /** |
||
90 | * @param int $code [optional] |
||
91 | * @param string|null $destination |
||
92 | * @param array|mixed $args |
||
93 | * @throws AbortException |
||
94 | */ |
||
95 | abstract public function redirect($code, $destination = null, $args = []); |
||
96 | |||
97 | /** |
||
98 | * @param IResponse $response |
||
99 | * @throws AbortException |
||
100 | */ |
||
101 | abstract public function sendResponse(IResponse $response); |
||
102 | } |
||
103 |
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: