mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-25 22:09:23 +02:00
* rewrite of the Abstract Factory pattern * update composer deps * fixed argument to json_encode which cannot be null
17 lines
310 B
PHP
17 lines
310 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Creational\AbstractFactory;
|
|
|
|
class WinWriterFactory implements WriterFactory
|
|
{
|
|
public function createCsvWriter(): CsvWriter
|
|
{
|
|
return new WinCsvWriter();
|
|
}
|
|
|
|
public function createJsonWriter(): JsonWriter
|
|
{
|
|
return new UnixJsonWriter();
|
|
}
|
|
}
|