| 1 | <?php |
||
| 9 | abstract class ServiceProvider |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var \Spires\Contracts\Core\Core |
||
| 13 | */ |
||
| 14 | protected $core; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param \Spires\Contracts\Core\Core $core |
||
| 18 | * @return void |
||
|
|
|||
| 19 | */ |
||
| 20 | public function __construct(CoreContract $core) |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Define config keys with their default values. |
||
| 27 | * |
||
| 28 | * @return array |
||
| 29 | */ |
||
| 30 | public function config() |
||
| 34 | |||
| 35 | /** |
||
| 36 | * (Optional) Register the service provider. |
||
| 37 | * |
||
| 38 | * @return void |
||
| 39 | */ |
||
| 40 | // public function register() |
||
| 41 | // { |
||
| 42 | // // |
||
| 43 | // } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * (Optional) Boot the service provider. |
||
| 47 | * Parameters are resolved through the container. |
||
| 48 | * |
||
| 49 | * @return void |
||
| 50 | */ |
||
| 51 | // public function boot() |
||
| 52 | // { |
||
| 53 | // // |
||
| 54 | // } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Plugins provided. |
||
| 58 | * |
||
| 59 | * @return string[] |
||
| 60 | */ |
||
| 61 | abstract public function plugins(); |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Dynamically handle missing method calls. |
||
| 65 | * |
||
| 66 | * @param string $method |
||
| 67 | * @param array $parameters |
||
| 68 | * @return mixed |
||
| 69 | * |
||
| 70 | * @throws \BadMethodCallException |
||
| 71 | */ |
||
| 72 | public function __call($method, $parameters) |
||
| 79 | } |
||
| 80 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.