Skip to content

Commit

Permalink
Merge pull request #56 from oele-code/master
Browse files Browse the repository at this point in the history
Prevent Illegal string offset 'warning_queries'
  • Loading branch information
mpociot authored Mar 11, 2020
2 parents 5e94a18 + 4b65a19 commit dc41392
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Outputs/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public function output(Collection $detectedQueries, Response $response)
{
if ($response instanceof JsonResponse) {
$data = $response->getData(true);
if (! is_array($data)){
$data = [ $data ];
}

$data['warning_queries'] = $detectedQueries;
$response->setData($data);
}
Expand Down

0 comments on commit dc41392

Please sign in to comment.