Skip to content

Commit 54f8092

Browse files
committed
WinJsonWriter :: missing formatted option added
1 parent 912d60b commit 54f8092

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Creational/AbstractFactory/WinJsonWriter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ class WinJsonWriter implements JsonWriter
66
{
77
public function write(array $data, bool $formatted): string
88
{
9+
$options = 0;
910

11+
if ($formatted) {
12+
$options = JSON_PRETTY_PRINT;
13+
}
1014

11-
return json_encode($data, JSON_PRETTY_PRINT);
15+
return json_encode($data, $options);
1216
}
1317
}

0 commit comments

Comments
 (0)