Completed
Push — master ( d935de...f6e733 )
by Park Jong-Hun
04:25
created

AuthBootstrap   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 1
A getAuthConfig() 0 4 1
A getAccountManagerConfig() 0 4 1
A getLoginManagerConfig() 0 4 1
1
<?php
2
3
namespace App\Bootstrap;
4
5
use Core\Application;
6
use Core\Bootstrap\BootstrapInterface;
7
use App\Auth\AuthManager;
8
9
class AuthBootstrap implements BootstrapInterface
10
{
11
12
    public function boot(Application $app)
13
    {
14
        $auth = AuthManager::getInstance();
15
16
        $auth->setConfig($this->getAuthConfig());
17
        $auth->setAccountManagerConfig($this->getAccountManagerConfig());
18
        $auth->setLoginManagerConfig($this->getLoginManagerConfig());
19
    }
20
21
    private function getAuthConfig()
22
    {
23
        return require __DIR__ . '/../Auth/config/config.php';
24
    }
25
26
    private function getAccountManagerConfig()
27
    {
28
        return require __DIR__ . '/../Auth/config/accountManager.php';
29
    }
30
31
    private function getLoginManagerConfig()
32
    {
33
        return require __DIR__ . '/../Auth/config/loginManager.php';
34
    }
35
}
36