| Conditions | 5 |
| Paths | 5 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function ban(Request $request, $userid) |
||
| 26 | { |
||
| 27 | $user = User::whereId($userid)->first(); |
||
| 28 | |||
| 29 | $exp = 0; |
||
| 30 | |||
| 31 | if ($request->exists('forever')) { |
||
| 32 | $exp = '+ 150 years'; |
||
| 33 | } elseif ($request->exists('aday')) { |
||
| 34 | $exp = '+1 day'; |
||
| 35 | } elseif ($request->exists('aweek')) { |
||
| 36 | $exp = '+1 week'; |
||
| 37 | } elseif ($request->exists('amonth')) { |
||
| 38 | $exp = '+1 month'; |
||
| 39 | } |
||
| 40 | |||
| 41 | $user->ban([ |
||
| 42 | 'comment' => $request->get('banreason'), |
||
| 43 | 'expired_at' => $exp, |
||
| 44 | ]); |
||
| 45 | |||
| 46 | return redirect(action('UserBanController@show', $userid)); |
||
| 47 | } |
||
| 48 | |||
| 58 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.