mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-07 15:36:34 +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\Creational\SimpleFactory;
|
||||
|
||||
/**
|
||||
* Bicycle is a bicycle
|
||||
* Bicycle is a bicycle.
|
||||
*/
|
||||
class Bicycle implements VehicleInterface
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace DesignPatterns\Creational\SimpleFactory;
|
||||
|
||||
/**
|
||||
* class ConcreteFactory
|
||||
* class ConcreteFactory.
|
||||
*/
|
||||
class ConcreteFactory
|
||||
{
|
||||
@@ -19,18 +19,19 @@ class ConcreteFactory
|
||||
public function __construct()
|
||||
{
|
||||
$this->typeList = array(
|
||||
'bicycle' => __NAMESPACE__ . '\Bicycle',
|
||||
'other' => __NAMESPACE__ . '\Scooter'
|
||||
'bicycle' => __NAMESPACE__.'\Bicycle',
|
||||
'other' => __NAMESPACE__.'\Scooter',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a vehicle
|
||||
* Creates a vehicle.
|
||||
*
|
||||
* @param string $type a known type key
|
||||
*
|
||||
* @return VehicleInterface a new instance of VehicleInterface
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return VehicleInterface a new instance of VehicleInterface
|
||||
*/
|
||||
public function createVehicle($type)
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace DesignPatterns\Creational\SimpleFactory;
|
||||
|
||||
/**
|
||||
* Scooter is a Scooter
|
||||
* Scooter is a Scooter.
|
||||
*/
|
||||
class Scooter implements VehicleInterface
|
||||
{
|
||||
|
@@ -5,11 +5,10 @@ namespace DesignPatterns\Creational\SimpleFactory\Tests;
|
||||
use DesignPatterns\Creational\SimpleFactory\ConcreteFactory;
|
||||
|
||||
/**
|
||||
* SimpleFactoryTest tests the Simple Factory pattern
|
||||
* SimpleFactoryTest tests the Simple Factory pattern.
|
||||
*/
|
||||
class SimpleFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
protected $factory;
|
||||
|
||||
protected function setUp()
|
||||
@@ -21,7 +20,7 @@ class SimpleFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
return array(
|
||||
array('bicycle'),
|
||||
array('other')
|
||||
array('other'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace DesignPatterns\Creational\SimpleFactory;
|
||||
|
||||
/**
|
||||
* VehicleInterface is a contract for a vehicle
|
||||
* VehicleInterface is a contract for a vehicle.
|
||||
*/
|
||||
interface VehicleInterface
|
||||
{
|
||||
|
Reference in New Issue
Block a user