We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
19 | public function create(Request $request) |
||
20 | { |
||
21 | // Determines the user/owner of invite. |
||
22 | $user = JWTAuth::parseToken()->authenticate(); |
||
23 | |||
24 | $invite = new Invite(); |
||
25 | $invite->invite_code = Hash::make($request[ 'invite_code' ]); |
||
26 | $invite->user_id = $user->id; |
||
27 | $invite->save(); |
||
28 | |||
29 | return response()->json( |
||
|
|||
30 | [ |
||
31 | 'status_code' => 201, |
||
32 | 'message' => 'Invite created!' |
||
33 | ], 201 |
||
34 | ); |
||
35 | } |
||
36 | |||
45 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: