Skip to content

Commit

Permalink
[Bref] LocalRunner: Print array result (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm authored May 28, 2022
1 parent 6c17a92 commit fbf93f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/bref/src/LocalRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ public function __construct(Handler $handler, $data)

public function run(): int
{
echo $this->handler->handle($this->data, new Context('', 0, '', ''));
$result = $this->handler->handle($this->data, new Context('', 0, '', ''));

if (is_array($result)) {
echo json_encode($result, JSON_PRETTY_PRINT);
} elseif (is_scalar($result)) {
echo $result;
}

return 0;
}
Expand Down

0 comments on commit fbf93f5

Please sign in to comment.