Passed
Push — latest ( 2ee702...5d397b )
by Colin
02:38 queued 12s
created

RenderedContent::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
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
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace League\CommonMark\Output;
15
16
use League\CommonMark\Node\Block\Document;
17
18
class RenderedContent implements RenderedContentInterface
19
{
20
    /**
21
     * @var Document
22
     *
23
     * @psalm-readonly
24
     */
25
    private $document;
26
27
    /**
28
     * @var string
29
     *
30
     * @psalm-readonly
31
     */
32
    private $html;
33
34 2856
    public function __construct(Document $document, string $html)
35
    {
36 2856
        $this->document = $document;
37 2856
        $this->html     = $html;
38 2856
    }
39
40 12
    public function getDocument(): Document
41
    {
42 12
        return $this->document;
43
    }
44
45 12
    public function getContent(): string
46
    {
47 12
        return $this->html;
48
    }
49
50
    /**
51
     * @psalm-mutation-free
52
     */
53 2850
    public function __toString(): string
54
    {
55 2850
        return $this->html;
56
    }
57
}
58