PHP7 AbstractFactory

This commit is contained in:
Dominik Liebler
2016-09-22 15:19:18 +02:00
parent 370ce4dd93
commit f03c173eb9
17 changed files with 650 additions and 671 deletions

View File

@@ -4,28 +4,8 @@ namespace DesignPatterns\Creational\AbstractFactory;
class HtmlFactory extends AbstractFactory
{
/**
* Creates a picture component.
*
* @param string $path
* @param string $name
*
* @return Html\Picture|Picture
*/
public function createPicture($path, $name = '')
public function createText(string $content): Text
{
return new Html\Picture($path, $name);
}
/**
* Creates a text component.
*
* @param string $content
*
* @return Html\Text|Text
*/
public function createText($content)
{
return new Html\Text($content);
return new HtmlText($content);
}
}