Completed
Push — 183-default-layout-ext ( a97107 )
by
unknown
10:37
created

ComposeRenderTemplate::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
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
    public function __construct(Plates\RenderTemplate $render, callable $compose) {
12
        parent::__construct($render);
13
        $this->compose = $compose;
14
    }
15
16
    public function renderTemplate(Plates\Template $template, Plates\RenderTemplate $rt = null) {
17
        return $this->render->renderTemplate(($this->compose)($template), $rt ?: $this);
18
    }
19
}
20