| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | protected function getFileResponse(array $tags) |
||
| 26 | { |
||
| 27 | $responseTags = array_filter($tags, function ($tag) { |
||
| 28 | return $tag instanceof Tag && strtolower($tag->getName()) == 'responsefile'; |
||
| 29 | }); |
||
| 30 | if (empty($responseTags)) { |
||
| 31 | return; |
||
| 32 | } |
||
| 33 | $responseTag = array_first($responseTags); |
||
| 34 | |||
| 35 | $json = json_decode(file_get_contents(storage_path($responseTag->getContent()), true), true); |
||
| 36 | |||
| 37 | return response()->json($json); |
||
|
|
|||
| 38 | } |
||
| 39 | } |
||
| 40 |
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: