We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 2 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function userInfo() |
||
18 | { |
||
19 | $user = JWTAuth::parseToken()->authenticate(); |
||
20 | |||
21 | // If the token is invalid |
||
22 | if (!$user) { |
||
23 | return response()->json([ 'invalid_user' ], 401); |
||
24 | } |
||
25 | // Return the user data in json. |
||
26 | return response()->json( |
||
27 | [ |
||
28 | 'first_name' => $user->first_name, |
||
29 | 'last_name' => $user->last_name, |
||
30 | 'email' => $user->email, |
||
31 | 'username' => $user->username, |
||
32 | 'blood_type' => $user->donor->bloodType->code, |
||
33 | 'avatar' => '',//$user->avatar, |
||
34 | 'birthdate' => $user->birthdate, |
||
35 | 'phone' => $user->phone, |
||
36 | 'bio' => $user->bio |
||
37 | ], 200 |
||
38 | ); |
||
39 | |||
40 | } |
||
41 | |||
47 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.