BladeElement::getEngine()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Curlyspoon\Core\Elements;
4
5
use Illuminate\Container\Container;
6
use Illuminate\View\Factory;
7
8
abstract class BladeElement extends Element
9
{
10
    public function render(): string
11
    {
12
        return $this->getEngine()->make(implode('.', array_filter([
13
            $this->getPath(),
14
            $this->name,
15
        ])), $this->getOptions())->render();
16
    }
17
18
    abstract protected function getPath(): string;
19
20
    protected function getEngine(): Factory
21
    {
22
        return Container::getInstance()->make('view');
23
    }
24
}
25