mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-23 09:12:34 +01:00
18 lines
325 B
PHP
18 lines
325 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Creational\FactoryMethod;
|
|
|
|
class FileLogger implements Logger
|
|
{
|
|
public function __construct(private string $filePath)
|
|
{
|
|
}
|
|
|
|
public function log(string $message)
|
|
{
|
|
file_put_contents($this->filePath, $message . PHP_EOL, FILE_APPEND);
|
|
}
|
|
}
|