Test Failed
Push — master ( f21b2a...0b0868 )
by Burak
06:41 queued 29s
created

Index   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 15
ccs 0
cts 7
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toggleQR() 0 3 1
A render() 0 6 1
1
<?php
2
3
namespace App\Http\Livewire\Contact;
4
5
use App\Interfaces\ContactServiceInterface;
6
use Illuminate\Support\Facades\Auth;
7
use Livewire\Component;
8
9
class Index extends Component
10
{
11
    public bool $displayQR = false;
12
13
    public function toggleQR()
14
    {
15
        $this->displayQR = false;
16
    }
17
18
    public function render(ContactServiceInterface $contactService)
19
    {
20
        $user = Auth::user();
21
22
        return view('livewire.contact.index', [
23
            'contacts' => $contactService->contacts($user),
0 ignored issues
show
Bug introduced by
It seems like $user can also be of type null; however, parameter $user of App\Interfaces\ContactServiceInterface::contacts() does only seem to accept App\Models\User, maybe add an additional type check? ( Ignorable by Annotation )

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

23
            'contacts' => $contactService->contacts(/** @scrutinizer ignore-type */ $user),
Loading history...
24
        ]);
25
    }
26
}
27