HtmlRenderer::render()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
namespace rtens\domin\delivery\web\renderers;
3
4
use rtens\domin\delivery\Renderer;
5
use rtens\domin\parameters\Html;
6
use rtens\domin\delivery\web\Element;
7
8
class HtmlRenderer implements Renderer {
9
10
    /**
11
     * @param mixed $value
12
     * @return bool
13
     */
14
    public function handles($value) {
15
        return $value instanceof Html;
16
    }
17
18
    /**
19
     * @param Html $value
20
     * @return string
21
     */
22
    public function render($value) {
23
        return (string)new Element('div', ['style' => 'border: 1px solid black; padding: 5pt;'], [
24
            $value->getContent()
25
        ]);
26
    }
27
}