ComposeRenderTemplate   A
last analyzed

Coupling/Cohesion

Components 1
Dependencies 2

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A renderTemplate() 0 3 2
1
<?php
2
3
namespace League\Plates\RenderTemplate;
4
5
use League\Plates;
6
7
final class ComposeRenderTemplate extends RenderTemplateDecorator
8
{
9
    private $compose;
10
11 20
    public function __construct(Plates\RenderTemplate $render, callable $compose) {
12 20
        parent::__construct($render);
13 20
        $this->compose = $compose;
14 20
    }
15
16 20
    public function renderTemplate(Plates\Template $template, Plates\RenderTemplate $rt = null) {
17 20
        return $this->render->renderTemplate(($this->compose)($template), $rt ?: $this);
18
    }
19
}
20