Applied fixes from StyleCI

This commit is contained in:
Dominik Liebler
2015-12-21 07:28:20 -05:00
committed by StyleCI Bot
parent 3663603b80
commit fe1f144ec3
167 changed files with 510 additions and 517 deletions

View File

@@ -3,7 +3,7 @@
namespace DesignPatterns\Behavioral\NullObject;
/**
* LoggerInterface is a contract for logging something
* LoggerInterface is a contract for logging something.
*
* Key feature: NullLogger MUST inherit from this interface like any other Loggers
*/

View File

@@ -3,7 +3,7 @@
namespace DesignPatterns\Behavioral\NullObject;
/**
* PrintLogger is a logger that prints the log entry to standard output
* PrintLogger is a logger that prints the log entry to standard output.
*/
class PrintLogger implements LoggerInterface
{

View File

@@ -3,7 +3,7 @@
namespace DesignPatterns\Behavioral\NullObject;
/**
* Service is dummy service that uses a logger
* Service is dummy service that uses a logger.
*/
class Service
{
@@ -13,7 +13,7 @@ class Service
protected $logger;
/**
* we inject the logger in ctor and it is mandatory
* we inject the logger in ctor and it is mandatory.
*
* @param LoggerInterface $log
*/
@@ -28,7 +28,7 @@ class Service
public function doSomething()
{
// no more check "if (!is_null($this->logger))..." with the NullObject pattern
$this->logger->log('We are in ' . __METHOD__);
$this->logger->log('We are in '.__METHOD__);
// something to do...
}
}

View File

@@ -3,15 +3,14 @@
namespace DesignPatterns\Behavioral\NullObject\Tests;
use DesignPatterns\Behavioral\NullObject\NullLogger;
use DesignPatterns\Behavioral\NullObject\Service;
use DesignPatterns\Behavioral\NullObject\PrintLogger;
use DesignPatterns\Behavioral\NullObject\Service;
/**
* LoggerTest tests for different loggers
* LoggerTest tests for different loggers.
*/
class LoggerTest extends \PHPUnit_Framework_TestCase
{
public function testNullObject()
{
// one can use a singleton for NullObjet : I don't think it's a good idea