mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-26 11:13:50 +02:00
22 lines
374 B
PHP
22 lines
374 B
PHP
<?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);
|
|
}
|
|
}
|