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\Input;
15
 
16
use League\CommonMark\Extension\FrontMatter\FrontMatterProviderInterface;
17
use League\CommonMark\Input\MarkdownInput;
18
 
19
final class MarkdownInputWithFrontMatter extends MarkdownInput implements FrontMatterProviderInterface
20
{
21
    /** @var mixed|null */
22
    private $frontMatter;
23
 
24
    /**
25
     * @param string     $content     Markdown content without the raw front matter
26
     * @param int        $lineOffset  Line offset (based on number of front matter lines removed)
27
     * @param mixed|null $frontMatter Parsed front matter
28
     */
29
    public function __construct(string $content, int $lineOffset = 0, $frontMatter = null)
30
    {
31
        parent::__construct($content, $lineOffset);
32
 
33
        $this->frontMatter = $frontMatter;
34
    }
35
 
36
    /**
37
     * {@inheritDoc}
38
     */
39
    public function getFrontMatter()
40
    {
41
        return $this->frontMatter;
42
    }
43
}