Completed
Pull Request — master (#32)
by Manuel
05:39
created

MarkdownParser::parse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.125

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1.125
1
<?php
2
3
namespace PiFinder\Services;
4
5
use ParsedownExtra;
6
7
class MarkdownParser
8
{
9
    /**
10
     * Markdown parser instance.
11
     *
12
     * @var ParsedownExtra
13
     */
14
    private $markdown;
15
16
    /**
17
     * MarkdownParser constructor.
18
     *
19
     * @param ParsedownExtra $markdown
20
     */
21 1
    public function __construct(ParsedownExtra $markdown)
22
    {
23 1
        $this->markdown = $markdown;
24 1
    }
25
26
    /**
27
     * Parse a markdown document.
28
     *
29
     * @param $path
30
     *
31
     * @return mixed|string
32
     */
33 1
    public function parse($path)
34
    {
35 1
        return $this->markdown->text($path);
36
    }
37
}
38