Completed
Push — master ( 103c69...214519 )
by Colin
35:28 queued 34:02
created

FootnoteRef   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 39
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getReference() 0 4 1
A setReference() 0 6 1
A getContent() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the league/commonmark package.
5
 *
6
 * (c) Colin O'Dell <[email protected]>
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
20
final class FootnoteRef extends AbstractInline
21
{
22
    /** @var ReferenceInterface */
23
    private $reference;
24
25
    /**
26
     * @var string|null
27
     *
28
     * @psalm-readonly
29
     */
30
    private $content;
31
32
    /**
33
     * @param array<mixed> $data
34
     */
35 48
    public function __construct(ReferenceInterface $reference, ?string $content = null, array $data = [])
36
    {
37 48
        $this->reference = $reference;
38 48
        $this->content   = $content;
39 48
        $this->data      = $data;
40 48
    }
41
42 48
    public function getReference(): ReferenceInterface
43
    {
44 48
        return $this->reference;
45
    }
46
47 36
    public function setReference(ReferenceInterface $reference): FootnoteRef
48
    {
49 36
        $this->reference = $reference;
50
51 36
        return $this;
52
    }
53
54 36
    public function getContent(): ?string
55
    {
56 36
        return $this->content;
57
    }
58
}
59