Андрей Собканюк d9b3cc2eb1 Fix typo in method annotation
2015-08-06 17:54:39 +03:00

31 lines
690 B
PHP

<?php
namespace DesignPatterns\Creational\Builder;
/**
* Director is part of the builder pattern. It knows the interface of the builder
* and builds a complex object with the help of the builder.
*
* You can also inject many builders instead of one to build more complex objects
*/
class Director
{
/**
* The director don't know about concrete part
*
* @param BuilderInterface $builder
*
* @return Parts\Vehicle
*/
public function build(BuilderInterface $builder)
{
$builder->createVehicle();
$builder->addDoors();
$builder->addEngine();
$builder->addWheel();
return $builder->getVehicle();
}
}