Completed
Push — master ( 2a8024...373a8a )
by Tom
19:54 queued 13s
created

BladeElement   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 17
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 7 1
getPath() 0 1 ?
A getEngine() 0 4 1
1
<?php
2
3
namespace Curlyspoon\Core\Elements;
4
5
use Illuminate\View\Factory;
6
use Illuminate\Container\Container;
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