Completed
Pull Request — master (#11)
by Tomáš
04:15
created

MarkdownConverter::generateHeaderId()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 35
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 35
ccs 0
cts 22
cp 0
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 1
crap 2
1
<?php
2
3
/*
4
 * This file is a part of Sculpin.
5
 *
6
 * (c) Dragonfly Development Inc.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Symplify\PHP7_Sculpin\MarkdownBundle;
13
14
use Michelf\MarkdownExtra;
15
use Symplify\PHP7_Sculpin\Converter\SourceConverterContext;
16
17
final class MarkdownConverter
18
{
19
    /**
20
     * @var string
21
     */
22
    const NAME = 'markdown';
23
24
    /**
25
     * @var MarkdownExtra
26
     */
27
    private $markdown;
28
29
    public function __construct(MarkdownExtra $markdown)
30
    {
31
        $this->markdown = $markdown;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function convert(SourceConverterContext $converterContext)
38
    {
39
        $converterContext->setContent(
40
            $this->markdown->transform(
41
                $converterContext->content()
42
            )
43
        );
44
    }
45
}
46