MapContentRenderTemplate   A
last analyzed

Coupling/Cohesion

Components 1
Dependencies 2

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 2

3 Methods

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