refactored Factory Method pattern

This commit is contained in:
Dominik Liebler
2018-06-15 18:18:26 +02:00
parent f6d845e59e
commit bca6af02c0
27 changed files with 201 additions and 1198 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace DesignPatterns\Creational\FactoryMethod;
class FileLoggerFactory implements LoggerFactory
{
/**
* @var string
*/
private $filePath;
public function __construct(string $filePath)
{
$this->filePath = $filePath;
}
public function createLogger(): Logger
{
return new FileLogger($this->filePath);
}
}