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

DocumentPreParsedEvent::replaceMarkdown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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