HeadingConverter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toHtml() 0 4 1
A matches() 0 4 1
1
<?php
2
3
namespace Sioen\JsonToHtml;
4
5
use \Michelf\Markdown;
6
7
final class HeadingConverter implements Converter
8
{
9 1
    public function toHtml(array $data)
10
    {
11 1
        return Markdown::defaultTransform('## ' . $data['text']);
12
    }
13
14 1
    public function matches($type)
15
    {
16 1
        return $type === 'heading';
17
    }
18
}
19