1 | <?php |
||
8 | trait ViewResolverTrait |
||
9 | { |
||
10 | /** |
||
11 | * @param $file |
||
12 | * @return string |
||
13 | */ |
||
14 | protected function getViewPathFor($file) |
||
22 | |||
23 | /** |
||
24 | * Build variables depends on given $attributes. |
||
25 | * |
||
26 | * @param Model|null $model |
||
27 | * @return array |
||
28 | */ |
||
29 | protected function buildVariables(?Model $model = null) |
||
64 | |||
65 | /** |
||
66 | * Join given prefix and $resource with the delimiter. |
||
67 | * |
||
68 | * @param string $prefix |
||
69 | * @param string $delimiter |
||
70 | * @param string $resource |
||
71 | * @return string |
||
72 | */ |
||
73 | protected function getRightPrefixFor($prefix = '', $delimiter = '.', $resource = '') |
||
79 | |||
80 | /** |
||
81 | * @param $view |
||
82 | * @param Model|null $model |
||
83 | * @return array |
||
84 | */ |
||
85 | protected function getResourceVariables($view, ?Model $model = null): array |
||
91 | } |
||
92 |
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: