mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 20:20:15 +02:00
PHP8
This commit is contained in:
@@ -4,11 +4,8 @@ namespace DesignPatterns\Creational\FactoryMethod;
|
||||
|
||||
class FileLogger implements Logger
|
||||
{
|
||||
private string $filePath;
|
||||
|
||||
public function __construct(string $filePath)
|
||||
public function __construct(private string $filePath)
|
||||
{
|
||||
$this->filePath = $filePath;
|
||||
}
|
||||
|
||||
public function log(string $message)
|
||||
|
@@ -4,11 +4,8 @@ namespace DesignPatterns\Creational\FactoryMethod;
|
||||
|
||||
class FileLoggerFactory implements LoggerFactory
|
||||
{
|
||||
private string $filePath;
|
||||
|
||||
public function __construct(string $filePath)
|
||||
public function __construct(private string $filePath)
|
||||
{
|
||||
$this->filePath = $filePath;
|
||||
}
|
||||
|
||||
public function createLogger(): Logger
|
||||
|
Reference in New Issue
Block a user