-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHTMLFactoryInterface.php
More file actions
47 lines (43 loc) · 1.24 KB
/
Copy pathHTMLFactoryInterface.php
File metadata and controls
47 lines (43 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace DesignPatterns\Creational\AbstractFactory;
/**
* This is an interface of abstract factory that creates HTML elements.
* All concrete factories that implement this interface are able to create these objects:
* - @see PageInterface in createPage method
* - @see TextInputInterface in createTextInput method
* - @see ButtonInterface in createButton method
*
* Clients depend only on this interface and not on concrete factories. That makes factories interchangeable:
* - @see \DesignPatterns\Creational\AbstractFactory\Bootstrap\BootstrapHTMLFactory
* - @see \DesignPatterns\Creational\AbstractFactory\Plain\PlainHTMLFactory
*
* It corresponds to `AbstractFactory` in the Abstract Factory pattern.
*
* @author Vlad Riabchenko <contact@vria.eu>
*/
interface HTMLFactoryInterface
{
/**
* Create a page
*
* @return PageInterface
*/
public function createPage();
/**
* Create a text input
*
* @param string $name
* @param string $label
*
* @return TextInputInterface
*/
public function createTextInput($name, $label);
/**
* Create a button
*
* @param string $label
*
* @return ButtonInterface
*/
public function createButton($label);
}