Test Failed
Push — master ( 506f14...c06a9f )
by Dominik
02:07
created

Link::isTemplated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Serialization\Link;
6
7
use Psr\Link\LinkInterface;
8
9
final class Link implements LinkInterface
10
{
11
    /**
12
     * @var string
13
     */
14
    private $href;
15
16
    /**
17
     * @var bool
18
     */
19
    private $templated;
20
21
    /**
22
     * @var string[]
23
     */
24
    private $rels;
25
26
    /**
27
     * @var array
28
     */
29
    private $attributes;
30
31
    /**
32
     * @param string   $href
33
     * @param bool     $templated
34
     * @param string[] $rels
35
     * @param array    $attributes
36
     */
37
    public function __construct(string $href, bool $templated, array $rels, array $attributes)
38
    {
39
        $this->href = $href;
40
        $this->templated = $templated;
41
        $this->rels = $rels;
42
        $this->attributes = $attributes;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getHref(): string
49
    {
50
        return $this->href;
51
    }
52
53
    /**
54
     * @return bool
55
     */
56
    public function isTemplated(): bool
57
    {
58
        return $this->templated;
59
    }
60
61
    /**
62
     * @return string[]
63
     */
64
    public function getRels(): array
65
    {
66
        return $this->rels;
67
    }
68
69
    /**
70
     * @return array
71
     */
72
    public function getAttributes(): array
73
    {
74
        return $this->attributes;
75
    }
76
}
77