mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-26 01:31:20 +02:00
remove Interface-Suffix
This commit is contained in:
@@ -6,7 +6,7 @@ namespace DesignPatterns\Behavioral\NullObject;
|
|||||||
/**
|
/**
|
||||||
* Key feature: NullLogger must inherit from this interface like any other loggers
|
* Key feature: NullLogger must inherit from this interface like any other loggers
|
||||||
*/
|
*/
|
||||||
interface LoggerInterface
|
interface Logger
|
||||||
{
|
{
|
||||||
public function log(string $str);
|
public function log(string $str);
|
||||||
}
|
}
|
@@ -3,7 +3,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace DesignPatterns\Behavioral\NullObject;
|
namespace DesignPatterns\Behavioral\NullObject;
|
||||||
|
|
||||||
class NullLogger implements LoggerInterface
|
class NullLogger implements Logger
|
||||||
{
|
{
|
||||||
public function log(string $str)
|
public function log(string $str)
|
||||||
{
|
{
|
||||||
|
@@ -3,7 +3,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace DesignPatterns\Behavioral\NullObject;
|
namespace DesignPatterns\Behavioral\NullObject;
|
||||||
|
|
||||||
class PrintLogger implements LoggerInterface
|
class PrintLogger implements Logger
|
||||||
{
|
{
|
||||||
public function log(string $str)
|
public function log(string $str)
|
||||||
{
|
{
|
||||||
|
@@ -43,9 +43,9 @@ Service.php
|
|||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
LoggerInterface.php
|
Logger.php
|
||||||
|
|
||||||
.. literalinclude:: LoggerInterface.php
|
.. literalinclude:: Logger.php
|
||||||
:language: php
|
:language: php
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
@@ -71,4 +71,4 @@ Tests/LoggerTest.php
|
|||||||
:linenos:
|
:linenos:
|
||||||
|
|
||||||
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Behavioral/NullObject
|
.. _`GitHub`: https://github.com/domnikl/DesignPatternsPHP/tree/master/Behavioral/NullObject
|
||||||
.. __: http://en.wikipedia.org/wiki/Null_Object_pattern
|
.. __: http://en.wikipedia.org/wiki/Null_Object_pattern
|
||||||
|
@@ -6,14 +6,14 @@ namespace DesignPatterns\Behavioral\NullObject;
|
|||||||
class Service
|
class Service
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var LoggerInterface
|
* @var Logger
|
||||||
*/
|
*/
|
||||||
private $logger;
|
private $logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param LoggerInterface $logger
|
* @param Logger $logger
|
||||||
*/
|
*/
|
||||||
public function __construct(LoggerInterface $logger)
|
public function __construct(Logger $logger)
|
||||||
{
|
{
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 28 KiB |
Reference in New Issue
Block a user