mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 20:20:15 +02:00
Applied fixes from StyleCI
This commit is contained in:
committed by
StyleCI Bot
parent
3663603b80
commit
fe1f144ec3
@@ -3,7 +3,7 @@
|
||||
namespace DesignPatterns\Behavioral\Strategy;
|
||||
|
||||
/**
|
||||
* Class ComparatorInterface
|
||||
* Class ComparatorInterface.
|
||||
*/
|
||||
interface ComparatorInterface
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace DesignPatterns\Behavioral\Strategy;
|
||||
|
||||
/**
|
||||
* Class DateComparator
|
||||
* Class DateComparator.
|
||||
*/
|
||||
class DateComparator implements ComparatorInterface
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace DesignPatterns\Behavioral\Strategy;
|
||||
|
||||
/**
|
||||
* Class IdComparator
|
||||
* Class IdComparator.
|
||||
*/
|
||||
class IdComparator implements ComparatorInterface
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace DesignPatterns\Behavioral\Strategy;
|
||||
|
||||
/**
|
||||
* Class ObjectCollection
|
||||
* Class ObjectCollection.
|
||||
*/
|
||||
class ObjectCollection
|
||||
{
|
||||
@@ -31,7 +31,7 @@ class ObjectCollection
|
||||
public function sort()
|
||||
{
|
||||
if (!$this->comparator) {
|
||||
throw new \LogicException("Comparator is not set");
|
||||
throw new \LogicException('Comparator is not set');
|
||||
}
|
||||
|
||||
$callback = array($this->comparator, 'compare');
|
||||
|
@@ -8,21 +8,20 @@ use DesignPatterns\Behavioral\Strategy\ObjectCollection;
|
||||
use DesignPatterns\Behavioral\Strategy\Strategy;
|
||||
|
||||
/**
|
||||
* Tests for Strategy pattern
|
||||
* Tests for Strategy pattern.
|
||||
*/
|
||||
class StrategyTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function getIdCollection()
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
array(array('id' => 2), array('id' => 1), array('id' => 3)),
|
||||
array('id' => 1)
|
||||
array('id' => 1),
|
||||
),
|
||||
array(
|
||||
array(array('id' => 3), array('id' => 2), array('id' => 1)),
|
||||
array('id' => 1)
|
||||
array('id' => 1),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -32,11 +31,11 @@ class StrategyTest extends \PHPUnit_Framework_TestCase
|
||||
return array(
|
||||
array(
|
||||
array(array('date' => '2014-03-03'), array('date' => '2015-03-02'), array('date' => '2013-03-01')),
|
||||
array('date' => '2013-03-01')
|
||||
array('date' => '2013-03-01'),
|
||||
),
|
||||
array(
|
||||
array(array('date' => '2014-02-03'), array('date' => '2013-02-01'), array('date' => '2015-02-02')),
|
||||
array('date' => '2013-02-01')
|
||||
array('date' => '2013-02-01'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user