ListBlockConverter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 21
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSupportedTags() 0 3 1
A convert() 0 3 1
1
<?php
2
3
namespace Pilipinews\Common\Converters;
4
5
use League\HTMLToMarkdown\Converter\ConverterInterface;
6
use League\HTMLToMarkdown\ElementInterface;
7
8
/**
9
 * List Block Converter
10
 *
11
 * @package Pilipinews
12
 * @author  Rougin Gutib <[email protected]>
13
 */
14
class ListBlockConverter implements ConverterInterface
15
{
16
    /**
17
     * Converts the specified element into a parsed string.
18
     *
19
     * @param  \League\HTMLToMarkdown\ElementInterface $element
20
     * @return string
21
     */
22 3
    public function convert(ElementInterface $element)
23
    {
24 3
        return rtrim("\n" . $element->getValue()) . "\n";
25
    }
26
27
    /**
28
     * Returns the supported HTML tags.
29
     *
30
     * @return string[]
31
     */
32 15
    public function getSupportedTags()
33
    {
34 15
        return array('ol', 'ul');
35
    }
36
}
37