| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | namespace Salient\Contract\Container; |
| 4: | |
| 5: | use Closure; |
| 6: | |
| 7: | /** |
| 8: | * @api |
| 9: | */ |
| 10: | interface HasContextualBindings |
| 11: | { |
| 12: | /** |
| 13: | * Get bindings to add to the container in the context of the class |
| 14: | * |
| 15: | * The contextual bindings of the class apply: |
| 16: | * |
| 17: | * - when resolving its dependencies |
| 18: | * - when using {@see ContainerInterface::inContextOf()} to work with the |
| 19: | * container in the context of the class |
| 20: | * |
| 21: | * @return array<class-string|non-empty-string|int,(Closure(ContainerInterface): object)|class-string|object> |
| 22: | */ |
| 23: | public static function getContextualBindings(ContainerInterface $container): array; |
| 24: | } |
| 25: |