BaseConverter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 0
cbo 2
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A matches() 0 4 1
A toJson() 0 9 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