1616 * You should have received a copy of the GNU Lesser General Public License along
1717 * with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
1818 */
19+
1920namespace BigBlueButton ;
2021
2122use BigBlueButton \Core \ApiMethod ;
3233use BigBlueButton \Parameters \GetMeetingInfoParameters ;
3334use BigBlueButton \Parameters \GetRecordingsParameters ;
3435use BigBlueButton \Parameters \GetRecordingTextTracksParameters ;
35- use BigBlueButton \Parameters \PutRecordingTextTrackParameters ;
3636use BigBlueButton \Parameters \HooksCreateParameters ;
3737use BigBlueButton \Parameters \HooksDestroyParameters ;
3838use BigBlueButton \Parameters \InsertDocumentParameters ;
3939use BigBlueButton \Parameters \IsMeetingRunningParameters ;
4040use BigBlueButton \Parameters \JoinMeetingParameters ;
4141use BigBlueButton \Parameters \PublishRecordingsParameters ;
42+ use BigBlueButton \Parameters \PutRecordingTextTrackParameters ;
4243use BigBlueButton \Parameters \UpdateRecordingsParameters ;
4344use BigBlueButton \Responses \ApiVersionResponse ;
4445use BigBlueButton \Responses \CreateMeetingResponse ;
4849use BigBlueButton \Responses \GetMeetingsResponse ;
4950use BigBlueButton \Responses \GetRecordingsResponse ;
5051use BigBlueButton \Responses \GetRecordingTextTracksResponse ;
51- use BigBlueButton \Responses \PutRecordingTextTrackResponse ;
5252use BigBlueButton \Responses \HooksCreateResponse ;
5353use BigBlueButton \Responses \HooksDestroyResponse ;
5454use BigBlueButton \Responses \HooksListResponse ;
5555use BigBlueButton \Responses \InsertDocumentResponse ;
5656use BigBlueButton \Responses \IsMeetingRunningResponse ;
5757use BigBlueButton \Responses \JoinMeetingResponse ;
5858use BigBlueButton \Responses \PublishRecordingsResponse ;
59+ use BigBlueButton \Responses \PutRecordingTextTrackResponse ;
5960use BigBlueButton \Responses \UpdateRecordingsResponse ;
6061use BigBlueButton \Util \UrlBuilder ;
6162use SimpleXMLElement ;
6263
6364/**
64- * Class BigBlueButton
65+ * Class BigBlueButton.
66+ *
6567 * @final since 4.0.
66- * @package BigBlueButton
6768 */
6869class BigBlueButton
6970{
7071 public const CONNECTION_ERROR_BASEURL = 1 ;
71- public const CONNECTION_ERROR_SECRET = 2 ;
72+ public const CONNECTION_ERROR_SECRET = 2 ;
7273
7374 /**
7475 * @var string
@@ -101,27 +102,29 @@ class BigBlueButton
101102 protected $ transport ;
102103
103104 /**
104- * @param string|null $baseUrl (optional) If not given, it will be retrieved from the environment.
105- * @param string|null $secret (optional) If not given, it will be retrieved from the environment.
106- * @param TransportInterface|null $transport (optional) Use a custom transport for all HTTP requests. Will fallback to default CurlTransport.
105+ * @param string|null $baseUrl (optional) If not given, it will be retrieved from the environment
106+ * @param string|null $secret (optional) If not given, it will be retrieved from the environment
107+ * @param TransportInterface|null $transport (optional) Use a custom transport for all HTTP requests. Will fallback to default CurlTransport.
108+ *
107109 * @throws ConfigException
108110 */
109111 public function __construct (?string $ baseUrl = null , ?string $ secret = null , ?TransportInterface $ transport = null )
110112 {
111113 // Keeping backward compatibility with older deployed versions
112- $ this ->securitySecret = $ secret ?: getenv ('BBB_SECURITY_SALT ' ) ?: getenv ('BBB_SECRET ' );
114+ $ this ->securitySecret = $ secret ?: getenv ('BBB_SECURITY_SALT ' ) ?: getenv ('BBB_SECRET ' );
113115 $ this ->bbbServerBaseUrl = $ baseUrl ?: getenv ('BBB_SERVER_BASE_URL ' );
114116
115117 if (empty ($ this ->bbbServerBaseUrl )) {
116118 throw new ConfigException ('Base url required ' );
117119 }
118120
119121 $ this ->urlBuilder = new UrlBuilder ($ this ->securitySecret , $ this ->bbbServerBaseUrl );
120- $ this ->transport = $ transport ?? CurlTransport::createWithDefaultOptions ();
122+ $ this ->transport = $ transport ?? CurlTransport::createWithDefaultOptions ();
121123 }
122124
123125 /**
124126 * @return ApiVersionResponse
127+ *
125128 * @throws NetworkException
126129 * @throws ParsingException
127130 * @throws RuntimeException
@@ -134,7 +137,8 @@ public function getApiVersion()
134137 }
135138
136139 /**
137- * Check if connection to api can be established with the baseurl and secret
140+ * Check if connection to api can be established with the baseurl and secret.
141+ *
138142 * @return bool connection successful
139143 */
140144 public function isConnectionWorking (): bool
@@ -169,7 +173,7 @@ public function isConnectionWorking(): bool
169173 }
170174
171175 /**
172- * Return connection error type
176+ * Return connection error type.
173177 *
174178 * @return int|null Connection error (const CONNECTION_ERROR_BASEURL or CONNECTION_ERROR_SECRET)
175179 */
@@ -195,6 +199,7 @@ public function getCreateMeetingUrl(CreateMeetingParameters $createMeetingParams
195199
196200 /**
197201 * @return CreateMeetingResponse
202+ *
198203 * @throws NetworkException
199204 * @throws ParsingException
200205 * @throws RuntimeException
@@ -207,8 +212,6 @@ public function createMeeting(CreateMeetingParameters $createMeetingParams)
207212 }
208213
209214 /**
210- * @param JoinMeetingParameters $joinMeetingParams
211- *
212215 * @return string
213216 */
214217 public function getJoinMeetingURL (JoinMeetingParameters $ joinMeetingParams )
@@ -218,6 +221,7 @@ public function getJoinMeetingURL(JoinMeetingParameters $joinMeetingParams)
218221
219222 /**
220223 * @return JoinMeetingResponse
224+ *
221225 * @throws NetworkException
222226 * @throws ParsingException
223227 * @throws RuntimeException
@@ -239,6 +243,7 @@ public function getEndMeetingURL(EndMeetingParameters $endParams)
239243
240244 /**
241245 * @return EndMeetingResponse
246+ *
242247 * @throws NetworkException
243248 * @throws ParsingException
244249 * @throws RuntimeException
@@ -260,6 +265,7 @@ public function getIsMeetingRunningUrl(IsMeetingRunningParameters $meetingParams
260265
261266 /**
262267 * @return IsMeetingRunningResponse
268+ *
263269 * @throws NetworkException
264270 * @throws ParsingException
265271 * @throws RuntimeException
@@ -281,6 +287,7 @@ public function getMeetingsUrl()
281287
282288 /**
283289 * @return GetMeetingsResponse
290+ *
284291 * @throws NetworkException
285292 * @throws ParsingException
286293 * @throws RuntimeException
@@ -302,6 +309,7 @@ public function getMeetingInfoUrl(GetMeetingInfoParameters $meetingParams)
302309
303310 /**
304311 * @return GetMeetingInfoResponse
312+ *
305313 * @throws NetworkException
306314 * @throws ParsingException
307315 * @throws RuntimeException
@@ -323,6 +331,7 @@ public function getRecordingsUrl(GetRecordingsParameters $recordingsParams)
323331
324332 /**
325333 * @return GetRecordingsResponse
334+ *
326335 * @throws NetworkException
327336 * @throws ParsingException
328337 * @throws RuntimeException
@@ -344,6 +353,7 @@ public function getPublishRecordingsUrl(PublishRecordingsParameters $recordingPa
344353
345354 /**
346355 * @return PublishRecordingsResponse
356+ *
347357 * @throws NetworkException
348358 * @throws ParsingException
349359 * @throws RuntimeException
@@ -365,6 +375,7 @@ public function getDeleteRecordingsUrl(DeleteRecordingsParameters $recordingPara
365375
366376 /**
367377 * @return DeleteRecordingsResponse
378+ *
368379 * @throws NetworkException
369380 * @throws ParsingException
370381 * @throws RuntimeException
@@ -386,6 +397,7 @@ public function getUpdateRecordingsUrl(UpdateRecordingsParameters $recordingPara
386397
387398 /**
388399 * @return UpdateRecordingsResponse
400+ *
389401 * @throws NetworkException
390402 * @throws ParsingException
391403 * @throws RuntimeException
@@ -407,6 +419,7 @@ public function getRecordingTextTracksUrl(GetRecordingTextTracksParameters $getR
407419
408420 /**
409421 * @return GetRecordingTextTracksResponse
422+ *
410423 * @throws NetworkException
411424 * @throws RuntimeException
412425 */
@@ -427,12 +440,13 @@ public function getPutRecordingTextTrackUrl(PutRecordingTextTrackParameters $put
427440
428441 /**
429442 * @return PutRecordingTextTrackResponse
443+ *
430444 * @throws NetworkException
431445 * @throws RuntimeException
432446 */
433447 public function putRecordingTextTrack (PutRecordingTextTrackParameters $ putRecordingTextTrackParams )
434448 {
435- $ url = $ this ->getPutRecordingTextTrackUrl ($ putRecordingTextTrackParams );
449+ $ url = $ this ->getPutRecordingTextTrackUrl ($ putRecordingTextTrackParams );
436450 $ file = $ putRecordingTextTrackParams ->getFile ();
437451
438452 return new PutRecordingTextTrackResponse (
@@ -452,6 +466,7 @@ public function getHooksCreateUrl(HooksCreateParameters $hookCreateParams)
452466
453467 /**
454468 * @return HooksCreateResponse
469+ *
455470 * @throws NetworkException
456471 * @throws RuntimeException
457472 * @throws ParsingException
@@ -491,6 +506,7 @@ public function getHooksDestroyUrl(HooksDestroyParameters $hooksDestroyParams)
491506
492507 /**
493508 * @return HooksDestroyResponse
509+ *
494510 * @throws NetworkException
495511 * @throws RuntimeException
496512 * @throws ParsingException
@@ -502,9 +518,6 @@ public function hooksDestroy(HooksDestroyParameters $hooksDestroyParams)
502518 return new HooksDestroyResponse ($ xml );
503519 }
504520
505- /**
506- * @return string
507- */
508521 public function getInsertDocumentUrl (InsertDocumentParameters $ insertDocumentParams ): string
509522 {
510523 return $ this ->urlBuilder ->buildUrl (ApiMethod::INSERT_DOCUMENT , $ insertDocumentParams ->getHTTPQuery ());
@@ -549,7 +562,7 @@ private function processXmlResponse(string $url, string $payload = '', string $c
549562 {
550563 try {
551564 return new SimpleXMLElement ($ this ->requestUrl ($ url , $ payload , $ contentType ));
552- } catch (NetworkException | RuntimeException $ e ) {
565+ } catch (NetworkException | RuntimeException $ e ) {
553566 throw $ e ;
554567 } catch (\Throwable $ e ) {
555568 throw new ParsingException ('Could not parse payload as XML ' , 0 , $ e );
@@ -569,10 +582,6 @@ private function processJsonResponse(string $url, string $payload = '', string $
569582 /**
570583 * A private utility method used by other public methods to request from the api.
571584 *
572- * @param string $url
573- * @param string $payload
574- * @param string $contentType
575- *
576585 * @return string Response body
577586 *
578587 * @throws RuntimeException|NetworkException
0 commit comments