mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-27 18:20:22 +02:00
19 lines
371 B
PHP
19 lines
371 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Creational\FactoryMethod;
|
|
|
|
class FileLoggerFactory implements LoggerFactory
|
|
{
|
|
private string $filePath;
|
|
|
|
public function __construct(string $filePath)
|
|
{
|
|
$this->filePath = $filePath;
|
|
}
|
|
|
|
public function createLogger(): Logger
|
|
{
|
|
return new FileLogger($this->filePath);
|
|
}
|
|
}
|