Test Failed
Push — master ( d28cee...30fec9 )
by Burak
05:26 queued 27s
created

Index   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 4 1
A mount() 0 3 1
1
<?php
2
3
namespace App\Http\Livewire\Message;
4
5
use App\Interfaces\MessageServiceInterface;
6
use Illuminate\Support\Facades\Auth;
7
use Livewire\Component;
8
9
class Index extends Component
10
{
11
    private MessageServiceInterface $service;
12
13
    public function mount(MessageServiceInterface $service)
14
    {
15
        $this->service = $service;
16
    }
17
18
    public function render()
19
    {
20
        $threads = $this->service->threads(Auth::user());
0 ignored issues
show
Bug introduced by
It seems like Illuminate\Support\Facades\Auth::user() can also be of type null; however, parameter $user of App\Interfaces\MessageServiceInterface::threads() 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

20
        $threads = $this->service->threads(/** @scrutinizer ignore-type */ Auth::user());
Loading history...
21
        return view('livewire.message.index', ['threads' => $threads]);
22
    }
23
}
24