Framework::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace N1215\Tsukuyomi;
5
6
use Psr\Container\ContainerInterface;
7
8
class Framework implements FrameworkInterface
9
{
10
    /** @var ContainerInterface  */
11
    private $container;
12
13
    /** @var string  */
14
    private $rootPath;
15
16 2
    public function __construct(ContainerInterface $container, string $rootPath)
17
    {
18 2
        $this->container = $container;
19 2
        $this->rootPath = $rootPath;
20 2
    }
21
22 1
    public function getContainer(): ContainerInterface
23
    {
24 1
        return $this->container;
25
    }
26
27 1
    public function path(string $relativePath): string
28
    {
29 1
        return $this->rootPath . DIRECTORY_SEPARATOR . $relativePath;
30
    }
31
}
32