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

CompiledLink   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 49
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
    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