Completed
Push — master ( ab5c23...5c675e )
by Jeroen
03:58 queued 01:42
created

AbstractKernel   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 0
cbo 6
dl 0
loc 36
ccs 0
cts 23
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A createErrorHandler() 0 6 1
A createContainer() 0 6 1
A loadEnvironment() 0 5 1
1
<?php
2
3
namespace Protoku\Kernel;
4
5
use Dotenv\Dotenv;
6
use League\BooBoo\Formatter\JsonFormatter;
7
use League\BooBoo\Runner;
8
use League\Container\Container;
9
use League\Container\ContainerAwareTrait;
10
use League\Container\ReflectionContainer;
11
12
abstract class AbstractKernel
13
{
14
    use ContainerAwareTrait;
15
16
    /**
17
     * AbstractKernel constructor.
18
     */
19
    public function __construct()
20
    {
21
    	$this->createErrorHandler();
22
23
    	$this->createContainer();
24
25
    	$this->loadEnvironment();
26
    }
27
28
    private function createErrorHandler()
29
	{
30
		$runner = new Runner();
31
		$runner->pushFormatter(new JsonFormatter);
32
		$runner->register();
33
	}
34
35
    private function createContainer()
36
	{
37
		$container = new Container;
38
		$container->delegate(new ReflectionContainer);
39
		$this->setContainer($container);
40
	}
41
42
	private function loadEnvironment()
43
	{
44
		$environment = new Dotenv(getcwd() . '/../');
45
		$environment->load();
46
	}
47
}
48