Completed
Push — 186-data ( 572d68...d14d7f )
by
unknown
10:34
created

HydrateRenderTemplate   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 15
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 4 2
1
<?php
2
3
namespace League\Plates\RenderTemplate;
4
5
use League\Plates;
6
7
final class HydrateRenderTemplate implements Plates\RenderTemplate
8
{
9
    private $render;
10
    private $hydrate;
11
12
    public function __construct(Plates\RenderTemplate $render, Plates\HydrateTemplate $hydrate) {
13
        $this->render = $render;
14
        $this->hydrate = $hydrate;
15
    }
16
17
    public function renderTemplate(Plates\Template $template, Plates\RenderTemplate $rt = null) {
18
        $this->hydrate->hydrateTemplate($template);
19
        return $this->render->renderTemplate($template, $rt ?: $this);
20
    }
21
}
22