ContentAttribute   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 12
c 0
b 0
f 0
wmc 1
cbo 2
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A visit() 0 9 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