Completed
Push — master ( 59ebde...3174b5 )
by ReliQ
01:08
created

MarkdownParser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ReliqArts\Docweaver\Service;
6
7
use ParsedownExtra;
8
use ReliqArts\Docweaver\Contract\MarkdownParser as MDParser;
9
10
/**
11
 * Docweaver markdown helper.
12
 */
13
final class MarkdownParser implements MDParser
14
{
15
    /**
16
     * @var ParsedownExtra
17
     */
18
    private ParsedownExtra $interpreter;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
19
20
    /**
21
     * MarkdownParser constructor.
22
     */
23
    public function __construct(ParsedownExtra $interpreter)
24
    {
25
        $this->interpreter = $interpreter;
26
    }
27
28
    public function parse(string $text): string
29
    {
30
        return $this->interpreter->text($text);
31
    }
32
}
33