mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-23 09:12:34 +01:00
* rewrite of the Abstract Factory pattern * update composer deps * fixed argument to json_encode which cannot be null
14 lines
239 B
PHP
14 lines
239 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Creational\AbstractFactory;
|
|
|
|
class WinJsonWriter implements JsonWriter
|
|
{
|
|
public function write(array $data, bool $formatted): string
|
|
{
|
|
|
|
|
|
return json_encode($data, JSON_PRETTY_PRINT);
|
|
}
|
|
}
|