Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | protected function success() |
||
10 | { |
||
11 | $this->response = $this->response->withStatus(200); |
||
12 | $output = $this->payload->getOutput(); |
||
13 | |||
14 | if (is_array($output)) { |
||
15 | $this->jsonBody($this->resource->collection($output)); |
||
|
|||
16 | } else { |
||
17 | $this->jsonBody($this->resource->item($output)); |
||
18 | } |
||
19 | } |
||
20 | } |
||
21 |
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: