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