Skip to content

Commit b3829a6

Browse files
committed
Add 3 new parameters to create API from BigBlueButton 2.5
1 parent b587c68 commit b3829a6

File tree

4 files changed

+124
-13
lines changed

4 files changed

+124
-13
lines changed

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
->setRiskyAllowed(true)
3232
->setRules([
3333
'@PhpCsFixer' => true,
34+
'@PHP74Migration' => true,
3435
'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead
3536
'header_comment' => ['header' => $header],
3637
'concat_space' => ['spacing' => 'one'],

src/Parameters/CreateMeetingParameters.php

Lines changed: 116 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,40 @@ class CreateMeetingParameters extends MetaParameters
295295
*/
296296
private $userCameraCap;
297297

298+
/**
299+
* @var int
300+
*/
301+
private $meetingCameraCap;
302+
303+
/**
304+
* @var int
305+
*/
306+
private $meetingExpireIfNoUserJoinedInMinutes;
307+
308+
/**
309+
* @var int
310+
*/
311+
private $meetingExpireWhenLastUserLeftInMinutes;
312+
313+
/**
314+
* @var bool
315+
*/
316+
private $preUploadedPresentationOverrideDefault;
317+
318+
/**
319+
* @var
320+
*
321+
* @todo
322+
*/
323+
private $disabledFeatures;
324+
325+
/**
326+
* @var
327+
*
328+
* @todo
329+
*/
330+
private $breakoutRoomsGroups;
331+
298332
/**
299333
* CreateMeetingParameters constructor.
300334
*
@@ -1219,11 +1253,13 @@ public function isBreakoutRoomsEnabled(): bool
12191253
}
12201254

12211255
/**
1222-
* @return CreateMeetingParameters
1223-
*
12241256
* @deprecated
1257+
*
1258+
* @param mixed $breakoutRoomsEnabled
1259+
*
1260+
* @return CreateMeetingParameters
12251261
*/
1226-
public function setBreakoutRoomsEnabled(bool $breakoutRoomsEnabled): self
1262+
public function setBreakoutRoomsEnabled($breakoutRoomsEnabled)
12271263
{
12281264
$this->breakoutRoomsEnabled = $breakoutRoomsEnabled;
12291265

@@ -1236,24 +1272,26 @@ public function isBreakoutRoomsRecord(): bool
12361272
}
12371273

12381274
/**
1239-
* @return CreateMeetingParameters
1275+
* @param bool $breakoutRoomsRecord
1276+
*
1277+
* @return $this
12401278
*/
1241-
public function setBreakoutRoomsRecord(bool $breakoutRoomsRecord): self
1279+
public function setBreakoutRoomsRecord($breakoutRoomsRecord)
12421280
{
12431281
$this->breakoutRoomsRecord = $breakoutRoomsRecord;
12441282

12451283
return $this;
12461284
}
12471285

1248-
public function isBreakoutRoomsPrivateChatEnabled(): bool
1286+
public function isBreakoutRoomsPrivateChatEnabled()
12491287
{
12501288
return $this->breakoutRoomsPrivateChatEnabled;
12511289
}
12521290

12531291
/**
12541292
* @return CreateMeetingParameters
12551293
*/
1256-
public function setBreakoutRoomsPrivateChatEnabled(bool $breakoutRoomsPrivateChatEnabled): self
1294+
public function setBreakoutRoomsPrivateChatEnabled(bool $breakoutRoomsPrivateChatEnabled)
12571295
{
12581296
$this->breakoutRoomsPrivateChatEnabled = $breakoutRoomsPrivateChatEnabled;
12591297

@@ -1268,41 +1306,55 @@ public function getMeetingEndedURL(): string
12681306
/**
12691307
* @return CreateMeetingParameters
12701308
*/
1271-
public function setMeetingEndedURL(string $meetingEndedURL): self
1309+
public function setMeetingEndedURL(string $meetingEndedURL)
12721310
{
12731311
$this->meetingEndedURL = $meetingEndedURL;
12741312

12751313
return $this;
12761314
}
12771315

1278-
public function getMeetingLayout(): string
1316+
/**
1317+
* @return string
1318+
*/
1319+
public function getMeetingLayout()
12791320
{
12801321
return $this->meetingLayout;
12811322
}
12821323

12831324
/**
12841325
* @return CreateMeetingParameters
12851326
*/
1286-
public function setMeetingLayout(string $meetingLayout): self
1327+
public function setMeetingLayout(string $meetingLayout)
12871328
{
12881329
$this->meetingLayout = $meetingLayout;
12891330

12901331
return $this;
12911332
}
12921333

1293-
public function isAllowRequestsWithoutSession(): bool
1334+
/**
1335+
* @return bool
1336+
*/
1337+
public function isAllowRequestsWithoutSession()
12941338
{
12951339
return $this->allowRequestsWithoutSession;
12961340
}
12971341

1342+
/**
1343+
* @param $allowRequestsWithoutSession
1344+
*
1345+
* @return $this
1346+
*/
12981347
public function setAllowRequestsWithoutSession($allowRequestsWithoutSession)
12991348
{
13001349
$this->allowRequestsWithoutSession = $allowRequestsWithoutSession;
13011350

13021351
return $this;
13031352
}
13041353

1305-
public function getUserCameraCap(): int
1354+
/**
1355+
* @return int
1356+
*/
1357+
public function getUserCameraCap()
13061358
{
13071359
return $this->userCameraCap;
13081360
}
@@ -1319,6 +1371,54 @@ public function setUserCameraCap($userCameraCap)
13191371
return $this;
13201372
}
13211373

1374+
public function getMeetingCameraCap(): int
1375+
{
1376+
return $this->meetingCameraCap;
1377+
}
1378+
1379+
public function setMeetingCameraCap(int $meetingCameraCap): CreateMeetingParameters
1380+
{
1381+
$this->meetingCameraCap = $meetingCameraCap;
1382+
1383+
return $this;
1384+
}
1385+
1386+
public function getMeetingExpireIfNoUserJoinedInMinutes(): int
1387+
{
1388+
return $this->meetingExpireIfNoUserJoinedInMinutes;
1389+
}
1390+
1391+
public function setMeetingExpireIfNoUserJoinedInMinutes(int $meetingExpireIfNoUserJoinedInMinutes): CreateMeetingParameters
1392+
{
1393+
$this->meetingExpireIfNoUserJoinedInMinutes = $meetingExpireIfNoUserJoinedInMinutes;
1394+
1395+
return $this;
1396+
}
1397+
1398+
public function getMeetingExpireWhenLastUserLeftInMinutes(): int
1399+
{
1400+
return $this->meetingExpireWhenLastUserLeftInMinutes;
1401+
}
1402+
1403+
public function setMeetingExpireWhenLastUserLeftInMinutes(int $meetingExpireWhenLastUserLeftInMinutes): CreateMeetingParameters
1404+
{
1405+
$this->meetingExpireWhenLastUserLeftInMinutes = $meetingExpireWhenLastUserLeftInMinutes;
1406+
1407+
return $this;
1408+
}
1409+
1410+
public function isPreUploadedPresentationOverrideDefault(): bool
1411+
{
1412+
return $this->preUploadedPresentationOverrideDefault;
1413+
}
1414+
1415+
public function setPreUploadedPresentationOverrideDefault(bool $preUploadedPresentationOverrideDefault): CreateMeetingParameters
1416+
{
1417+
$this->preUploadedPresentationOverrideDefault = $preUploadedPresentationOverrideDefault;
1418+
1419+
return $this;
1420+
}
1421+
13221422
/**
13231423
* @return array
13241424
*/
@@ -1428,6 +1528,10 @@ public function getHTTPQuery()
14281528
'endWhenNoModerator' => $this->endWhenNoModerator ? 'true' : 'false',
14291529
'meetingKeepEvents' => $this->meetingKeepEvents ? 'true' : 'false',
14301530
'meetingLayout' => $this->meetingLayout,
1531+
'meetingCameraCap' => $this->meetingCameraCap,
1532+
'meetingExpireIfNoUserJoinedInMinutes' => $this->meetingExpireIfNoUserJoinedInMinutes,
1533+
'meetingExpireWhenLastUserLeftInMinutes' => $this->meetingExpireWhenLastUserLeftInMinutes,
1534+
'preUploadedPresentationOverrideDefault' => $this->preUploadedPresentationOverrideDefault,
14311535
];
14321536

14331537
// Add breakout rooms parameters only if the meeting is a breakout room

tests/Parameters/CreateMeetingParametersTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ public function testCreateMeetingParameters()
8282
$this->assertEquals($params['meetingEndedURL'], $createMeetingParams->getMeetingEndedURL());
8383
$this->assertEquals($params['meetingLayout'], $createMeetingParams->getMeetingLayout());
8484
$this->assertEquals($params['userCameraCap'], $createMeetingParams->getUserCameraCap());
85+
$this->assertEquals($params['meetingExpireIfNoUserJoinedInMinutes'], $createMeetingParams->getMeetingExpireIfNoUserJoinedInMinutes());
86+
$this->assertEquals($params['meetingExpireWhenLastUserLeftInMinutes'], $createMeetingParams->getMeetingExpireWhenLastUserLeftInMinutes());
87+
$this->assertEquals($params['preUploadedPresentationOverrideDefault'], $createMeetingParams->isPreUploadedPresentationOverrideDefault());
8588
$this->assertEquals($params['meta_presenter'], $createMeetingParams->getMeta('presenter'));
8689
$this->assertEquals($params['meta_endCallbackUrl'], $createMeetingParams->getMeta('endCallbackUrl'));
8790
$this->assertEquals($params['meta_bbb-recording-ready-url'], $createMeetingParams->getMeta('bbb-recording-ready-url'));

tests/TestCase.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ protected function generateCreateParams()
175175
'breakoutRoomsPrivateChatEnabled' => $this->faker->boolean(50),
176176
'meetingEndedURL' => $this->faker->url,
177177
'meetingLayout' => $this->faker->randomElement(MeetingLayout::getValues()),
178+
'meetingExpireIfNoUserJoinedInMinutes' => $this->faker->numberBetween(1, 10),
179+
'meetingExpireWhenLastUserLeftInMinutes' => $this->faker->numberBetween(5, 15),
180+
'preUploadedPresentationOverrideDefault' => $this->faker->boolean,
178181
'meta_presenter' => $this->faker->name,
179182
'meta_endCallbackUrl' => $this->faker->url,
180183
'meta_bbb-recording-ready-url' => $this->faker->url,
@@ -363,7 +366,7 @@ protected function getUpdateRecordingsParamsMock($params)
363366

364367
protected function loadXmlFile($path)
365368
{
366-
return simplexml_load_string(file_get_contents(($path)));
369+
return simplexml_load_string(file_get_contents($path));
367370
}
368371

369372
protected function minifyString($string)

0 commit comments

Comments
 (0)