Completed
Push — master ( a24032...b95662 )
by Colin
01:53
created

getInlineRenderers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the league/commonmark-extras package.
5
 *
6
 * (c) Colin O'Dell <[email protected]>
7
 *
8
 * Original code based on the CommonMark JS reference parser (http://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\Extras\TwitterHandleAutolink;
16
17
use League\CommonMark\Block\Renderer as CoreBlockRenderer;
18
use League\CommonMark\Extension\Extension;
19
use League\CommonMark\Inline\Renderer as CoreInlineRenderer;
20
21
class TwitterHandleAutolinkExtension extends Extension
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26 12
    public function getInlineParsers()
27
    {
28
        return [
29 12
            new TwitterHandleParser(),
30 12
        ];
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 12
    public function getBlockRenderers()
37
    {
38
        return [
39 12
            'League\CommonMark\Block\Element\Document'  => new CoreBlockRenderer\DocumentRenderer(),
40 12
            'League\CommonMark\Block\Element\Paragraph' => new CoreBlockRenderer\ParagraphRenderer(),
41 12
        ];
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47 12
    public function getInlineRenderers()
48
    {
49
        return [
50 12
            'League\CommonMark\Inline\Element\Text' => new CoreInlineRenderer\TextRenderer(),
51 12
            'League\CommonMark\Inline\Element\Link' => new CoreInlineRenderer\LinkRenderer(),
52 12
        ];
53
    }
54
}
55