Test Failed
Push — master ( 7405ac...f937f1 )
by Burak
05:02
created

Index::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 10
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 function render(ContactServiceInterface $contactService)
12
    {
13
        $user = Auth::user();
14
15
        return view('livewire.contact.index', [
16
            '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

16
            'contacts' => $contactService->contacts(/** @scrutinizer ignore-type */ $user),
Loading history...
17
        ]);
18
    }
19
}
20