Skip to content

Commit fbf93f5

Browse files
authored
[Bref] LocalRunner: Print array result (#119)
1 parent 6c17a92 commit fbf93f5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/bref/src/LocalRunner.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ public function __construct(Handler $handler, $data)
2424

2525
public function run(): int
2626
{
27-
echo $this->handler->handle($this->data, new Context('', 0, '', ''));
27+
$result = $this->handler->handle($this->data, new Context('', 0, '', ''));
28+
29+
if (is_array($result)) {
30+
echo json_encode($result, JSON_PRETTY_PRINT);
31+
} elseif (is_scalar($result)) {
32+
echo $result;
33+
}
2834

2935
return 0;
3036
}

0 commit comments

Comments
 (0)