Code

< 40 %
40-60 %
> 60 %
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