Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/*
4
 * This file is part of the league/commonmark package.
5
 *
6
 * (c) Colin O'Dell <colinodell@gmail.com>
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     $content     The final HTML
35
     * @param mixed|null $frontMatter Any parsed front matter
36
     */
37
    public function __construct(Document $document, string $content, $frontMatter)
38
    {
39
        parent::__construct($document, $content);
40
 
41
        $this->frontMatter = $frontMatter;
42
    }
43
 
44
    /**
45
     * {@inheritDoc}
46
     */
47
    public function getFrontMatter()
48
    {
49
        return $this->frontMatter;
50
    }
51
}