| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | namespace Salient\Contract\Core; |
| 4: | |
| 5: | /** |
| 6: | * @api |
| 7: | * |
| 8: | * @template TClass of object |
| 9: | */ |
| 10: | interface BuilderInterface extends Chainable, Immutable |
| 11: | { |
| 12: | /** |
| 13: | * Get a new builder |
| 14: | * |
| 15: | * @return static |
| 16: | */ |
| 17: | public static function create(); |
| 18: | |
| 19: | /** |
| 20: | * Get an instance from a possibly-terminated builder |
| 21: | * |
| 22: | * @param static|TClass $object |
| 23: | * @return TClass |
| 24: | */ |
| 25: | public static function resolve($object); |
| 26: | |
| 27: | /** |
| 28: | * Terminate the builder by creating an instance |
| 29: | * |
| 30: | * @return TClass |
| 31: | */ |
| 32: | public function build(); |
| 33: | } |
| 34: |