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 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 | |||
| 46 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.