Href   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 42
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getPath() 0 4 1
A isTemplated() 0 4 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