Completed
Push — master ( 04e760...b100d6 )
by Park Jong-Hun
19:01
created

ApplicationBootstrap   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 5
Bugs 0 Features 1
Metric Value
wmc 5
c 5
b 0
f 1
lcom 1
cbo 1
dl 0
loc 33
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 9 1
A getSiteConfig() 0 4 1
A getViewEngineConfig() 0 4 1
A getViewResolvers() 0 4 1
A getRouterConfig() 0 4 1
1
<?php
2
3
namespace App\Bootstrap;
4
5
use Core\Application;
6
use Core\Bootstrap\BootstrapInterface;
7
use Core\Bootstrap\SiteConfigLoader;
8
9
class ApplicationBootstrap implements BootstrapInterface, SiteConfigLoader
10
{
11
12
    public function boot(Application $app)
13
    {
14
        $app->setSiteConfig($this->getSiteConfig());
15
16
        $app->setViewEngineConfig($this->getViewEngineConfig());
17
        $app->setViewResolver($this->getViewResolvers());
18
19
        $app->setRouterConfig($this->getRouterConfig());
20
    }
21
22
    public function getSiteConfig()
23
    {
24
        return require __DIR__ . '/../../config/site.php';
25
    }
26
27
    private function getViewEngineConfig()
28
    {
29
        return require __DIR__ . '/../../config/viewEngine.php';
30
    }
31
32
    private function getViewResolvers()
33
    {
34
        return require __DIR__ . '/../../config/viewResolver.php';
35
    }
36
37
    private function getRouterConfig()
38
    {
39
        return require __DIR__ . '/../../config/router.php';
40
    }
41
}
42