CompiledLink   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 49
ccs 9
cts 11
cp 0.8182
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getHref() 0 4 1
A getTitle() 0 4 1
A getAttributes() 0 4 1
1
<?php
2
3
namespace Bankiru\Seo;
4
5
use Bankiru\Seo\Entity\LinkInterface;
6
7
final class CompiledLink implements LinkInterface
8
{
9
    /** @var  string */
10
    private $href;
11
12
    /** @var string|null */
13
    private $title;
14
15
    /** @var string[] */
16
    private $attributes = [];
17
18
    /**
19
     * CompiledLink constructor.
20
     *
21
     * @param string    $href
22
     * @param string    $title
23
     * @param string[] $attributes
24
     */
25 3
    public function __construct($href, $title = null, array $attributes = [])
26
    {
27 3
        $this->href       = $href;
28 3
        $this->title      = $title;
29 3
        $this->attributes = $attributes;
30 3
    }
31
32
    /**
33
     * @return string
34
     */
35 1
    public function getHref()
36
    {
37 1
        return $this->href;
38
    }
39
40
    /**
41
     * @return string|null
42
     */
43 1
    public function getTitle()
44
    {
45 1
        return $this->title;
46
    }
47
48
    /**
49
     * @return string[]
50
     */
51
    public function getAttributes()
52
    {
53
        return $this->attributes;
54
    }
55
}
56