Test Failed
Push — master ( ffc71e...1a0a2f )
by Koen
03:32
created

Update::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Http\Controllers\Api\Profile;
6
7
use App\Http\Requests\Api\Profile\UpdateRequest;
8
use App\Http\Resources\Api\UserResource;
9
use Illuminate\Contracts\Auth\Guard;
0 ignored issues
show
Bug introduced by
The type Illuminate\Contracts\Auth\Guard was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
final class Update
12
{
13
    /**
14
     * Update the specified resource in storage.
15
     *
16
     * @param  \Illuminate\Contracts\Auth\Guard             $guard
17
     * @param  \App\Http\Requests\Api\Profile\UpdateRequest $request
18
     * @return \App\Http\Resources\Api\UserResource
19
     */
20
    public function __invoke(Guard $guard, UpdateRequest $request)
21
    {
22
        /** @var \App\Models\User $user */
23
        $user = $guard->user();
24
25
        $user->update(
26
            $request->validated()
27
        );
28
29
        return new UserResource($user);
30
    }
31
}
32