diff --git a/Builder/Parts/Vehicle.php b/Builder/Parts/Vehicle.php index 7f627b7..15c39c0 100644 --- a/Builder/Parts/Vehicle.php +++ b/Builder/Parts/Vehicle.php @@ -7,7 +7,7 @@ namespace DesignPatterns\Builder\Parts; /** - * Vehicle is a contract for a vehicle + * VehicleInterface is a contract for a vehicle */ abstract class Vehicle { diff --git a/SimpleFactory/Bicycle.php b/SimpleFactory/Bicycle.php index 39c2d32..50f1415 100644 --- a/SimpleFactory/Bicycle.php +++ b/SimpleFactory/Bicycle.php @@ -9,7 +9,7 @@ namespace DesignPatterns\SimpleFactory; /** * Bicycle is a bicycle */ -class Bicycle implements Vehicle +class Bicycle implements VehicleInterface { public function driveTo($destination) diff --git a/SimpleFactory/ConcreteFactory.php b/SimpleFactory/ConcreteFactory.php index 01ba1ad..fa9f4ad 100644 --- a/SimpleFactory/ConcreteFactory.php +++ b/SimpleFactory/ConcreteFactory.php @@ -36,7 +36,7 @@ class ConcreteFactory * Creates a vehicle * * @param string $type a known type key - * @return Vehicle a new instance of Vehicle + * @return VehicleInterface a new instance of VehicleInterface * @throws \InvalidArgumentException */ public function createVehicle($type) diff --git a/SimpleFactory/Scooter.php b/SimpleFactory/Scooter.php index 925d7d2..2e386b7 100644 --- a/SimpleFactory/Scooter.php +++ b/SimpleFactory/Scooter.php @@ -1,20 +1,17 @@ factory->createVehicle($type); - $this->assertInstanceOf('DesignPatterns\SimpleFactory\Vehicle', $obj); + $this->assertInstanceOf('DesignPatterns\SimpleFactory\VehicleInterface', $obj); } /** diff --git a/Tests/StaticFactory/StaticFactoryTest.php b/Tests/StaticFactory/StaticFactoryTest.php index e906705..65087f5 100644 --- a/Tests/StaticFactory/StaticFactoryTest.php +++ b/Tests/StaticFactory/StaticFactoryTest.php @@ -25,7 +25,7 @@ class StaticFactoryTest extends \PHPUnit_Framework_TestCase public function testCreation($type) { $obj = StaticFactory::factory($type); - $this->assertInstanceOf('DesignPatterns\StaticFactory\Formatter', $obj); + $this->assertInstanceOf('DesignPatterns\StaticFactory\FormatterInterface', $obj); } }