Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — development (#48)
by José
04:01
created

AccountController::userInfo()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 24
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 24
ccs 0
cts 15
cp 0
rs 8.9713
cc 2
eloc 15
nc 2
nop 0
crap 6
1
<?php
2
3
namespace DoeSangue\Http\Controllers\API\V1\User;
4
5
use JWTAuth;
6
use Illuminate\Http\Request;
7
use DoeSangue\Http\Controllers\Controller;
8
9
class AccountController extends Controller
10
{
11
    /**
12
     * Get Logged in User information.
13
     *
14
     * @return \Illuminate\Http\JsonResponse
15
     */
16
    public function userInfo()
17
    {
18
        $user = JWTAuth::parseToken()->authenticate();
19
20
        // If the token is invalid
21
        if (!$user) {
22
            return response()->json([ 'invalid_user' ], 401);
23
        }
24
        // Return the user data in json.
25
        return response()->json(
26
            [
27
            'first_name' =>   $user->first_name,
28
            'last_name'  =>   $user->last_name,
29
            'email'      =>   $user->email,
30
            'username'   =>   $user->username,
31
            'blood_type' =>   $user->donor->bloodType->code,
32
            'avatar'     =>   '', //$user->avatar,
33
            'birthdate'  =>   $user->birthdate,
34
            'phone'      =>   $user->phone,
35
            'bio'        =>   $user->bio
36
            ], 200
37
        );
38
39
    }
40
41
    public function updateProfile(Request $data)
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
    {
43
      //
44
    }
45
}
46