Passed
Push — master ( 8a12fc...8bc538 )
by Vsevolods
10:30
created

ConfigurationLoading::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 6
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php declare(strict_types = 1);
2
3
namespace Venta\Framework\Kernel\Bootstrap;
4
5
use Venta\Contracts\Config\Config;
6
use Venta\Contracts\Config\ConfigFactory;
7
use Venta\Framework\Kernel\AbstractKernelBootstrap;
8
9
/**
10
 * Class ConfigurationLoading
11
 *
12
 * @package Venta\Framework\Kernel\Bootstrap
13
 */
14
class ConfigurationLoading extends AbstractKernelBootstrap
15
{
16
    /**
17
     * @inheritDoc
18
     */
19
    public function __invoke()
20
    {
21
        /** @var ConfigFactory $configFactory */
22
        $configFactory = $this->container->get(ConfigFactory::class);
23
24
        // todo: implement arbitrary config files loading.
25
        $config = $configFactory->createFromFile($this->kernel->getRootPath() . '/config/app.php');
26
27
        $this->container->bindInstance(Config::class, $config);
28
    }
29
}