Reference   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
dl 0
loc 43
ccs 11
cts 11
cp 1
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getLabel() 0 3 1
A __construct() 0 5 1
A getDestination() 0 3 1
A getTitle() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the league/commonmark package.
7
 *
8
 * (c) Colin O'Dell <[email protected]>
9
 *
10
 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
11
 *  - (c) John MacFarlane
12
 *
13
 * For the full copyright and license information, please view the LICENSE
14
 * file that was distributed with this source code.
15
 */
16
17
namespace League\CommonMark\Reference;
18
19
/**
20
 * @psalm-immutable
21
 */
22
final class Reference implements ReferenceInterface
23
{
24
    /**
25
     * @var string
26
     *
27
     * @psalm-readonly
28
     */
29
    private $label;
30
31
    /**
32
     * @var string
33
     *
34
     * @psalm-readonly
35
     */
36
    private $destination;
37
38
    /**
39
     * @var string
40
     *
41
     * @psalm-readonly
42
     */
43
    private $title;
44
45 366
    public function __construct(string $label, string $destination, string $title)
46
    {
47 366
        $this->label       = $label;
48 366
        $this->destination = $destination;
49 366
        $this->title       = $title;
50 366
    }
51
52 357
    public function getLabel(): string
53
    {
54 357
        return $this->label;
55
    }
56
57 303
    public function getDestination(): string
58
    {
59 303
        return $this->destination;
60
    }
61
62 294
    public function getTitle(): string
63
    {
64 294
        return $this->title;
65
    }
66
}
67