RenderedContent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getContent() 0 3 1
A __construct() 0 4 1
A getDocument() 0 3 1
A __toString() 0 3 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 2988
    public function __construct(Document $document, string $html)
35
    {
36 2988
        $this->document = $document;
37 2988
        $this->html     = $html;
38 2988
    }
39
40 12
    public function getDocument(): Document
41
    {
42 12
        return $this->document;
43
    }
44
45 24
    public function getContent(): string
46
    {
47 24
        return $this->html;
48
    }
49
50
    /**
51
     * @psalm-mutation-free
52
     */
53 2970
    public function __toString(): string
54
    {
55 2970
        return $this->html;
56
    }
57
}
58