Passed
Push — master ( 3849b2...6d2bbe )
by Edson
01:17
created

Content   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 12
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getContent() 0 10 2
1
<?php
2
3
namespace Bonfim\Tpl;
4
5
class Content
6
{
7
    public static function getContent(string $view): string
8
    {
9
        $view = str_replace('.', '/', $view);
10
        $file = Tpl::getDir() . "$view.php";
11
12
        if (!file_exists($file)) {
13
            throw new \Exception("$file template not found"); // @codeCoverageIgnore
14
        }
15
16
        return file_get_contents($file);
17
    }
18
}
19