AttributesExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 5 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\Environment\EnvironmentBuilderInterface;
18
use League\CommonMark\Event\DocumentParsedEvent;
19
use League\CommonMark\Extension\Attributes\Event\AttributesListener;
20
use League\CommonMark\Extension\Attributes\Parser\AttributesBlockStartParser;
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(EnvironmentBuilderInterface $environment): void
27
    {
28 18
        $environment->addBlockStartParser(new AttributesBlockStartParser());
29 18
        $environment->addInlineParser(new AttributesInlineParser());
30 18
        $environment->addEventListener(DocumentParsedEvent::class, [new AttributesListener(), 'processDocument']);
31 18
    }
32
}
33