1 | <?php |
||
18 | class NuxController extends BaseController |
||
19 | { |
||
20 | /** |
||
21 | * Check an User Name. |
||
22 | * |
||
23 | * @param Request $request |
||
24 | * |
||
25 | * @return JsonResponse |
||
26 | */ |
||
27 | public function checkName(Request $request): JsonResponse |
||
28 | { |
||
29 | if (User::where('username', $request->json()->get('name'))->where('id', '<>', UserFacade::getUser()->uniqueId)->count() > 0) { |
||
30 | return response()->json(new NuxValidation('NAME_IN_USE')); |
||
31 | } |
||
32 | |||
33 | if (!Validation::filterUserName($request->json()->get('name'))) { |
||
34 | return response()->json(new NuxValidation('INVALID_NAME', ['resultType' => 'VALIDATION_ERROR_ILLEGAL_WORDS'])); |
||
35 | } |
||
36 | |||
37 | return response()->json(new NuxValidation()); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Select an User Name. |
||
42 | * |
||
43 | * @param Request $request |
||
44 | * |
||
45 | * @return JsonResponse |
||
46 | */ |
||
47 | public function selectName(Request $request): JsonResponse |
||
48 | { |
||
49 | UserFacade::updateSession(['username' => $request->json()->get('name')]); |
||
50 | |||
51 | return response()->json(new NuxValidation()); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Select a Room. |
||
56 | * |
||
57 | * @param Request $request |
||
58 | * |
||
59 | * @return Response |
||
60 | */ |
||
61 | public function selectRoom(Request $request): Response |
||
73 | } |
||
74 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: