| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | namespace Salient\Contract\Container; |
| 4: | |
| 5: | /** |
| 6: | * @api |
| 7: | */ |
| 8: | interface ServiceAwareInterface |
| 9: | { |
| 10: | /** |
| 11: | * Set the service resolved to the instance by the container |
| 12: | * |
| 13: | * Called every time the instance is used to resolve a service from the |
| 14: | * container. |
| 15: | * |
| 16: | * {@see ContainerAwareInterface::setContainer()} is called first when the |
| 17: | * container creates the instance. |
| 18: | * |
| 19: | * @param class-string $service |
| 20: | */ |
| 21: | public function setService(string $service): void; |
| 22: | |
| 23: | /** |
| 24: | * Get the service resolved to the instance by the container |
| 25: | * |
| 26: | * @return class-string |
| 27: | */ |
| 28: | public function getService(): string; |
| 29: | } |
| 30: |