HTMLHandler::draw()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Kaloa\Renderer\Inigo\Handler;
4
5
use Kaloa\Renderer\Inigo\Handler\ProtoHandler;
6
use Kaloa\Renderer\Inigo\Parser;
7
8
/**
9
 *
10
 */
11
final class HTMLHandler extends ProtoHandler
12
{
13
    /**
14
     *
15
     */
16 18
    public function __construct()
17
    {
18 18
        $this->name = 'html';
19 18
        $this->type = Parser::TAG_OUTLINE | Parser::TAG_PRE | Parser::TAG_CLEAR_CONTENT;
20 18
    }
21
22
    /**
23
     *
24
     * @param  array  $data
25
     * @return string
26
     */
27 2
    public function draw(array $data)
28
    {
29 2
        $ret = '';
30
31 2
        if (!$data['front']) {
32 2
            $ret = $data['content'] . "\n\n";
33 2
        }
34
35 2
        return $ret;
36
    }
37
}
38