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

Update::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 7
rs 10
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