Reference::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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