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

RenderedContentWithFrontMatter::getFrontMatter()   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\Extension\FrontMatter\Output;
15
16
use League\CommonMark\Extension\FrontMatter\FrontMatterProviderInterface;
17
use League\CommonMark\Node\Block\Document;
18
use League\CommonMark\Output\RenderedContent;
19
20
/**
21
 * @psalm-immutable
22
 */
23
final class RenderedContentWithFrontMatter extends RenderedContent implements FrontMatterProviderInterface
24
{
25
    /**
26
     * @var mixed
27
     *
28
     * @psalm-readonly
29
     */
30
    private $frontMatter;
31
32
    /**
33
     * @param Document   $document    The parsed Document object
34
     * @param string     $html        The final HTML
35
     * @param mixed|null $frontMatter Any parsed front matter
36
     */
37 6
    public function __construct(Document $document, string $html, $frontMatter)
38
    {
39 6
        parent::__construct($document, $html);
40
41 6
        $this->frontMatter = $frontMatter;
42 6
    }
43
44
    /**
45
     * {@inheritDoc}
46
     */
47 6
    public function getFrontMatter()
48
    {
49 6
        return $this->frontMatter;
50
    }
51
}
52