| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | final class MarkdownToXmlConverter implements ConverterInterface |
||
| 24 | { |
||
| 25 | /** @psalm-readonly */ |
||
| 26 | private MarkdownParserInterface $parser; |
||
| 27 | |||
| 28 | /** @psalm-readonly */ |
||
| 29 | private MarkdownRendererInterface $renderer; |
||
| 30 | |||
| 31 | 90 | public function __construct(EnvironmentInterface $environment) |
|
| 35 | 90 | } |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Converts Markdown to XML |
||
| 39 | * |
||
| 40 | * @throws \RuntimeException |
||
| 41 | */ |
||
| 42 | 90 | public function convert(string $input): RenderedContentInterface |
|
| 43 | { |
||
| 44 | 90 | return $this->renderer->renderDocument($this->parser->parse($input)); |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Converts CommonMark to HTML. |
||
| 49 | * |
||
| 50 | * @see MarkdownToXmlConverter::convert() |
||
| 51 | * |
||
| 52 | * @throws \RuntimeException |
||
| 53 | */ |
||
| 54 | 2 | public function __invoke(string $input): RenderedContentInterface |
|
| 57 | } |
||
| 58 | } |
||
| 59 |