This commit is contained in:
Dominik Liebler
2013-09-13 12:00:39 +02:00
parent 2d3fc40a39
commit 644d9cbd49
12 changed files with 86 additions and 78 deletions

View File

@@ -1,9 +1,5 @@
<?php
/*
* DesignPatternPHP
*/
namespace DesignPatterns\SimpleFactory;
/**
@@ -11,10 +7,13 @@ namespace DesignPatterns\SimpleFactory;
*/
class Bicycle implements VehicleInterface
{
/**
* @param mixed $destination
*
* @return mixed|void
*/
public function driveTo($destination)
{
}
}
}
}

View File

@@ -1,9 +1,5 @@
<?php
/*
* DesignPatternPHP
*/
namespace DesignPatterns\SimpleFactory;
/**
@@ -17,7 +13,9 @@ namespace DesignPatterns\SimpleFactory;
*/
class ConcreteFactory
{
/**
* @var array
*/
protected $typeList;
/**
@@ -36,6 +34,7 @@ class ConcreteFactory
* Creates a vehicle
*
* @param string $type a known type key
*
* @return VehicleInterface a new instance of VehicleInterface
* @throws \InvalidArgumentException
*/
@@ -48,5 +47,4 @@ class ConcreteFactory
return new $className();
}
}
}