Completed
Push — master ( f6e733...e82db7 )
by Park Jong-Hun
03:41
created

ApplicationBootstrap::getViewEngineConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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
        $app->setErrorReporterConfig($this->getErrorReporterConfig());
16
        $app->setDbConfig($this->getDbConfig());
17
18
        $app->setViewEngineConfig($this->getViewEngineConfig());
19
        $app->setViewResolver($this->getViewResolvers());
20
21
        $app->setDisplayError($this->getSiteConfig()['displayErrors']);
22
        $app->registerErrorReporters();
23
24
        $app->setEventListener($this->getEventListener());
25
        $app->registerEventListener();
26
27
        $app->setRouterConfig($this->getRouterConfig());
28
    }
29
30
    public function getSiteConfig()
31
    {
32
        return require __DIR__ . '/../../config/site.php';
33
    }
34
35
    private function getErrorReporterConfig()
36
    {
37
        return require __DIR__ . '/../../config/errorReporter.php';
38
    }
39
40
    private function getDbConfig()
41
    {
42
        return require __DIR__ . '/../../config/db.php';
43
    }
44
45
    private function getViewEngineConfig()
46
    {
47
        return require __DIR__ . '/../../config/viewEngine.php';
48
    }
49
50
    private function getViewResolvers()
51
    {
52
        return require __DIR__ . '/../../config/viewResolver.php';
53
    }
54
55
    private function getEventListener()
56
    {
57
        return require __DIR__ . '/../../config/event.php';
58
    }
59
60
    private function getRouterConfig()
61
    {
62
        return require __DIR__ . '/../../config/router.php';
63
    }
64
}
65