BaseConverter::toJson()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace Sioen\HtmlToJson;
4
5
use Sioen\SirTrevorBlock;
6
7
final class BaseConverter implements Converter
8
{
9
    use HtmlToMarkdown;
10
11
    public function toJson(\DOMElement $node)
12
    {
13
        $html = $node->ownerDocument->saveXML($node);
14
15
        return new SirTrevorBlock(
16
            'text',
17
            array('text' => ' ' . $this->htmlToMarkdown($html))
18
        );
19
    }
20
21
    public function matches(\DomElement $node)
22
    {
23
        return true;
24
    }
25
}
26