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 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.