mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-06 15:06:31 +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:
16
Creational/AbstractFactory/UnixWriterFactory.php
Normal file
16
Creational/AbstractFactory/UnixWriterFactory.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Creational\AbstractFactory;
|
||||
|
||||
class UnixWriterFactory implements WriterFactory
|
||||
{
|
||||
public function createCsvWriter(): CsvWriter
|
||||
{
|
||||
return new UnixCsvWriter();
|
||||
}
|
||||
|
||||
public function createJsonWriter(): JsonWriter
|
||||
{
|
||||
return new UnixJsonWriter();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user