mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-11 01:14:01 +02:00
Abstract factory (#366)
* rewrite of the Abstract Factory pattern * update composer deps * fixed argument to json_encode which cannot be null
This commit is contained in:
13
Creational/AbstractFactory/WinJsonWriter.php
Normal file
13
Creational/AbstractFactory/WinJsonWriter.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Creational\AbstractFactory;
|
||||
|
||||
class WinJsonWriter implements JsonWriter
|
||||
{
|
||||
public function write(array $data, bool $formatted): string
|
||||
{
|
||||
|
||||
|
||||
return json_encode($data, JSON_PRETTY_PRINT);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user