Skip to content

Commit 24ea7f5

Browse files
committed
Update the context of the use of UrlBuilder
1 parent 23eac9e commit 24ea7f5

1 file changed

Lines changed: 61 additions & 48 deletions

File tree

src/BigBlueButton.php

Lines changed: 61 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,20 @@
6060
class BigBlueButton
6161
{
6262
/**
63-
* @deprecated Replaced by getter/setter in UrlBuilder-class
63+
* @deprecated This property has been replaced by property in UrlBuilder-class.
64+
* Use property via $this->getUrlBuilder()->setSecret() and $this->getUrlBuilder()->getSecret().
6465
*/
6566
protected string $bbbSecret;
6667

6768
/**
68-
* @deprecated Replaced by getter/setter in UrlBuilder-class
69+
* @deprecated This property has been replaced by property in UrlBuilder-class.
70+
* Use property via $this->getUrlBuilder()->setServerBaseUrl() and $this->getUrlBuilder()->getServerBaseUrl().
6971
*/
7072
protected string $bbbBaseUrl;
7173

7274
/**
73-
* @deprecated Replaced by getter/setter in UrlBuilder-class
75+
* @deprecated This property has been replaced by property in UrlBuilder-class.
76+
* User property via $this->getUrlBuilder()->setHashingAlgorithm() and $this->getUrlBuilder()->getHashingAlgorithm().
7477
*/
7578
protected string $hashingAlgorithm;
7679

@@ -80,7 +83,7 @@ class BigBlueButton
8083
protected array $curlOpts = [];
8184
protected int $timeOut = 10;
8285
protected string $jSessionId;
83-
protected UrlBuilder $urlBuilder;
86+
private UrlBuilder $urlBuilder;
8487

8588
/**
8689
* @param null|array<string, mixed> $opts
@@ -117,21 +120,12 @@ public function __construct(?string $baseUrl = null, ?string $secret = null, ?ar
117120
$this->curlOpts = $opts['curl'] ?? [];
118121
}
119122

120-
/**
121-
* @deprecated Replaced by same function-name provided by UrlBuilder-class
122-
*/
123-
public function setHashingAlgorithm(string $hashingAlgorithm): void
124-
{
125-
$this->hashingAlgorithm = $hashingAlgorithm;
126-
$this->urlBuilder->setHashingAlgorithm($hashingAlgorithm);
127-
}
128-
129123
/**
130124
* @throws BadResponseException|\RuntimeException
131125
*/
132126
public function getApiVersion(): ApiVersionResponse
133127
{
134-
$xml = $this->processXmlResponse($this->urlBuilder->buildUrl());
128+
$xml = $this->processXmlResponse($this->getUrlBuilder()->buildUrl());
135129

136130
return new ApiVersionResponse($xml);
137131
}
@@ -149,15 +143,15 @@ public function getApiVersion(): ApiVersionResponse
149143
*/
150144
public function getCreateMeetingUrl(CreateMeetingParameters $createMeetingParams): string
151145
{
152-
return $this->urlBuilder->getCreateMeetingUrl($createMeetingParams);
146+
return $this->getUrlBuilder()->getCreateMeetingUrl($createMeetingParams);
153147
}
154148

155149
/**
156150
* @throws BadResponseException|\RuntimeException
157151
*/
158152
public function createMeeting(CreateMeetingParameters $createMeetingParams): CreateMeetingResponse
159153
{
160-
$xml = $this->processXmlResponse($this->urlBuilder->getCreateMeetingUrl($createMeetingParams), $createMeetingParams->getPresentationsAsXML());
154+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getCreateMeetingUrl($createMeetingParams), $createMeetingParams->getPresentationsAsXML());
161155

162156
return new CreateMeetingResponse($xml);
163157
}
@@ -167,15 +161,15 @@ public function createMeeting(CreateMeetingParameters $createMeetingParams): Cre
167161
*/
168162
public function getJoinMeetingURL(JoinMeetingParameters $joinMeetingParams): string
169163
{
170-
return $this->urlBuilder->getJoinMeetingURL($joinMeetingParams);
164+
return $this->getUrlBuilder()->getJoinMeetingURL($joinMeetingParams);
171165
}
172166

173167
/**
174168
* @throws BadResponseException|\RuntimeException
175169
*/
176170
public function joinMeeting(JoinMeetingParameters $joinMeetingParams): JoinMeetingResponse
177171
{
178-
$xml = $this->processXmlResponse($this->urlBuilder->getJoinMeetingURL($joinMeetingParams));
172+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getJoinMeetingURL($joinMeetingParams));
179173

180174
return new JoinMeetingResponse($xml);
181175
}
@@ -185,15 +179,15 @@ public function joinMeeting(JoinMeetingParameters $joinMeetingParams): JoinMeeti
185179
*/
186180
public function getEndMeetingURL(EndMeetingParameters $endParams): string
187181
{
188-
return $this->urlBuilder->getEndMeetingURL($endParams);
182+
return $this->getUrlBuilder()->getEndMeetingURL($endParams);
189183
}
190184

191185
/**
192186
* @throws BadResponseException|\RuntimeException
193187
*/
194188
public function endMeeting(EndMeetingParameters $endParams): EndMeetingResponse
195189
{
196-
$xml = $this->processXmlResponse($this->urlBuilder->getEndMeetingURL($endParams));
190+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getEndMeetingURL($endParams));
197191

198192
return new EndMeetingResponse($xml);
199193
}
@@ -203,15 +197,15 @@ public function endMeeting(EndMeetingParameters $endParams): EndMeetingResponse
203197
*/
204198
public function getInsertDocumentUrl(InsertDocumentParameters $insertDocumentParameters): string
205199
{
206-
return $this->urlBuilder->getInsertDocumentUrl($insertDocumentParameters);
200+
return $this->getUrlBuilder()->getInsertDocumentUrl($insertDocumentParameters);
207201
}
208202

209203
/**
210204
* @throws BadResponseException|\RuntimeException
211205
*/
212206
public function insertDocument(InsertDocumentParameters $insertDocumentParams): CreateMeetingResponse
213207
{
214-
$xml = $this->processXmlResponse($this->urlBuilder->getInsertDocumentUrl($insertDocumentParams), $insertDocumentParams->getPresentationsAsXML());
208+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getInsertDocumentUrl($insertDocumentParams), $insertDocumentParams->getPresentationsAsXML());
215209

216210
return new CreateMeetingResponse($xml);
217211
}
@@ -228,15 +222,15 @@ public function insertDocument(InsertDocumentParameters $insertDocumentParams):
228222
*/
229223
public function getIsMeetingRunningUrl(IsMeetingRunningParameters $meetingParams): string
230224
{
231-
return $this->urlBuilder->getIsMeetingRunningUrl($meetingParams);
225+
return $this->getUrlBuilder()->getIsMeetingRunningUrl($meetingParams);
232226
}
233227

234228
/**
235229
* @throws BadResponseException|\RuntimeException
236230
*/
237231
public function isMeetingRunning(IsMeetingRunningParameters $meetingParams): IsMeetingRunningResponse
238232
{
239-
$xml = $this->processXmlResponse($this->urlBuilder->getIsMeetingRunningUrl($meetingParams));
233+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getIsMeetingRunningUrl($meetingParams));
240234

241235
return new IsMeetingRunningResponse($xml);
242236
}
@@ -246,15 +240,15 @@ public function isMeetingRunning(IsMeetingRunningParameters $meetingParams): IsM
246240
*/
247241
public function getMeetingsUrl(): string
248242
{
249-
return $this->urlBuilder->getMeetingsUrl();
243+
return $this->getUrlBuilder()->getMeetingsUrl();
250244
}
251245

252246
/**
253247
* @throws BadResponseException|\RuntimeException
254248
*/
255249
public function getMeetings(): GetMeetingsResponse
256250
{
257-
$xml = $this->processXmlResponse($this->urlBuilder->getMeetingsUrl());
251+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getMeetingsUrl());
258252

259253
return new GetMeetingsResponse($xml);
260254
}
@@ -264,15 +258,15 @@ public function getMeetings(): GetMeetingsResponse
264258
*/
265259
public function getMeetingInfoUrl(GetMeetingInfoParameters $meetingParams): string
266260
{
267-
return $this->urlBuilder->getMeetingInfoUrl($meetingParams);
261+
return $this->getUrlBuilder()->getMeetingInfoUrl($meetingParams);
268262
}
269263

270264
/**
271265
* @throws BadResponseException|\RuntimeException
272266
*/
273267
public function getMeetingInfo(GetMeetingInfoParameters $meetingParams): GetMeetingInfoResponse
274268
{
275-
$xml = $this->processXmlResponse($this->urlBuilder->getMeetingInfoUrl($meetingParams));
269+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getMeetingInfoUrl($meetingParams));
276270

277271
return new GetMeetingInfoResponse($xml);
278272
}
@@ -289,7 +283,7 @@ public function getMeetingInfo(GetMeetingInfoParameters $meetingParams): GetMeet
289283
*/
290284
public function getRecordingsUrl(GetRecordingsParameters $recordingsParams): string
291285
{
292-
return $this->urlBuilder->getRecordingsUrl($recordingsParams);
286+
return $this->getUrlBuilder()->getRecordingsUrl($recordingsParams);
293287
}
294288

295289
/**
@@ -299,7 +293,7 @@ public function getRecordingsUrl(GetRecordingsParameters $recordingsParams): str
299293
*/
300294
public function getRecordings($recordingParams): GetRecordingsResponse
301295
{
302-
$xml = $this->processXmlResponse($this->urlBuilder->getRecordingsUrl($recordingParams));
296+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getRecordingsUrl($recordingParams));
303297

304298
return new GetRecordingsResponse($xml);
305299
}
@@ -309,15 +303,15 @@ public function getRecordings($recordingParams): GetRecordingsResponse
309303
*/
310304
public function getPublishRecordingsUrl(PublishRecordingsParameters $recordingParams): string
311305
{
312-
return $this->urlBuilder->getPublishRecordingsUrl($recordingParams);
306+
return $this->getUrlBuilder()->getPublishRecordingsUrl($recordingParams);
313307
}
314308

315309
/**
316310
* @throws BadResponseException
317311
*/
318312
public function publishRecordings(PublishRecordingsParameters $recordingParams): PublishRecordingsResponse
319313
{
320-
$xml = $this->processXmlResponse($this->urlBuilder->getPublishRecordingsUrl($recordingParams));
314+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getPublishRecordingsUrl($recordingParams));
321315

322316
return new PublishRecordingsResponse($xml);
323317
}
@@ -327,15 +321,15 @@ public function publishRecordings(PublishRecordingsParameters $recordingParams):
327321
*/
328322
public function getDeleteRecordingsUrl(DeleteRecordingsParameters $recordingParams): string
329323
{
330-
return $this->urlBuilder->getDeleteRecordingsUrl($recordingParams);
324+
return $this->getUrlBuilder()->getDeleteRecordingsUrl($recordingParams);
331325
}
332326

333327
/**
334328
* @throws BadResponseException|\RuntimeException
335329
*/
336330
public function deleteRecordings(DeleteRecordingsParameters $recordingParams): DeleteRecordingsResponse
337331
{
338-
$xml = $this->processXmlResponse($this->urlBuilder->getDeleteRecordingsUrl($recordingParams));
332+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getDeleteRecordingsUrl($recordingParams));
339333

340334
return new DeleteRecordingsResponse($xml);
341335
}
@@ -345,15 +339,15 @@ public function deleteRecordings(DeleteRecordingsParameters $recordingParams): D
345339
*/
346340
public function getUpdateRecordingsUrl(UpdateRecordingsParameters $recordingParams): string
347341
{
348-
return $this->urlBuilder->getUpdateRecordingsUrl($recordingParams);
342+
return $this->getUrlBuilder()->getUpdateRecordingsUrl($recordingParams);
349343
}
350344

351345
/**
352346
* @throws BadResponseException|\RuntimeException
353347
*/
354348
public function updateRecordings(UpdateRecordingsParameters $recordingParams): UpdateRecordingsResponse
355349
{
356-
$xml = $this->processXmlResponse($this->urlBuilder->getUpdateRecordingsUrl($recordingParams));
350+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getUpdateRecordingsUrl($recordingParams));
357351

358352
return new UpdateRecordingsResponse($xml);
359353
}
@@ -363,15 +357,15 @@ public function updateRecordings(UpdateRecordingsParameters $recordingParams): U
363357
*/
364358
public function getRecordingTextTracksUrl(GetRecordingTextTracksParameters $getRecordingTextTracksParameters): string
365359
{
366-
return $this->urlBuilder->getRecordingTextTracksUrl($getRecordingTextTracksParameters);
360+
return $this->getUrlBuilder()->getRecordingTextTracksUrl($getRecordingTextTracksParameters);
367361
}
368362

369363
/**
370364
* @throws BadResponseException
371365
*/
372366
public function getRecordingTextTracks(GetRecordingTextTracksParameters $getRecordingTextTracksParams): GetRecordingTextTracksResponse
373367
{
374-
$json = $this->processJsonResponse($this->urlBuilder->getRecordingTextTracksUrl($getRecordingTextTracksParams));
368+
$json = $this->processJsonResponse($this->getUrlBuilder()->getRecordingTextTracksUrl($getRecordingTextTracksParams));
375369

376370
return new GetRecordingTextTracksResponse($json);
377371
}
@@ -381,15 +375,15 @@ public function getRecordingTextTracks(GetRecordingTextTracksParameters $getReco
381375
*/
382376
public function getPutRecordingTextTrackUrl(PutRecordingTextTrackParameters $putRecordingTextTrackParams): string
383377
{
384-
return $this->urlBuilder->getPutRecordingTextTrackUrl($putRecordingTextTrackParams);
378+
return $this->getUrlBuilder()->getPutRecordingTextTrackUrl($putRecordingTextTrackParams);
385379
}
386380

387381
/**
388382
* @throws BadResponseException
389383
*/
390384
public function putRecordingTextTrack(PutRecordingTextTrackParameters $putRecordingTextTrackParams): PutRecordingTextTrackResponse
391385
{
392-
$json = $this->processJsonResponse($this->urlBuilder->getPutRecordingTextTrackUrl($putRecordingTextTrackParams));
386+
$json = $this->processJsonResponse($this->getUrlBuilder()->getPutRecordingTextTrackUrl($putRecordingTextTrackParams));
393387

394388
return new PutRecordingTextTrackResponse($json);
395389
}
@@ -401,7 +395,7 @@ public function putRecordingTextTrack(PutRecordingTextTrackParameters $putRecord
401395
*/
402396
public function getHooksCreateUrl(HooksCreateParameters $hookCreateParams): string
403397
{
404-
return $this->urlBuilder->getHooksCreateUrl($hookCreateParams);
398+
return $this->getUrlBuilder()->getHooksCreateUrl($hookCreateParams);
405399
}
406400

407401
/**
@@ -411,7 +405,7 @@ public function getHooksCreateUrl(HooksCreateParameters $hookCreateParams): stri
411405
*/
412406
public function hooksCreate($hookCreateParams): HooksCreateResponse
413407
{
414-
$xml = $this->processXmlResponse($this->urlBuilder->getHooksCreateUrl($hookCreateParams));
408+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getHooksCreateUrl($hookCreateParams));
415409

416410
return new HooksCreateResponse($xml);
417411
}
@@ -421,15 +415,15 @@ public function hooksCreate($hookCreateParams): HooksCreateResponse
421415
*/
422416
public function getHooksListUrl(): string
423417
{
424-
return $this->urlBuilder->getHooksListUrl();
418+
return $this->getUrlBuilder()->getHooksListUrl();
425419
}
426420

427421
/**
428422
* @throws BadResponseException
429423
*/
430424
public function hooksList(): HooksListResponse
431425
{
432-
$xml = $this->processXmlResponse($this->urlBuilder->getHooksListUrl());
426+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getHooksListUrl());
433427

434428
return new HooksListResponse($xml);
435429
}
@@ -439,7 +433,7 @@ public function hooksList(): HooksListResponse
439433
*/
440434
public function getHooksDestroyUrl(HooksDestroyParameters $hooksDestroyParams): string
441435
{
442-
return $this->urlBuilder->getHooksDestroyUrl($hooksDestroyParams);
436+
return $this->getUrlBuilder()->getHooksDestroyUrl($hooksDestroyParams);
443437
}
444438

445439
/**
@@ -449,7 +443,7 @@ public function getHooksDestroyUrl(HooksDestroyParameters $hooksDestroyParams):
449443
*/
450444
public function hooksDestroy($hooksDestroyParams): HooksDestroyResponse
451445
{
452-
$xml = $this->processXmlResponse($this->urlBuilder->getHooksDestroyUrl($hooksDestroyParams));
446+
$xml = $this->processXmlResponse($this->getUrlBuilder()->getHooksDestroyUrl($hooksDestroyParams));
453447

454448
return new HooksDestroyResponse($xml);
455449
}
@@ -484,14 +478,33 @@ public function setTimeOut(int $TimeOutInSeconds): self
484478
return $this;
485479
}
486480

481+
public function setHashingAlgorithm(string $hashingAlgorithm): void
482+
{
483+
$this->hashingAlgorithm = $hashingAlgorithm;
484+
$this->getUrlBuilder()->setHashingAlgorithm($hashingAlgorithm);
485+
}
486+
487+
public function getHashingAlgorithm(string $hashingAlgorithm): string
488+
{
489+
$this->hashingAlgorithm = $this->getUrlBuilder()->getHashingAlgorithm();
490+
491+
return $this->getUrlBuilder()->getHashingAlgorithm();
492+
}
493+
487494
/**
488-
* @deprecated replaced by same function-name provided by UrlBuilder-BigBlueButton
495+
* @deprecated Replaced by same function-name provided in UrlBuilder-class.
496+
* Access via $this->getUrlBuilder()->buildUrl()
489497
*
490498
* Public accessor for buildUrl
491499
*/
492500
public function buildUrl(string $method = '', string $params = '', bool $append = true): string
493501
{
494-
return $this->urlBuilder->buildUrl($method, $params, $append);
502+
return $this->getUrlBuilder()->buildUrl($method, $params, $append);
503+
}
504+
505+
public function getUrlBuilder(): UrlBuilder
506+
{
507+
return $this->urlBuilder;
495508
}
496509

497510
// ____________________ INTERNAL CLASS METHODS ___________________

0 commit comments

Comments
 (0)