Skip to content

Commit dc41392

Browse files
authored
Merge pull request #56 from oele-code/master
Prevent Illegal string offset 'warning_queries'
2 parents 5e94a18 + 4b65a19 commit dc41392

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Outputs/Json.php

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ public function output(Collection $detectedQueries, Response $response)
1616
{
1717
if ($response instanceof JsonResponse) {
1818
$data = $response->getData(true);
19+
if (! is_array($data)){
20+
$data = [ $data ];
21+
}
22+
1923
$data['warning_queries'] = $detectedQueries;
2024
$response->setData($data);
2125
}

0 commit comments

Comments
 (0)