Completed
Push — master ( 40e537...652fd3 )
by Colin
01:41 queued 41s
created

DocumentPreParsedEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 72.72%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 29
ccs 8
cts 11
cp 0.7272
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getMarkdown() 0 4 1
A replaceMarkdown() 0 4 1
A getDocument() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the league/commonmark package.
5
 *
6
 * (c) Colin O'Dell <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace League\CommonMark\Event;
13
14
use League\CommonMark\Block\Element\Document;
15
use League\CommonMark\Input\MarkdownInputInterface;
16
17
/**
18
 * Event dispatched when the document is about to be parsed
19
 */
20
final class DocumentPreParsedEvent extends AbstractEvent
21
{
22
    /** @var Document */
23
    private $document;
24
25
    /** @var MarkdownInputInterface */
26
    private $markdown;
27
28 2493
    public function __construct(Document $document, MarkdownInputInterface $markdown)
29
    {
30 2493
        $this->document = $document;
31 2493
        $this->markdown = $markdown;
32 2493
    }
33
34 3
    public function getDocument(): Document
35
    {
36 3
        return $this->document;
37
    }
38
39 2493
    public function getMarkdown(): MarkdownInputInterface
40
    {
41 2493
        return $this->markdown;
42
    }
43
44
    public function replaceMarkdown(MarkdownInputInterface $markdownInput): void
45
    {
46
        $this->markdown = $markdownInput;
47
    }
48
}
49