mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-24 18:25:27 +02:00
add a simple example with a null logger
This commit is contained in:
20
NullObject/PrintLogger.php
Normal file
20
NullObject/PrintLogger.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* DesignPatternPHP
|
||||
*/
|
||||
|
||||
namespace DesignPatterns\NullObject;
|
||||
|
||||
/**
|
||||
* PrintLogger is a logger that prints the log entry to standard output
|
||||
*/
|
||||
class PrintLogger implements LoggerInterface
|
||||
{
|
||||
|
||||
public function log($str)
|
||||
{
|
||||
echo $str;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user