| Total Complexity | 12 |
| Total Lines | 69 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | /** |
||
| 12 | * Register a service to the container. |
||
| 13 | * |
||
| 14 | * @param string $service The name of the service to register |
||
| 15 | * @param Closure $factory The function that produces the service |
||
| 16 | * @param bool $cache Whether or nor to cache the service |
||
| 17 | * |
||
| 18 | * @return void |
||
| 19 | */ |
||
| 20 | public function set(string $service, Closure $factory, bool $cache = true): void; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Retrieve a service from the container. |
||
| 24 | * |
||
| 25 | * @param string $service The name of the service to retrieve |
||
| 26 | * |
||
| 27 | * @return mixed The service object |
||
| 28 | * |
||
| 29 | * @throws InvalidServiceDefinition |
||
| 30 | * @throws NotFound |
||
| 31 | */ |
||
| 32 | public function get($service); |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Check whether a service is registered. |
||
| 36 | * |
||
| 37 | * @param string $service The name of the service to check for |
||
| 38 | * |
||
| 39 | * @return boolean Whether or not the service exists |
||
| 40 | */ |
||
| 41 | public function has($service): bool; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Remove a service from the container. |
||
| 45 | * |
||
| 46 | * @param string $service The name of the service to remove |
||
| 47 | * |
||
| 48 | * @return void |
||
| 49 | */ |
||
| 50 | public function forget(string $service): void; |
||
| 51 | } |
||
| 52 |