ImageConverter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

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
ccs 7
cts 7
cp 1

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 ImageConverter implements Converter
8
{
9
    use HtmlToMarkdown;
10
11 1
    public function toJson(\DOMElement $node)
12
    {
13 1
        return new SirTrevorBlock(
14 1
            'image',
15
            array(
16 1
                'file' => array('url' => $node->getAttribute('src')),
17
            )
18 1
        );
19
    }
20
21 1
    public function matches(\DomElement $node)
22
    {
23 1
        return $node->nodeName === 'img';
24
    }
25
}
26