1 | <?php |
||
26 | class Factory |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * Configuration Settings. |
||
31 | * |
||
32 | * @since 1.0.0 |
||
33 | * |
||
34 | * @var ConfigInterface |
||
35 | */ |
||
36 | protected $config; |
||
37 | |||
38 | /** |
||
39 | * Type of element the factory wants to create. |
||
40 | * |
||
41 | * @since 1.0.0 |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $element; |
||
46 | |||
47 | /** |
||
48 | * Instantiate a Factory object. |
||
49 | * |
||
50 | * @since 1.0.0 |
||
51 | * |
||
52 | * @param ConfigInterface $config Configuration settings. |
||
53 | * @param string $element The type of element to instantiate a factory for. |
||
54 | * |
||
55 | * @throws FailedToInstantiateFactory When an unknown element type is requested. |
||
56 | */ |
||
57 | 16 | public function __construct(ConfigInterface $config, $element) |
|
71 | |||
72 | /** |
||
73 | * Create and return a new instance of an element. |
||
74 | * |
||
75 | * @since 1.0.0 |
||
76 | * |
||
77 | * @param string $type Type of element to create. |
||
78 | * @param mixed $arguments Optional. Arguments to pass to the object. |
||
79 | * |
||
80 | * @return object New instance of the requested class. |
||
81 | * @throws FailedToInstantiateClass If an unknown element type is requested. |
||
82 | */ |
||
83 | 16 | public function create($type, $arguments = null) |
|
100 | } |
||
101 |