Skip to content

Commit 973fd28

Browse files
committed
fix: echoln and json cli pretty error
1 parent 321d252 commit 973fd28

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Component/Formatter/JSONPretty.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function renderData(array $data): string
9393
continue;
9494
}
9595

96-
[$key, $val] = explode(': ', $line);
96+
[$key, $val] = explode(': ', $line, 2);
9797

9898
// format key name.
9999
if ($keyTag = $this->theme['keyName']) {

src/Concern/FormatOutputAwareTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ public function write($messages, $nl = true, $quit = false, array $opts = []): i
5353
*/
5454
public function echo(...$args): void
5555
{
56-
echo count($args) > 1 ? implode(' ', $args) : $args;
56+
echo count($args) > 1 ? implode(' ', $args) : $args[0];
5757
}
5858

5959
/**
6060
* @param ...$args
6161
*/
6262
public function echoln(...$args): void
6363
{
64-
echo (count($args) > 1 ? implode(' ', $args) : $args), PHP_EOL;
64+
echo (count($args) > 1 ? implode(' ', $args) : $args[0]), PHP_EOL;
6565
}
6666

6767
/**

0 commit comments

Comments
 (0)