Passed
Push — 5.0.0 ( 746f48...fc989a )
by Fèvre
06:29
created

ListItem   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 3 1
A __construct() 0 13 1
1
<?php
2
3
namespace Xetaravel\View\Components;
4
5
use Closure;
6
use Illuminate\Contracts\View\View;
7
use Illuminate\View\Component;
8
9
class ListItem extends Component
10
{
11
    public string $uuid;
12
13
    public function __construct(
14
        public object|array $item,
15
        public string $avatar = 'avatar',
16
        public string $value = 'name',
17
        public ?string $subValue = '',
18
        public ?bool $noSeparator = false,
19
        public ?bool $noHover = false,
20
        public ?string $link = null,
21
22
        // Slots
23
        public mixed $actions = null,
24
    ) {
25
        $this->uuid = md5(serialize($this));
26
    }
27
28
    /**
29
     * Get the view / contents that represent the component.
30
     */
31
    public function render(): View|Closure|string
32
    {
33
        return view('components.list-item');
34
    }
35
}
36