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