Skip to content

Commit 7761b10

Browse files
authored
Move all enums to BigBlueButton\Enum namespace (#197)
1 parent afee4cc commit 7761b10

13 files changed

Lines changed: 158 additions & 44 deletions

src/BigBlueButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace BigBlueButton;
2121

22-
use BigBlueButton\Core\ApiMethod;
22+
use BigBlueButton\Enum\ApiMethod;
2323
use BigBlueButton\Enum\HashingAlgorithm;
2424
use BigBlueButton\Exceptions\ConfigException;
2525
use BigBlueButton\Exceptions\NetworkException;

src/Core/ApiMethod.php

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,23 @@
1919

2020
namespace BigBlueButton\Core;
2121

22+
/* @deprecated and will be removed in 6.0. Use \BigBlueButton\Enum\ApiMethod instead */
2223
final class ApiMethod
2324
{
24-
public const CREATE = 'create';
25-
public const JOIN = 'join';
26-
public const ENTER = 'enter';
27-
public const END = 'end';
28-
public const IS_MEETING_RUNNING = 'isMeetingRunning';
29-
public const GET_MEETING_INFO = 'getMeetingInfo';
30-
public const GET_MEETINGS = 'getMeetings';
31-
public const SIGN_OUT = 'signOut';
32-
public const GET_RECORDINGS = 'getRecordings';
33-
public const PUBLISH_RECORDINGS = 'publishRecordings';
34-
public const DELETE_RECORDINGS = 'deleteRecordings';
35-
public const UPDATE_RECORDINGS = 'updateRecordings';
36-
public const GET_RECORDING_TEXT_TRACKS = 'getRecordingTextTracks';
37-
public const PUT_RECORDING_TEXT_TRACK = 'putRecordingTextTrack';
38-
public const HOOKS_CREATE = 'hooks/create';
39-
public const HOOKS_LIST = 'hooks/list';
40-
public const HOOKS_DESTROY = 'hooks/destroy';
41-
public const INSERT_DOCUMENT = 'insertDocument';
25+
public const CREATE = \BigBlueButton\Enum\ApiMethod::CREATE;
26+
public const JOIN = \BigBlueButton\Enum\ApiMethod::JOIN;
27+
public const END = \BigBlueButton\Enum\ApiMethod::END;
28+
public const IS_MEETING_RUNNING = \BigBlueButton\Enum\ApiMethod::IS_MEETING_RUNNING;
29+
public const GET_MEETING_INFO = \BigBlueButton\Enum\ApiMethod::GET_MEETING_INFO;
30+
public const GET_MEETINGS = \BigBlueButton\Enum\ApiMethod::GET_MEETINGS;
31+
public const GET_RECORDINGS = \BigBlueButton\Enum\ApiMethod::GET_RECORDINGS;
32+
public const PUBLISH_RECORDINGS = \BigBlueButton\Enum\ApiMethod::PUBLISH_RECORDINGS;
33+
public const DELETE_RECORDINGS = \BigBlueButton\Enum\ApiMethod::DELETE_RECORDINGS;
34+
public const UPDATE_RECORDINGS = \BigBlueButton\Enum\ApiMethod::UPDATE_RECORDINGS;
35+
public const GET_RECORDING_TEXT_TRACKS = \BigBlueButton\Enum\ApiMethod::GET_RECORDING_TEXT_TRACKS;
36+
public const PUT_RECORDING_TEXT_TRACK = \BigBlueButton\Enum\ApiMethod::PUT_RECORDING_TEXT_TRACK;
37+
public const HOOKS_CREATE = \BigBlueButton\Enum\ApiMethod::HOOKS_CREATE;
38+
public const HOOKS_LIST = \BigBlueButton\Enum\ApiMethod::HOOKS_LIST;
39+
public const HOOKS_DESTROY = \BigBlueButton\Enum\ApiMethod::HOOKS_DESTROY;
40+
public const INSERT_DOCUMENT = \BigBlueButton\Enum\ApiMethod::INSERT_DOCUMENT;
4241
}

src/Core/GuestPolicy.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222

2323
namespace BigBlueButton\Core;
2424

25+
/* @deprecated and will be removed in 6.0. Use \BigBlueButton\Enum\GuestPolicy instead */
2526
final class GuestPolicy
2627
{
27-
public const ALWAYS_ACCEPT = 'ALWAYS_ACCEPT';
28-
public const ALWAYS_DENY = 'ALWAYS_DENY';
29-
public const ASK_MODERATOR = 'ASK_MODERATOR';
30-
public const ALWAYS_ACCEPT_AUTH = 'ALWAYS_ACCEPT_AUTH';
28+
public const ALWAYS_ACCEPT = \BigBlueButton\Enum\GuestPolicy::ALWAYS_ACCEPT;
29+
public const ALWAYS_DENY = \BigBlueButton\Enum\GuestPolicy::ALWAYS_DENY;
30+
public const ASK_MODERATOR = \BigBlueButton\Enum\GuestPolicy::ASK_MODERATOR;
31+
public const ALWAYS_ACCEPT_AUTH = \BigBlueButton\Enum\GuestPolicy::ALWAYS_ACCEPT_AUTH;
3132
}

src/Core/MeetingLayout.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222

2323
namespace BigBlueButton\Core;
2424

25+
/* @deprecated Use \BigBlueButton\Enum\MeetingLayout instead */
2526
final class MeetingLayout
2627
{
27-
public const CUSTOM_LAYOUT = 'CUSTOM_LAYOUT';
28-
public const SMART_LAYOUT = 'SMART_LAYOUT';
29-
public const PRESENTATION_FOCUS = 'PRESENTATION_FOCUS';
30-
public const VIDEO_FOCUS = 'VIDEO_FOCUS';
28+
public const CUSTOM_LAYOUT = \BigBlueButton\Enum\MeetingLayout::CUSTOM_LAYOUT;
29+
public const SMART_LAYOUT = \BigBlueButton\Enum\MeetingLayout::SMART_LAYOUT;
30+
public const PRESENTATION_FOCUS = \BigBlueButton\Enum\MeetingLayout::PRESENTATION_FOCUS;
31+
public const VIDEO_FOCUS = \BigBlueButton\Enum\MeetingLayout::VIDEO_FOCUS;
3132
}

src/Enum/ApiMethod.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
/**
4+
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
5+
*
6+
* Copyright (c) 2016-2018 BigBlueButton Inc. and by respective authors (see below).
7+
*
8+
* This program is free software; you can redistribute it and/or modify it under the
9+
* terms of the GNU Lesser General Public License as published by the Free Software
10+
* Foundation; either version 3.0 of the License, or (at your option) any later
11+
* version.
12+
*
13+
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
14+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15+
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public License along
18+
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
namespace BigBlueButton\Enum;
22+
23+
/**
24+
* @psalm-immutable
25+
*/
26+
class ApiMethod extends Enum
27+
{
28+
public const CREATE = 'create';
29+
public const JOIN = 'join';
30+
public const ENTER = 'enter';
31+
public const END = 'end';
32+
public const IS_MEETING_RUNNING = 'isMeetingRunning';
33+
public const GET_MEETING_INFO = 'getMeetingInfo';
34+
public const GET_MEETINGS = 'getMeetings';
35+
public const SIGN_OUT = 'signOut';
36+
public const GET_RECORDINGS = 'getRecordings';
37+
public const PUBLISH_RECORDINGS = 'publishRecordings';
38+
public const DELETE_RECORDINGS = 'deleteRecordings';
39+
public const UPDATE_RECORDINGS = 'updateRecordings';
40+
public const GET_RECORDING_TEXT_TRACKS = 'getRecordingTextTracks';
41+
public const PUT_RECORDING_TEXT_TRACK = 'putRecordingTextTrack';
42+
public const HOOKS_CREATE = 'hooks/create';
43+
public const HOOKS_LIST = 'hooks/list';
44+
public const HOOKS_DESTROY = 'hooks/destroy';
45+
public const INSERT_DOCUMENT = 'insertDocument';
46+
}

src/Enum/Feature.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ class Feature extends Enum
4848
public const TIMER = 'timer';
4949

5050
/**
51-
* @deprecated Use Feature::IMPORT_PRESENTATION_WITH_ANNOTATIONS_FROM_BREAKOUT_ROOMS instead
51+
* @deprecated and will be removed in 6.0. Use Feature::IMPORT_PRESENTATION_WITH_ANNOTATIONS_FROM_BREAKOUT_ROOMS instead
5252
*/
5353
public const IMPORT_PRESENTATION_WITHANNOTATIONS_FROM_BREAKOUTROOMS = 'importPresentationWithAnnotationsFromBreakoutRooms';
5454

5555
/**
56-
* @deprecated Use Feature::IMPORT_SHARED_NOTES_FROM_BREAKOUT_ROOMS instead
56+
* @deprecated and will be removed in 6.0. Use Feature::IMPORT_SHARED_NOTES_FROM_BREAKOUT_ROOMS instead
5757
*/
5858
public const IMPORT_SHARED_NOTES_FROM_BREAKOUTROOMS = 'importSharedNotesFromBreakoutRooms';
5959
}

src/Enum/GuestPolicy.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/**
4+
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
5+
*
6+
* Copyright (c) 2016-2021 BigBlueButton Inc. and by respective authors (see below).
7+
*
8+
* This program is free software; you can redistribute it and/or modify it under the
9+
* terms of the GNU Lesser General Public License as published by the Free Software
10+
* Foundation; either version 3.0 of the License, or (at your option) any later
11+
* version.
12+
*
13+
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
14+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15+
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public License along
18+
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
namespace BigBlueButton\Enum;
22+
23+
/**
24+
* @psalm-immutable
25+
*/
26+
class GuestPolicy extends Enum
27+
{
28+
public const ALWAYS_ACCEPT = 'ALWAYS_ACCEPT';
29+
public const ALWAYS_DENY = 'ALWAYS_DENY';
30+
public const ASK_MODERATOR = 'ASK_MODERATOR';
31+
public const ALWAYS_ACCEPT_AUTH = 'ALWAYS_ACCEPT_AUTH';
32+
}

src/Enum/MeetingLayout.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/**
4+
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
5+
*
6+
* Copyright (c) 2016-2021 BigBlueButton Inc. and by respective authors (see below).
7+
*
8+
* This program is free software; you can redistribute it and/or modify it under the
9+
* terms of the GNU Lesser General Public License as published by the Free Software
10+
* Foundation; either version 3.0 of the License, or (at your option) any later
11+
* version.
12+
*
13+
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
14+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15+
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public License along
18+
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
namespace BigBlueButton\Enum;
22+
23+
/**
24+
* @psalm-immutable
25+
*/
26+
class MeetingLayout extends Enum
27+
{
28+
public const CUSTOM_LAYOUT = 'CUSTOM_LAYOUT';
29+
public const SMART_LAYOUT = 'SMART_LAYOUT';
30+
public const PRESENTATION_FOCUS = 'PRESENTATION_FOCUS';
31+
public const VIDEO_FOCUS = 'VIDEO_FOCUS';
32+
}

src/Parameters/CreateMeetingParameters.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace BigBlueButton\Parameters;
2121

22-
use BigBlueButton\Core\GuestPolicy;
22+
use BigBlueButton\Enum\GuestPolicy;
2323

2424
/**
2525
* @method string getName()
@@ -506,7 +506,7 @@ public function isBreakout(): ?bool
506506
}
507507

508508
/**
509-
* @deprecated use disabledFeatures instead
509+
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
510510
* Backwards compatibility for the old method name with the missing 's' at the end
511511
*/
512512
public function setLockSettingsDisableNote(bool $isLockSettingsDisableNote): self
@@ -517,7 +517,7 @@ public function setLockSettingsDisableNote(bool $isLockSettingsDisableNote): sel
517517
}
518518

519519
/**
520-
* @deprecated use disabledFeatures instead
520+
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
521521
* Backwards compatibility for the old method name with the missing 's' at the end
522522
*/
523523
public function isLockSettingsDisableNote(): bool
@@ -526,7 +526,7 @@ public function isLockSettingsDisableNote(): bool
526526
}
527527

528528
/**
529-
* @deprecated Use disabledFeatures instead
529+
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
530530
*/
531531
public function setLearningDashboardEnabled(bool $learningDashboardEnabled): self
532532
{
@@ -536,15 +536,15 @@ public function setLearningDashboardEnabled(bool $learningDashboardEnabled): sel
536536
}
537537

538538
/**
539-
* @deprecated Use disabledFeatures instead
539+
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
540540
*/
541541
public function isLearningDashboardEnabled(): bool
542542
{
543543
return $this->learningDashboardEnabled;
544544
}
545545

546546
/**
547-
* @deprecated Use disabledFeatures instead
547+
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
548548
*/
549549
public function setVirtualBackgroundsDisabled(bool $virtualBackgroundsDisabled): self
550550
{
@@ -554,15 +554,15 @@ public function setVirtualBackgroundsDisabled(bool $virtualBackgroundsDisabled):
554554
}
555555

556556
/**
557-
* @deprecated Use disabledFeatures instead
557+
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
558558
*/
559559
public function isVirtualBackgroundsDisabled(): bool
560560
{
561561
return $this->virtualBackgroundsDisabled;
562562
}
563563

564564
/**
565-
* @deprecated Use disabledFeatures instead
565+
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
566566
*/
567567
public function setBreakoutRoomsEnabled(bool $breakoutRoomsEnabled): self
568568
{
@@ -572,7 +572,7 @@ public function setBreakoutRoomsEnabled(bool $breakoutRoomsEnabled): self
572572
}
573573

574574
/**
575-
* @deprecated Use disabledFeatures instead
575+
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
576576
*/
577577
public function isBreakoutRoomsEnabled(): bool
578578
{

src/Parameters/JoinMeetingParameters.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@
5151
*/
5252
class JoinMeetingParameters extends UserDataParameters
5353
{
54-
public const MODERATOR = 'MODERATOR';
55-
public const VIEWER = 'VIEWER';
54+
/* @deprecated and will be removed in 6.0. Use BigBlueButton\Enum\Role::MODERATOR instead */
55+
public const MODERATOR = Role::MODERATOR;
56+
57+
/* @deprecated and will be removed in 6.0. Use BigBlueButton\Enum\Role::VIEWER instead */
58+
public const VIEWER = Role::VIEWER;
5659

5760
/**
5861
* @var string

0 commit comments

Comments
 (0)