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 13declare(strict_types=1); 14 15namespace League\CommonMark\Extension\Footnote\Node; 16 17use League\CommonMark\Inline\Element\AbstractInline; 18use League\CommonMark\Reference\ReferenceInterface; 19 20final class FootnoteRef extends AbstractInline 21{ 22 /** @var ReferenceInterface */ 23 private $reference; 24 25 /** @var string|null */ 26 private $content; 27 28 /** 29 * @param ReferenceInterface $reference 30 * @param string|null $content 31 * @param array<mixed> $data 32 */ 33 public function __construct(ReferenceInterface $reference, ?string $content = null, array $data = []) 34 { 35 $this->reference = $reference; 36 $this->content = $content; 37 $this->data = $data; 38 } 39 40 public function getReference(): ReferenceInterface 41 { 42 return $this->reference; 43 } 44 45 public function setReference(ReferenceInterface $reference): FootnoteRef 46 { 47 $this->reference = $reference; 48 49 return $this; 50 } 51 52 public function getContent(): ?string 53 { 54 return $this->content; 55 } 56} 57