Completed
Push — master ( 050452...92806c )
by Colin
04:55
created

SmartPunctExtension::getInlineProcessors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the league/commonmark-ext-smartpunct 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\Ext\SmartPunct;
16
17
use League\CommonMark\Block\Element\Document;
18
use League\CommonMark\Block\Element\Paragraph;
19
use League\CommonMark\Block\Renderer as CoreBlockRenderer;
20
use League\CommonMark\ConfigurableEnvironmentInterface;
21
use League\CommonMark\Extension\ExtensionInterface;
22
use League\CommonMark\Inline\Element\Text;
23
use League\CommonMark\Inline\Renderer as CoreInlineRenderer;
24
25
class SmartPunctExtension implements ExtensionInterface
26
{
27 45
    public function register(ConfigurableEnvironmentInterface $environment)
28
    {
29
        $environment
30 45
            ->addInlineParser(new QuoteParser(), 10)
31 45
            ->addInlineParser(new PunctuationParser(), 0)
32
33 45
            ->addInlineProcessor(new QuoteProcessor(), 10)
34
35 45
            ->addBlockRenderer(Document::class, new CoreBlockRenderer\DocumentRenderer(), 0)
36 45
            ->addBlockRenderer(Paragraph::class, new CoreBlockRenderer\ParagraphRenderer(), 0)
37
38 45
            ->addInlineRenderer(Text::class, new CoreInlineRenderer\TextRenderer(), 0)
39
        ;
40 45
    }
41
}
42