1 | <?php declare(strict_types = 1); |
||
16 | abstract class AbstractServiceProvider implements ServiceProvider |
||
17 | { |
||
18 | /** |
||
19 | * Service provider name. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected static $name; |
||
24 | |||
25 | /** |
||
26 | * Application config. |
||
27 | * |
||
28 | * @var MutableConfig |
||
29 | */ |
||
30 | private $config; |
||
31 | |||
32 | /** |
||
33 | * Container instance. |
||
34 | * |
||
35 | * @var Container |
||
36 | */ |
||
37 | private $container; |
||
38 | |||
39 | /** |
||
40 | * AbstractServiceProvider constructor. |
||
41 | * |
||
42 | * @param MutableConfig $mutableConfig |
||
43 | * @param Container $container |
||
44 | */ |
||
45 | public function __construct(MutableConfig $mutableConfig, Container $container) |
||
50 | |||
51 | |||
52 | /** |
||
53 | * @inheritdoc |
||
54 | */ |
||
55 | public static function dependencies(): array |
||
59 | |||
60 | /** |
||
61 | * @inheritdoc |
||
62 | */ |
||
63 | final public static function name(): string |
||
67 | |||
68 | /** |
||
69 | * @inheritdoc |
||
70 | */ |
||
71 | abstract public function boot(); |
||
72 | |||
73 | /** |
||
74 | * @return MutableConfig |
||
75 | */ |
||
76 | protected function config(): MutableConfig |
||
80 | |||
81 | /** |
||
82 | * @return Container |
||
83 | */ |
||
84 | protected function container(): Container |
||
88 | |||
89 | /** |
||
90 | * @return Kernel |
||
91 | */ |
||
92 | protected function kernel(): Kernel |
||
96 | |||
97 | /** |
||
98 | * Merges config params from service provider with the global configuration. |
||
99 | * |
||
100 | * @param string[] ...$configFiles |
||
101 | */ |
||
102 | protected function loadConfigFromFiles(string ...$configFiles) |
||
108 | |||
109 | /** |
||
110 | * Registers commands exposed by service provider. |
||
111 | * |
||
112 | * @param string[] ...$commandClasses |
||
113 | */ |
||
114 | protected function provideCommands(string ...$commandClasses) |
||
122 | } |