1 | <?php |
||
21 | class TournamentController extends Controller |
||
22 | { |
||
23 | /** |
||
24 | * TournamentController constructor. |
||
25 | * @param Larasponse $response |
||
26 | */ |
||
27 | public function __construct(Larasponse $response) |
||
32 | |||
33 | /** |
||
34 | * @SWG\Get( |
||
35 | * tags={"Tournament"}, |
||
36 | * path="/api/v1/tournaments", |
||
37 | * description="Returns all tournaments from database", |
||
38 | * operationId="catalogue", |
||
39 | * produces={"application/json"}, |
||
40 | * @SWG\Response( |
||
41 | * response="200", |
||
42 | * description="Successfully get list of tournaments" |
||
43 | * ) |
||
44 | * ) |
||
45 | */ |
||
46 | public function catalogue() |
||
52 | |||
53 | /** |
||
54 | * @SWG\Get( |
||
55 | * tags={"Tournament"}, |
||
56 | * path="/api/v1/tournaments/{tournamentId}", |
||
57 | * description="Returns specified tournament from database", |
||
58 | * operationId="find", |
||
59 | * produces={"application/json"}, |
||
60 | * @SWG\Parameter( |
||
61 | * description="Tournament id", |
||
62 | * in="path", |
||
63 | * name="tournamentId", |
||
64 | * required=true, |
||
65 | * type="integer" |
||
66 | * ), |
||
67 | * @SWG\Response( |
||
68 | * response="200", |
||
69 | * description="Successfully get specified tournament" |
||
70 | * ) |
||
71 | * ) |
||
72 | * @param $tournamentId |
||
73 | * @return array |
||
74 | */ |
||
75 | public function find($tournamentId) |
||
81 | |||
82 | /** |
||
83 | * @SWG\Get( |
||
84 | * tags={"Tournament"}, |
||
85 | * path="/api/v1/tablescores", |
||
86 | * description="Returns tablescores", |
||
87 | * operationId="tablescores", |
||
88 | * produces={"application/json"}, |
||
89 | * @SWG\Parameter( |
||
90 | * description="Tournament id", |
||
91 | * in="query", |
||
92 | * name="tournamentId", |
||
93 | * required=true, |
||
94 | * type="integer" |
||
95 | * ), |
||
96 | * @SWG\Response( |
||
97 | * response="200", |
||
98 | * description="Successfully get tablescores" |
||
99 | * ) |
||
100 | * ) |
||
101 | */ |
||
102 | public function tablescores() |
||
121 | |||
122 | /** |
||
123 | * @SWG\Get( |
||
124 | * tags={"Tournament"}, |
||
125 | * path="/api/v1/standings", |
||
126 | * description="Returns standings", |
||
127 | * operationId="standings", |
||
128 | * produces={"application/json"}, |
||
129 | * @SWG\Parameter( |
||
130 | * description="Tournament id", |
||
131 | * in="query", |
||
132 | * name="tournamentId", |
||
133 | * required=true, |
||
134 | * type="integer" |
||
135 | * ), |
||
136 | * @SWG\Response( |
||
137 | * response="200", |
||
138 | * description="Successfully get standings" |
||
139 | * ) |
||
140 | * ) |
||
141 | */ |
||
142 | public function standings() |
||
155 | |||
156 | /** |
||
157 | * @SWG\Post( |
||
158 | * tags={"Tournament"}, |
||
159 | * path="/api/v1/tournaments", |
||
160 | * description="Create new tournament", |
||
161 | * operationId="store", |
||
162 | * produces={"application/json"}, |
||
163 | * @SWG\Parameter( |
||
164 | * description="Tournament name", |
||
165 | * in="query", |
||
166 | * name="tournament[name]", |
||
167 | * required=true, |
||
168 | * type="string" |
||
169 | * ), |
||
170 | * @SWG\Parameter( |
||
171 | * description="Tournament description", |
||
172 | * in="query", |
||
173 | * name="tournament[description]", |
||
174 | * required=true, |
||
175 | * type="string" |
||
176 | * ), |
||
177 | * @SWG\Parameter( |
||
178 | * description="Type of tournament: league, knock_out, multistage", |
||
179 | * in="query", |
||
180 | * name="tournament[type]", |
||
181 | * required=true, |
||
182 | * type="string" |
||
183 | * ), |
||
184 | * @SWG\Parameter( |
||
185 | * description="Members type: single, double", |
||
186 | * in="query", |
||
187 | * name="tournament[membersType]", |
||
188 | * required=true, |
||
189 | * type="string" |
||
190 | * ), |
||
191 | * @SWG\Response( |
||
192 | * response="200", |
||
193 | * description="Successfully add tournament" |
||
194 | * ) |
||
195 | * ) |
||
196 | * @param CreateTournament $request |
||
197 | * @return array |
||
198 | */ |
||
199 | public function store(CreateTournament $request) |
||
209 | |||
210 | /** |
||
211 | * @SWG\Put( |
||
212 | * tags={"Tournament"}, |
||
213 | * path="/api/v1/tournaments/{tournamentId}", |
||
214 | * description="Update specified tournament", |
||
215 | * operationId="update", |
||
216 | * produces={"application/json"}, |
||
217 | * @SWG\Parameter( |
||
218 | * description="Tournament id", |
||
219 | * in="path", |
||
220 | * name="tournamentId", |
||
221 | * required=true, |
||
222 | * type="integer" |
||
223 | * ), |
||
224 | * @SWG\Parameter( |
||
225 | * description="Tournament name", |
||
226 | * in="query", |
||
227 | * name="tournament[name]", |
||
228 | * required=true, |
||
229 | * type="string" |
||
230 | * ), |
||
231 | * @SWG\Parameter( |
||
232 | * description="Tournament description", |
||
233 | * in="query", |
||
234 | * name="tournament[description]", |
||
235 | * required=true, |
||
236 | * type="string" |
||
237 | * ), |
||
238 | * @SWG\Parameter( |
||
239 | * description="Tournament status: draft, started, completed", |
||
240 | * in="query", |
||
241 | * name="tournament[status]", |
||
242 | * required=true, |
||
243 | * type="string" |
||
244 | * ), |
||
245 | * @SWG\Parameter( |
||
246 | * description="Tournament type: league, knock_out, multistage", |
||
247 | * in="query", |
||
248 | * name="tournament[type]", |
||
249 | * required=true, |
||
250 | * type="string" |
||
251 | * ), |
||
252 | * @SWG\Parameter( |
||
253 | * description="Members type: single, double", |
||
254 | * in="query", |
||
255 | * name="tournament[membersType]", |
||
256 | * required=true, |
||
257 | * type="string" |
||
258 | * ), |
||
259 | * @SWG\Response( |
||
260 | * response="200", |
||
261 | * description="Successfully update tournament" |
||
262 | * ) |
||
263 | * ) |
||
264 | * @param $tournamentId |
||
265 | * @return array |
||
266 | */ |
||
267 | public function update($tournamentId) |
||
281 | } |
||
282 |
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: