Passed
Pull Request — latest (#3)
by Mark
35:03
created

RenderedContent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
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 38
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDocument() 0 3 1
A __toString() 0 3 1
A __construct() 0 4 1
A getContent() 0 3 1
1
<?php
2
3
/*
4
 * This file was originally 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 UnicornFail\Emoji\Output;
15
16
use UnicornFail\Emoji\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 $content;
33
34
    public function __construct(Document $document, string $content)
35
    {
36
        $this->document = $document;
37
        $this->content  = $content;
38
    }
39
40
    /**
41
     * @psalm-mutation-free
42
     */
43
    public function __toString(): string
44
    {
45
        return $this->getContent();
46
    }
47
48
    public function getContent(): string
49
    {
50
        return $this->content;
51
    }
52
53
    public function getDocument(): Document
54
    {
55
        return $this->document;
56
    }
57
}
58