GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 25ce45...0b6a33 )
by Sebastian
02:58
created

ParentAttributes   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 46
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A bootParentAttributes() 0 4 1
A getParentAttributes() 0 4 1
A setParentAttribute() 0 6 1
A addParentClass() 0 6 1
1
<?php
2
3
namespace Spatie\Menu\Traits;
4
5
use Spatie\HtmlElement\Attributes;
6
7
trait ParentAttributes
8
{
9
    /** @var \Spatie\HtmlElement\Attributes */
10
    protected $parentAttributes;
11
12
    protected function bootParentAttributes()
13
    {
14
        $this->parentAttributes = new Attributes();
15
    }
16
17
    /**
18
     * Return an array of attributes to apply on the parent. This generally means the attributes
19
     * that should be applied on the <li> tag.
20
     *
21
     * @return array
22
     */
23
    public function getParentAttributes() : array
24
    {
25
        return $this->parentAttributes->toArray();
26
    }
27
28
    /**
29
     * @param string $attribute
30
     * @param string $value
31
     *
32
     * @return $this
33
     */
34
    public function setParentAttribute(string $attribute, string $value = '')
35
    {
36
        $this->parentAttributes->setAttribute($attribute, $value);
37
38
        return $this;
39
    }
40
41
    /**
42
     * @param string $class
43
     *
44
     * @return $this
45
     */
46
    public function addParentClass(string $class)
47
    {
48
        $this->parentAttributes->addClass($class);
49
50
        return $this;
51
    }
52
}
53