Href::isTemplated()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
/*
6
 * This file is part of the FiveLab Resource package
7
 *
8
 * (c) FiveLab
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code
12
 */
13
14
namespace FiveLab\Component\Resource\Resource\Href;
15
16
/**
17
 * Default href value for relation.
18
 *
19
 * @author Vitaliy Zhuk <[email protected]>
20
 */
21
class Href implements HrefInterface
22
{
23
    /**
24
     * @var string
25
     */
26
    private $path;
27
28
    /**
29
     * @var bool
30
     */
31
    private $templated;
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param string $path
37
     * @param bool   $templated
38
     */
39 11
    public function __construct(string $path, bool $templated = false)
40
    {
41 11
        $this->path = $path;
42 11
        $this->templated = $templated;
43 11
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48 3
    public function getPath(): string
49
    {
50 3
        return $this->path;
51
    }
52
53
    /**
54
     * Is href templated?
55
     *
56
     * @return bool
57
     */
58 3
    public function isTemplated(): bool
59
    {
60 3
        return $this->templated;
61
    }
62
}
63