Total Complexity | 9 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Coverage | 80.77% |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | class MvcServiceProvider extends AbstractSignatureServiceProvider |
||
14 | { |
||
15 | /** |
||
16 | * {@inheritdoc} |
||
17 | */ |
||
18 | 1 | public function register() |
|
19 | { |
||
20 | 1 | $this->registerModules(); |
|
21 | 1 | $this->registerSections(); |
|
22 | 1 | } |
|
23 | |||
24 | 1 | protected function registerModules() |
|
25 | { |
||
26 | $this->getContainer()->share('mvc.modules', function () { |
||
27 | 1 | return $this->createModulesProvider(); |
|
28 | 1 | }); |
|
29 | 1 | } |
|
30 | |||
31 | /** |
||
32 | * @return ModulesManager |
||
33 | */ |
||
34 | 1 | protected function createModulesProvider() |
|
35 | { |
||
36 | 1 | if ($this->getContainer()->has(Modules::class)) { |
|
37 | 1 | return $this->getContainer()->get(Modules::class); |
|
38 | } |
||
39 | if ($this->getContainer()->has(ModulesManager::class)) { |
||
40 | return $this->getContainer()->get(ModulesManager::class); |
||
41 | } |
||
42 | |||
43 | return new ModulesManager(); |
||
44 | } |
||
45 | |||
46 | 1 | protected function registerSections() |
|
47 | { |
||
48 | $this->getContainer()->share('mvc.sections', function () { |
||
49 | 1 | return $this->createSectionsManager(); |
|
50 | 1 | }); |
|
51 | 1 | } |
|
52 | |||
53 | /** |
||
54 | * @return Modules |
||
55 | */ |
||
56 | 1 | protected function createSectionsManager() |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * @inheritdoc |
||
67 | */ |
||
68 | public function provides() |
||
73 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.