1: <?php declare(strict_types=1);
2:
3: namespace Salient\Contract\Core;
4:
5: use Salient\Contract\Container\ContainerInterface;
6:
7: /**
8: * @api
9: *
10: * @template TClass of object
11: */
12: interface BuilderInterface extends Chainable, Immutable
13: {
14: /**
15: * Get a new builder
16: *
17: * @return static
18: */
19: public static function create(?ContainerInterface $container = null);
20:
21: /**
22: * Get an instance from an optionally terminated builder
23: *
24: * @param static|TClass $object
25: * @return TClass
26: */
27: public static function resolve($object);
28:
29: /**
30: * Get a value applied to the builder
31: *
32: * @return mixed
33: */
34: public function getB(string $name);
35:
36: /**
37: * Check if a value has been applied to the builder
38: */
39: public function issetB(string $name): bool;
40:
41: /**
42: * Remove a value applied to the builder
43: *
44: * @return static
45: */
46: public function unsetB(string $name);
47:
48: /**
49: * Resolve the builder to an instance
50: *
51: * @return TClass
52: */
53: public function build();
54: }
55: