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 ( f38163...fac936 )
by Sebastian
02:38
created

Link::prefix()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Spatie\Menu;
4
5
use Spatie\HtmlElement\HtmlElement;
6
use Spatie\Menu\Traits\Activatable as ActivatableTrait;
7
use Spatie\Menu\Traits\HasUrl as HasUrlTrait;
8
use Spatie\Menu\Traits\HtmlAttributes;
9
use Spatie\Menu\Traits\ParentAttributes;
10
11
class Link implements Item, Activatable, HasHtmlAttributes, HasParentAttributes, HasUrl
12
{
13
    use ActivatableTrait, HasUrlTrait, HtmlAttributes, ParentAttributes;
14
15
    /** @var string */
16
    protected $text;
17
18
    /** @var string */
19
    protected $url;
20
21
    /** @var array */
22
    protected $prefixes = [];
23
24
    /**
25
     * @param string $url
26
     * @param string $text
27
     */
28
    protected function __construct(string $url, string $text)
29
    {
30
        $this->url = $url;
31
        $this->text = $text;
32
        $this->active = false;
33
34
        $this->initializeHtmlAttributes();
35
        $this->initializeParentAttributes();
36
    }
37
38
    /**
39
     * @param string $url
40
     * @param string $text
41
     *
42
     * @return static
43
     */
44
    public static function to(string $url, string $text)
45
    {
46
        return new static($url, $text);
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getText(): string
53
    {
54
        return $this->text;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function render(): string
61
    {
62
        return HtmlElement::render(
63
            "a[href={$this->getUrl()}]",
64
            $this->htmlAttributes->toArray(),
65
            $this->text
66
        );
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function __toString(): string
73
    {
74
        return $this->render();
75
    }
76
}
77