Skip to content

Commit 6aff919

Browse files
authored
Merge pull request #145 from littleredbutton/120-add-return-types-to-all-methods
Add return types
2 parents 98f1a0c + 898bd79 commit 6aff919

30 files changed

+169
-599
lines changed

src/BigBlueButton.php

Lines changed: 34 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,11 @@ public function __construct(?string $baseUrl = null, ?string $secret = null, ?Tr
123123
}
124124

125125
/**
126-
* @return ApiVersionResponse
127-
*
128126
* @throws NetworkException
129127
* @throws ParsingException
130128
* @throws RuntimeException
131129
*/
132-
public function getApiVersion()
130+
public function getApiVersion(): ApiVersionResponse
133131
{
134132
$xml = $this->processXmlResponse($this->urlBuilder->buildUrl());
135133

@@ -189,262 +187,202 @@ public function getConnectionError(): ?int
189187
-- end
190188
*/
191189

192-
/**
193-
* @return string
194-
*/
195-
public function getCreateMeetingUrl(CreateMeetingParameters $createMeetingParams)
190+
public function getCreateMeetingUrl(CreateMeetingParameters $createMeetingParams): string
196191
{
197192
return $this->urlBuilder->buildUrl(ApiMethod::CREATE, $createMeetingParams->getHTTPQuery());
198193
}
199194

200195
/**
201-
* @return CreateMeetingResponse
202-
*
203196
* @throws NetworkException
204197
* @throws ParsingException
205198
* @throws RuntimeException
206199
*/
207-
public function createMeeting(CreateMeetingParameters $createMeetingParams)
200+
public function createMeeting(CreateMeetingParameters $createMeetingParams): CreateMeetingResponse
208201
{
209202
$xml = $this->processXmlResponse($this->getCreateMeetingUrl($createMeetingParams), $createMeetingParams->getPresentationsAsXML());
210203

211204
return new CreateMeetingResponse($xml);
212205
}
213206

214-
/**
215-
* @return string
216-
*/
217-
public function getJoinMeetingURL(JoinMeetingParameters $joinMeetingParams)
207+
public function getJoinMeetingURL(JoinMeetingParameters $joinMeetingParams): string
218208
{
219209
return $this->urlBuilder->buildUrl(ApiMethod::JOIN, $joinMeetingParams->getHTTPQuery());
220210
}
221211

222212
/**
223-
* @return JoinMeetingResponse
224-
*
225213
* @throws NetworkException
226214
* @throws ParsingException
227215
* @throws RuntimeException
228216
*/
229-
public function joinMeeting(JoinMeetingParameters $joinMeetingParams)
217+
public function joinMeeting(JoinMeetingParameters $joinMeetingParams): JoinMeetingResponse
230218
{
231219
$xml = $this->processXmlResponse($this->getJoinMeetingURL($joinMeetingParams));
232220

233221
return new JoinMeetingResponse($xml);
234222
}
235223

236-
/**
237-
* @return string
238-
*/
239-
public function getEndMeetingURL(EndMeetingParameters $endParams)
224+
public function getEndMeetingURL(EndMeetingParameters $endParams): string
240225
{
241226
return $this->urlBuilder->buildUrl(ApiMethod::END, $endParams->getHTTPQuery());
242227
}
243228

244229
/**
245-
* @return EndMeetingResponse
246-
*
247230
* @throws NetworkException
248231
* @throws ParsingException
249232
* @throws RuntimeException
250233
*/
251-
public function endMeeting(EndMeetingParameters $endParams)
234+
public function endMeeting(EndMeetingParameters $endParams): EndMeetingResponse
252235
{
253236
$xml = $this->processXmlResponse($this->getEndMeetingURL($endParams));
254237

255238
return new EndMeetingResponse($xml);
256239
}
257240

258-
/**
259-
* @return string
260-
*/
261-
public function getIsMeetingRunningUrl(IsMeetingRunningParameters $meetingParams)
241+
public function getIsMeetingRunningUrl(IsMeetingRunningParameters $meetingParams): string
262242
{
263243
return $this->urlBuilder->buildUrl(ApiMethod::IS_MEETING_RUNNING, $meetingParams->getHTTPQuery());
264244
}
265245

266246
/**
267-
* @return IsMeetingRunningResponse
268-
*
269247
* @throws NetworkException
270248
* @throws ParsingException
271249
* @throws RuntimeException
272250
*/
273-
public function isMeetingRunning(IsMeetingRunningParameters $meetingParams)
251+
public function isMeetingRunning(IsMeetingRunningParameters $meetingParams): IsMeetingRunningResponse
274252
{
275253
$xml = $this->processXmlResponse($this->getIsMeetingRunningUrl($meetingParams));
276254

277255
return new IsMeetingRunningResponse($xml);
278256
}
279257

280-
/**
281-
* @return string
282-
*/
283-
public function getMeetingsUrl()
258+
public function getMeetingsUrl(): string
284259
{
285260
return $this->urlBuilder->buildUrl(ApiMethod::GET_MEETINGS);
286261
}
287262

288263
/**
289-
* @return GetMeetingsResponse
290-
*
291264
* @throws NetworkException
292265
* @throws ParsingException
293266
* @throws RuntimeException
294267
*/
295-
public function getMeetings()
268+
public function getMeetings(): GetMeetingsResponse
296269
{
297270
$xml = $this->processXmlResponse($this->getMeetingsUrl());
298271

299272
return new GetMeetingsResponse($xml);
300273
}
301274

302-
/**
303-
* @return string
304-
*/
305-
public function getMeetingInfoUrl(GetMeetingInfoParameters $meetingParams)
275+
public function getMeetingInfoUrl(GetMeetingInfoParameters $meetingParams): string
306276
{
307277
return $this->urlBuilder->buildUrl(ApiMethod::GET_MEETING_INFO, $meetingParams->getHTTPQuery());
308278
}
309279

310280
/**
311-
* @return GetMeetingInfoResponse
312-
*
313281
* @throws NetworkException
314282
* @throws ParsingException
315283
* @throws RuntimeException
316284
*/
317-
public function getMeetingInfo(GetMeetingInfoParameters $meetingParams)
285+
public function getMeetingInfo(GetMeetingInfoParameters $meetingParams): GetMeetingInfoResponse
318286
{
319287
$xml = $this->processXmlResponse($this->getMeetingInfoUrl($meetingParams));
320288

321289
return new GetMeetingInfoResponse($xml);
322290
}
323291

324-
/**
325-
* @return string
326-
*/
327-
public function getRecordingsUrl(GetRecordingsParameters $recordingsParams)
292+
public function getRecordingsUrl(GetRecordingsParameters $recordingsParams): string
328293
{
329294
return $this->urlBuilder->buildUrl(ApiMethod::GET_RECORDINGS, $recordingsParams->getHTTPQuery());
330295
}
331296

332297
/**
333-
* @return GetRecordingsResponse
334-
*
335298
* @throws NetworkException
336299
* @throws ParsingException
337300
* @throws RuntimeException
338301
*/
339-
public function getRecordings(GetRecordingsParameters $recordingParams)
302+
public function getRecordings(GetRecordingsParameters $recordingParams): GetRecordingsResponse
340303
{
341304
$xml = $this->processXmlResponse($this->getRecordingsUrl($recordingParams));
342305

343306
return new GetRecordingsResponse($xml);
344307
}
345308

346-
/**
347-
* @return string
348-
*/
349-
public function getPublishRecordingsUrl(PublishRecordingsParameters $recordingParams)
309+
public function getPublishRecordingsUrl(PublishRecordingsParameters $recordingParams): string
350310
{
351311
return $this->urlBuilder->buildUrl(ApiMethod::PUBLISH_RECORDINGS, $recordingParams->getHTTPQuery());
352312
}
353313

354314
/**
355-
* @return PublishRecordingsResponse
356-
*
357315
* @throws NetworkException
358316
* @throws ParsingException
359317
* @throws RuntimeException
360318
*/
361-
public function publishRecordings(PublishRecordingsParameters $recordingParams)
319+
public function publishRecordings(PublishRecordingsParameters $recordingParams): PublishRecordingsResponse
362320
{
363321
$xml = $this->processXmlResponse($this->getPublishRecordingsUrl($recordingParams));
364322

365323
return new PublishRecordingsResponse($xml);
366324
}
367325

368-
/**
369-
* @return string
370-
*/
371-
public function getDeleteRecordingsUrl(DeleteRecordingsParameters $recordingParams)
326+
public function getDeleteRecordingsUrl(DeleteRecordingsParameters $recordingParams): string
372327
{
373328
return $this->urlBuilder->buildUrl(ApiMethod::DELETE_RECORDINGS, $recordingParams->getHTTPQuery());
374329
}
375330

376331
/**
377-
* @return DeleteRecordingsResponse
378-
*
379332
* @throws NetworkException
380333
* @throws ParsingException
381334
* @throws RuntimeException
382335
*/
383-
public function deleteRecordings(DeleteRecordingsParameters $recordingParams)
336+
public function deleteRecordings(DeleteRecordingsParameters $recordingParams): DeleteRecordingsResponse
384337
{
385338
$xml = $this->processXmlResponse($this->getDeleteRecordingsUrl($recordingParams));
386339

387340
return new DeleteRecordingsResponse($xml);
388341
}
389342

390-
/**
391-
* @return string
392-
*/
393-
public function getUpdateRecordingsUrl(UpdateRecordingsParameters $recordingParams)
343+
public function getUpdateRecordingsUrl(UpdateRecordingsParameters $recordingParams): string
394344
{
395345
return $this->urlBuilder->buildUrl(ApiMethod::UPDATE_RECORDINGS, $recordingParams->getHTTPQuery());
396346
}
397347

398348
/**
399-
* @return UpdateRecordingsResponse
400-
*
401349
* @throws NetworkException
402350
* @throws ParsingException
403351
* @throws RuntimeException
404352
*/
405-
public function updateRecordings(UpdateRecordingsParameters $recordingParams)
353+
public function updateRecordings(UpdateRecordingsParameters $recordingParams): UpdateRecordingsResponse
406354
{
407355
$xml = $this->processXmlResponse($this->getUpdateRecordingsUrl($recordingParams));
408356

409357
return new UpdateRecordingsResponse($xml);
410358
}
411359

412-
/**
413-
* @return string
414-
*/
415-
public function getRecordingTextTracksUrl(GetRecordingTextTracksParameters $getRecordingTextTracksParams)
360+
public function getRecordingTextTracksUrl(GetRecordingTextTracksParameters $getRecordingTextTracksParams): string
416361
{
417362
return $this->urlBuilder->buildUrl(ApiMethod::GET_RECORDING_TEXT_TRACKS, $getRecordingTextTracksParams->getHTTPQuery());
418363
}
419364

420365
/**
421-
* @return GetRecordingTextTracksResponse
422-
*
423366
* @throws NetworkException
424367
* @throws RuntimeException
425368
*/
426-
public function getRecordingTextTracks(GetRecordingTextTracksParameters $getRecordingTextTracksParams)
369+
public function getRecordingTextTracks(GetRecordingTextTracksParameters $getRecordingTextTracksParams): GetRecordingTextTracksResponse
427370
{
428371
return new GetRecordingTextTracksResponse(
429372
$this->processJsonResponse($this->getRecordingTextTracksUrl($getRecordingTextTracksParams))
430373
);
431374
}
432375

433-
/**
434-
* @return string
435-
*/
436-
public function getPutRecordingTextTrackUrl(PutRecordingTextTrackParameters $putRecordingTextTrackParams)
376+
public function getPutRecordingTextTrackUrl(PutRecordingTextTrackParameters $putRecordingTextTrackParams): string
437377
{
438378
return $this->urlBuilder->buildUrl(ApiMethod::PUT_RECORDING_TEXT_TRACK, $putRecordingTextTrackParams->getHTTPQuery());
439379
}
440380

441381
/**
442-
* @return PutRecordingTextTrackResponse
443-
*
444382
* @throws NetworkException
445383
* @throws RuntimeException
446384
*/
447-
public function putRecordingTextTrack(PutRecordingTextTrackParameters $putRecordingTextTrackParams)
385+
public function putRecordingTextTrack(PutRecordingTextTrackParameters $putRecordingTextTrackParams): PutRecordingTextTrackResponse
448386
{
449387
$url = $this->getPutRecordingTextTrackUrl($putRecordingTextTrackParams);
450388
$file = $putRecordingTextTrackParams->getFile();
@@ -456,62 +394,46 @@ public function putRecordingTextTrack(PutRecordingTextTrackParameters $putRecord
456394
);
457395
}
458396

459-
/**
460-
* @return string
461-
*/
462-
public function getHooksCreateUrl(HooksCreateParameters $hookCreateParams)
397+
public function getHooksCreateUrl(HooksCreateParameters $hookCreateParams): string
463398
{
464399
return $this->urlBuilder->buildUrl(ApiMethod::HOOKS_CREATE, $hookCreateParams->getHTTPQuery());
465400
}
466401

467402
/**
468-
* @return HooksCreateResponse
469-
*
470403
* @throws NetworkException
471404
* @throws RuntimeException
472405
* @throws ParsingException
473406
*/
474-
public function hooksCreate(HooksCreateParameters $hookCreateParams)
407+
public function hooksCreate(HooksCreateParameters $hookCreateParams): HooksCreateResponse
475408
{
476409
$xml = $this->processXmlResponse($this->getHooksCreateUrl($hookCreateParams));
477410

478411
return new HooksCreateResponse($xml);
479412
}
480413

481-
/**
482-
* @return string
483-
*/
484-
public function getHooksListUrl()
414+
public function getHooksListUrl(): string
485415
{
486416
return $this->urlBuilder->buildUrl(ApiMethod::HOOKS_LIST);
487417
}
488418

489-
/**
490-
* @return HooksListResponse
491-
*/
492-
public function hooksList()
419+
public function hooksList(): HooksListResponse
493420
{
494421
$xml = $this->processXmlResponse($this->getHooksListUrl());
495422

496423
return new HooksListResponse($xml);
497424
}
498425

499-
/**
500-
* @return string
501-
*/
502-
public function getHooksDestroyUrl(HooksDestroyParameters $hooksDestroyParams)
426+
public function getHooksDestroyUrl(HooksDestroyParameters $hooksDestroyParams): string
503427
{
504428
return $this->urlBuilder->buildUrl(ApiMethod::HOOKS_DESTROY, $hooksDestroyParams->getHTTPQuery());
505429
}
506430

507431
/**
508-
* @return HooksDestroyResponse
509-
*
510432
* @throws NetworkException
511433
* @throws RuntimeException
512434
* @throws ParsingException
513435
*/
514-
public function hooksDestroy(HooksDestroyParameters $hooksDestroyParams)
436+
public function hooksDestroy(HooksDestroyParameters $hooksDestroyParams): HooksDestroyResponse
515437
{
516438
$xml = $this->processXmlResponse($this->getHooksDestroyUrl($hooksDestroyParams));
517439

@@ -536,15 +458,13 @@ public function insertDocument(InsertDocumentParameters $insertDocumentParams):
536458
}
537459

538460
/* ____________________ SPECIAL METHODS ___________________ */
539-
/**
540-
* @return string
541-
*/
542-
public function getJSessionId()
461+
462+
public function getJSessionId(): ?string
543463
{
544464
return $this->jSessionId;
545465
}
546466

547-
public function setJSessionId(string $jSessionId)
467+
public function setJSessionId(string $jSessionId): void
548468
{
549469
$this->jSessionId = $jSessionId;
550470
}

0 commit comments

Comments
 (0)