Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function transform($data) |
||
19 | { |
||
20 | $user = auth(config('sarala.guard'))->user(); |
||
|
|||
21 | |||
22 | $links = $this->links($data, $user)->all(); |
||
23 | $meta = $this->meta($data, $user); |
||
24 | $data = $this->filterFields($this->data($data)); |
||
25 | |||
26 | if (! empty($links)) { |
||
27 | $data['links'] = $links; |
||
28 | } |
||
29 | |||
30 | if (! empty($meta)) { |
||
31 | $data['meta'] = $meta; |
||
32 | } |
||
33 | |||
34 | return $data; |
||
35 | } |
||
36 | |||
62 |
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: