Passed
Branch master (117216)
by Pavel
08:06
created

CompiledLink::getTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
    public function __construct($href, $title = null, array $attributes = [])
26
    {
27
        $this->href       = $href;
28
        $this->title      = $title;
29
        $this->attributes = $attributes;
0 ignored issues
show
Documentation Bug introduced by
It seems like $attributes of type array<integer,object<string>> is incompatible with the declared type array<integer,string> of property $attributes.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getHref()
36
    {
37
        return $this->href;
38
    }
39
40
    /**
41
     * @return string|null
42
     */
43
    public function getTitle()
44
    {
45
        return $this->title;
46
    }
47
48
    /**
49
     * @return string[]
50
     */
51
    public function getAttributes()
52
    {
53
        return $this->attributes;
54
    }
55
}
56