Passed
Push — master ( d05062...3d846f )
by Curtis
19:36 queued 12:47
created

Update   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
1
<?php
2
3
namespace App\Http\Controllers\enso\Avatars;
4
5
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
6
use Illuminate\Routing\Controller;
7
use Illuminate\Support\Facades\Auth;
8
use App\Models\enso\Avatars\Avatar;
9
10
class Update extends Controller
11
{
12
    use AuthorizesRequests;
13
14
    public function __invoke(Avatar $avatar)
15
    {
16
        // $this->authorize('update', $avatar);
17
18
        $avatar = Auth::user()->generateAvatar();
0 ignored issues
show
Bug introduced by
The method generateAvatar() does not exist on Illuminate\Contracts\Auth\Authenticatable. It seems like you code against a sub-type of Illuminate\Contracts\Auth\Authenticatable such as Illuminate\Foundation\Auth\User. ( Ignorable by Annotation )

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

18
        $avatar = Auth::user()->/** @scrutinizer ignore-call */ generateAvatar();
Loading history...
19
20
        return ['avatarId' => $avatar->id];
21
    }
22
}
23