1 | <?php |
||
19 | abstract class AbstractSyncedRoutine extends AbstractRoutine implements ParamSynced |
||
20 | { |
||
21 | /** |
||
22 | * @var Reflector |
||
23 | */ |
||
24 | protected $reflection; |
||
25 | |||
26 | /** |
||
27 | * Return parameters that can be used with the routine. |
||
28 | * |
||
29 | * @return array |
||
30 | */ |
||
31 | 20 | public function getParameters() |
|
40 | |||
41 | /** |
||
42 | * Executes the routine and return its result. |
||
43 | * |
||
44 | * @param Respect\Rest\Request $request |
||
45 | * @param array $params |
||
46 | * @return mixed |
||
47 | */ |
||
48 | 16 | public function execute(Request $request, $params) |
|
60 | |||
61 | /** |
||
62 | * Returns a concrete ReflectionFunctionAbstract for this routine callback. |
||
63 | * |
||
64 | * @return Reflector |
||
65 | */ |
||
66 | 20 | protected function getReflection() |
|
79 | } |
||
80 |
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: