Passed
Push — master ( 900da9...f74619 )
by Caen
03:31 queued 12s
created

ForwardsHyperlinks::route()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Foundation\Concerns;
6
7
use Hyde\Support\Models\Route;
8
9
/**
10
 * @internal Single-use trait for the HydeKernel class.
11
 *
12
 * @see \Hyde\Foundation\HydeKernel
13
 */
14
trait ForwardsHyperlinks
15
{
16
    public function formatLink(string $destination): string
17
    {
18
        return $this->hyperlinks->formatLink($destination);
19
    }
20
21
    public function relativeLink(string $destination): string
22
    {
23
        return $this->hyperlinks->relativeLink($destination);
24
    }
25
26
    public function mediaLink(string $destination, bool $validate = false): string
27
    {
28
        return $this->hyperlinks->mediaLink($destination, $validate);
29
    }
30
31
    public function asset(string $name, bool $preferQualifiedUrl = false): string
32
    {
33
        return $this->hyperlinks->asset($name, $preferQualifiedUrl);
34
    }
35
36
    public function url(string $path = ''): string
37
    {
38
        return $this->hyperlinks->url($path);
39
    }
40
41
    public function route(string $key): ?Route
42
    {
43
        return $this->hyperlinks->route($key);
44
    }
45
46
    public function hasSiteUrl(): bool
47
    {
48
        return $this->hyperlinks->hasSiteUrl();
49
    }
50
}
51