ElementRendererInterface::renderInline()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the league/commonmark package.
5
 *
6
 * (c) Colin O'Dell <[email protected]>
7
 *
8
 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
9
 *  - (c) John MacFarlane
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace League\CommonMark;
16
17
use League\CommonMark\Block\Element\AbstractBlock;
18
use League\CommonMark\Inline\Element\AbstractInline;
19
20
/**
21
 * Renders a parsed AST to a string representation
22
 */
23
interface ElementRendererInterface
24
{
25
    /**
26
     * @param string $option
27
     * @param mixed  $default
28
     *
29
     * @return mixed|null
30
     */
31
    public function getOption(string $option, $default = null);
32
33
    /**
34
     * @param AbstractInline $inline
35
     *
36
     * @return string
37
     */
38
    public function renderInline(AbstractInline $inline): string;
39
40
    /**
41
     * @param AbstractInline[] $inlines
42
     *
43
     * @return string
44
     */
45
    public function renderInlines(iterable $inlines): string;
46
47
    /**
48
     * @param AbstractBlock $block
49
     * @param bool          $inTightList
50
     *
51
     * @throws \RuntimeException
52
     *
53
     * @return string
54
     */
55
    public function renderBlock(AbstractBlock $block, bool $inTightList = false): string;
56
57
    /**
58
     * @param AbstractBlock[] $blocks
59
     * @param bool            $inTightList
60
     *
61
     * @return string
62
     */
63
    public function renderBlocks(iterable $blocks, bool $inTightList = false): string;
64
}
65