ContentAttribute::visit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
namespace Goetas\Twital\Attribute;
3
4
use Goetas\Twital\Attribute;
5
use Goetas\Twital\Compiler;
6
use Goetas\Twital\Helper\DOMHelper;
7
8
/**
9
 *
10
 * @author Asmir Mustafic <[email protected]>
11
 *
12
 */
13
class ContentAttribute implements Attribute
14
{
15 4
    public function visit(\DOMAttr $att, Compiler $context)
16
    {
17 4
        $node = $att->ownerElement;
18 4
        DOMHelper::removeChilds($node);
19 4
        $pi = $context->createPrintNode(html_entity_decode($att->value));
20 4
        $node->appendChild($pi);
21
22 4
        $node->removeAttributeNode($att);
23 4
    }
24
}
25