LinkComponent::__construct()   A
last analyzed

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\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