BladeRenderer::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 3
nc 2
nop 2
crap 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace midorikocak\view;
6
7
use eftec\bladeone\BladeOne;
8
9
class BladeRenderer implements RendererInterface
10
{
11
    private BladeOne $renderer;
12
13 1
    public function __construct($viewPaths = '', $cachePath = '')
14
    {
15 1
        if ($viewPaths !== '' && $viewPaths !== '') {
16 1
            $this->renderer = new BladeOne($viewPaths, $cachePath, BladeOne::MODE_AUTO);
17
        }
18 1
    }
19
20 1
    public function render(string $filename, array $data = []): string
21
    {
22 1
        return $this->renderer->run($filename, $data);
23
    }
24
}
25