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 ( caecb8...5dc1da )
by Freek
03:33 queued 58s
created

HtmlAttributes   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setAttribute() 0 6 1
A addClass() 0 6 1
A initializeHtmlAttributes() 0 4 1
1
<?php
2
3
namespace Spatie\Menu\Traits;
4
5
use Spatie\HtmlElement\Attributes;
6
7
trait HtmlAttributes
8
{
9
    /** @var \Spatie\HtmlElement\Attributes */
10
    protected $htmlAttributes;
11
12
    protected function initializeHtmlAttributes()
13
    {
14
        $this->htmlAttributes = new Attributes();
15
    }
16
17
    /**
18
     * @param string $attribute
19
     * @param string $value
20
     *
21
     * @return $this
22
     */
23
    public function setAttribute(string $attribute, string $value = '')
24
    {
25
        $this->htmlAttributes->setAttribute($attribute, $value);
26
27
        return $this;
28
    }
29
30
    /**
31
     * @param string $class
32
     *
33
     * @return $this
34
     */
35
    public function addClass(string $class)
36
    {
37
        $this->htmlAttributes->addClass($class);
38
39
        return $this;
40
    }
41
}
42