Completed
Push — 1.5 ( fb52dd...2fb592 )
by Colin
02:48
created

AttributesExtension::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the league/commonmark package.
5
 *
6
 * (c) Colin O'Dell <[email protected]>
7
 * (c) 2015 Martin Hasoň <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
declare(strict_types=1);
14
15
namespace League\CommonMark\Extension\Attributes;
16
17
use League\CommonMark\ConfigurableEnvironmentInterface;
18
use League\CommonMark\Event\DocumentParsedEvent;
19
use League\CommonMark\Extension\Attributes\Event\AttributesListener;
20
use League\CommonMark\Extension\Attributes\Parser\AttributesBlockParser;
21
use League\CommonMark\Extension\Attributes\Parser\AttributesInlineParser;
22
use League\CommonMark\Extension\ExtensionInterface;
23
24
final class AttributesExtension implements ExtensionInterface
25
{
26 18
    public function register(ConfigurableEnvironmentInterface $environment)
27
    {
28 18
        $environment->addBlockParser(new AttributesBlockParser());
29 18
        $environment->addInlineParser(new AttributesInlineParser());
30 18
        $environment->addEventListener(DocumentParsedEvent::class, [new AttributesListener(), 'processDocument']);
31 18
    }
32
}
33