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 TBuilder of BuilderInterface
11: */
12: interface Buildable
13: {
14: /**
15: * Get a builder that creates instances of the class
16: *
17: * @return TBuilder
18: */
19: public static function build(?ContainerInterface $container = null): BuilderInterface;
20:
21: /**
22: * Get an instance of the class from an optionally terminated builder
23: *
24: * @param TBuilder|static $object
25: * @return static
26: */
27: public static function resolve($object);
28: }
29: