Files
DesignPatternsPHP/Creational/FactoryMethod/FileLoggerFactory.php
2019-08-19 18:11:49 +02:00

22 lines
399 B
PHP

<?php declare(strict_types=1);
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);
}
}