BladeRenderer::render()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
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