mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-01 20:50:15 +02:00
WinJsonWriter :: missing formatted option added
This commit is contained in:
@@ -6,8 +6,12 @@ class WinJsonWriter implements JsonWriter
|
||||
{
|
||||
public function write(array $data, bool $formatted): string
|
||||
{
|
||||
$options = 0;
|
||||
|
||||
if ($formatted) {
|
||||
$options = JSON_PRETTY_PRINT;
|
||||
}
|
||||
|
||||
return json_encode($data, JSON_PRETTY_PRINT);
|
||||
return json_encode($data, $options);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user