1: <?php
2:
3: namespace Charcoal\Factory;
4:
5: /**
6: * Factories instanciate (create) objects.
7: */
8: interface FactoryInterface
9: {
10: /**
11: * Create a new instance of a class, by type.
12: *
13: * @param string $type The type (class ident).
14: * @param array $args Constructor arguments.
15: * @param callable $cb Object callback.
16: * @return mixed The instance / object
17: */
18: public function create($type, array $args = null, callable $cb = null);
19:
20: /**
21: * A base class name (or interface)
22: *
23: * @return string
24: */
25: public function baseClass();
26:
27: /**
28: * @return string
29: */
30: public function defaultClass();
31:
32: /**
33: * @return array
34: */
35: public function arguments();
36:
37: /**
38: * @return callable|null
39: */
40: public function callback();
41: }
42: