Test Setup Failed
Pull Request — latest (#3)
by Mark
65:38 queued 30:20
created

DocumentPreParsedEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 1
b 0
f 0
dl 0
loc 31
rs 10

4 Methods

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