Completed
Push — master ( d8cf69...00d73b )
by Tom
06:46
created

PugElement   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 4 1
getPath() 0 1 ?
A getEngine() 0 4 1
1
<?php
2
3
namespace Curlyspoon\Core\Elements;
4
5
use Pug\Pug;
6
7
abstract class PugElement extends Element
8
{
9
    public function render(): string
10
    {
11
        return $this->getEngine()->renderFile($this->getPath(), $this->getOptions());
12
    }
13
14
    abstract protected function getPath(): string;
15
16
    protected function getEngine(): Pug
17
    {
18
        return new Pug();
19
    }
20
}
21