Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Details | Vergleich mit vorheriger | 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
 * (c) Rezo Zero / Ambroise Maupate
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
 
13
declare(strict_types=1);
14
 
15
namespace League\CommonMark\Extension\Footnote\Node;
16
 
17
use League\CommonMark\Node\Inline\AbstractInline;
18
use League\CommonMark\Reference\ReferenceInterface;
19
use League\CommonMark\Reference\ReferenceableInterface;
20
 
21
final class FootnoteRef extends AbstractInline implements ReferenceableInterface
22
{
23
    private ReferenceInterface $reference;
24
 
25
    /** @psalm-readonly */
26
    private ?string $content = null;
27
 
28
    /**
29
     * @param array<mixed> $data
30
     */
31
    public function __construct(ReferenceInterface $reference, ?string $content = null, array $data = [])
32
    {
33
        parent::__construct();
34
 
35
        $this->reference = $reference;
36
        $this->content   = $content;
37
 
991 lars 38
        if (\count($data) > 0) {
39
            $this->data->import($data);
40
        }
148 lars 41
    }
42
 
43
    public function getReference(): ReferenceInterface
44
    {
45
        return $this->reference;
46
    }
47
 
48
    public function setReference(ReferenceInterface $reference): void
49
    {
50
        $this->reference = $reference;
51
    }
52
 
53
    public function getContent(): ?string
54
    {
55
        return $this->content;
56
    }
57
}