Completed
Push — master ( 0b6d3a...3ff1a5 )
by Colin
31:14 queued 11s
created

Reference::normalizeReference()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 9.7333
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
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
    public function __construct(string $label, string $destination, string $title)
46
    {
47
        $this->label       = $label;
48
        $this->destination = $destination;
49
        $this->title       = $title;
50
    }
51
52
    public function getLabel(): string
53 321
    {
54
        return $this->label;
55 321
    }
56 321
57 321
    public function getDestination(): string
58 321
    {
59
        return $this->destination;
60 312
    }
61
62 312
    public function getTitle(): string
63
    {
64
        return $this->title;
65 258
    }
66
}
67