LinkComponent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Framework\Views\Components;
6
7
use Hyde\Hyde;
8
use Illuminate\Support\Facades\View;
9
use Illuminate\Contracts\View\View as ViewContract;
10
use Illuminate\View\Component;
11
12
class LinkComponent extends Component
13
{
14
    public readonly string $href;
15
16
    public function __construct(string $href)
17
    {
18
        $this->href = Hyde::relativeLink($href);
0 ignored issues
show
Bug introduced by
The property href is declared read-only in Hyde\Framework\Views\Components\LinkComponent.
Loading history...
Bug introduced by
The method relativeLink() does not exist on Hyde\Hyde. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        /** @scrutinizer ignore-call */ 
19
        $this->href = Hyde::relativeLink($href);
Loading history...
19
    }
20
21
    /** @interitDoc */
22
    public function render(): ViewContract
23
    {
24
        return View::make('hyde::components.link');
25
    }
26
}
27