RenderedContent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 4

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, \Stringable
19
{
20
    /** @psalm-readonly */
21
    private Document $document;
22
23
    /** @psalm-readonly */
24
    private string $content;
25
26
    public function __construct(Document $document, string $content)
27
    {
28
        $this->document = $document;
29
        $this->content  = $content;
30
    }
31
32
    public function getDocument(): Document
33
    {
34
        return $this->document;
35
    }
36
37
    public function getContent(): string
38
    {
39
        return $this->content;
40
    }
41
42
    /**
43
     * @psalm-mutation-free
44
     */
45
    public function __toString(): string
46
    {
47
        return $this->content;
48
    }
49
}
50