| 1 | <?php |
||
| 14 | class ServiceProvider |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var callable |
||
| 18 | */ |
||
| 19 | static private $provider; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Define the service provider. |
||
| 23 | * |
||
| 24 | * @param callable $provider |
||
| 25 | * |
||
| 26 | * @return callable The previous provider, or `null` if none was defined. |
||
| 27 | */ |
||
| 28 | static public function define(callable $provider) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Return the current provider. |
||
| 39 | * |
||
| 40 | * @return callable|null |
||
| 41 | */ |
||
| 42 | static public function defined() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Undefine the provider. |
||
| 49 | */ |
||
| 50 | static public function undefine() |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Return a service. |
||
| 57 | * |
||
| 58 | * @param string $id Service identifier. |
||
| 59 | * |
||
| 60 | * @return mixed |
||
| 61 | */ |
||
| 62 | static public function provide($id) |
||
| 73 | } |
||
| 74 |