1 | <?php |
||
18 | class ProfileController extends BaseController |
||
19 | { |
||
20 | /** |
||
21 | * Get Public User Data. |
||
22 | * |
||
23 | * @param Request $request |
||
24 | * |
||
25 | * @return JsonResponse |
||
26 | */ |
||
27 | public function getPublicData(Request $request): JsonResponse |
||
42 | |||
43 | /** |
||
44 | * Get Public User Profile. |
||
45 | * |
||
46 | * @param int $userId |
||
47 | * |
||
48 | * @return JsonResponse |
||
49 | */ |
||
50 | public function getPublicProfile($userId): JsonResponse |
||
66 | |||
67 | /** |
||
68 | * Get Private User Profile. |
||
69 | * |
||
70 | * @return JsonResponse |
||
71 | */ |
||
72 | public function getProfile(): JsonResponse |
||
76 | |||
77 | /** |
||
78 | * Get User Stories. |
||
79 | * |
||
80 | * @TODO: Implement Habbo Stories |
||
81 | * |
||
82 | * @return JsonResponse |
||
83 | */ |
||
84 | public function getStories(): JsonResponse |
||
88 | |||
89 | /** |
||
90 | * Get User Photos. |
||
91 | * |
||
92 | * @param int $userId |
||
93 | * |
||
94 | * @return JsonResponse |
||
95 | */ |
||
96 | public function getPhotos(int $userId): JsonResponse |
||
106 | } |
||
107 |
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: