Skip to content

Commit

Permalink
Move all enums to BigBlueButton\Enum namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelWei committed Apr 9, 2024
1 parent 7e55854 commit 69f46ef
Show file tree
Hide file tree
Showing 13 changed files with 158 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/BigBlueButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace BigBlueButton;

use BigBlueButton\Core\ApiMethod;
use BigBlueButton\Enum\ApiMethod;
use BigBlueButton\Enum\HashingAlgorithm;
use BigBlueButton\Exceptions\ConfigException;
use BigBlueButton\Exceptions\NetworkException;
Expand Down
35 changes: 17 additions & 18 deletions src/Core/ApiMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,23 @@

namespace BigBlueButton\Core;

/* @deprecated and will be removed in 6.0. Use \BigBlueButton\Enum\ApiMethod instead */
final class ApiMethod
{
public const CREATE = 'create';
public const JOIN = 'join';
public const ENTER = 'enter';
public const END = 'end';
public const IS_MEETING_RUNNING = 'isMeetingRunning';
public const GET_MEETING_INFO = 'getMeetingInfo';
public const GET_MEETINGS = 'getMeetings';
public const SIGN_OUT = 'signOut';
public const GET_RECORDINGS = 'getRecordings';
public const PUBLISH_RECORDINGS = 'publishRecordings';
public const DELETE_RECORDINGS = 'deleteRecordings';
public const UPDATE_RECORDINGS = 'updateRecordings';
public const GET_RECORDING_TEXT_TRACKS = 'getRecordingTextTracks';
public const PUT_RECORDING_TEXT_TRACK = 'putRecordingTextTrack';
public const HOOKS_CREATE = 'hooks/create';
public const HOOKS_LIST = 'hooks/list';
public const HOOKS_DESTROY = 'hooks/destroy';
public const INSERT_DOCUMENT = 'insertDocument';
public const CREATE = \BigBlueButton\Enum\ApiMethod::CREATE;
public const JOIN = \BigBlueButton\Enum\ApiMethod::JOIN;
public const END = \BigBlueButton\Enum\ApiMethod::END;
public const IS_MEETING_RUNNING = \BigBlueButton\Enum\ApiMethod::IS_MEETING_RUNNING;
public const GET_MEETING_INFO = \BigBlueButton\Enum\ApiMethod::GET_MEETING_INFO;
public const GET_MEETINGS = \BigBlueButton\Enum\ApiMethod::GET_MEETINGS;
public const GET_RECORDINGS = \BigBlueButton\Enum\ApiMethod::GET_RECORDINGS;
public const PUBLISH_RECORDINGS = \BigBlueButton\Enum\ApiMethod::PUBLISH_RECORDINGS;
public const DELETE_RECORDINGS = \BigBlueButton\Enum\ApiMethod::DELETE_RECORDINGS;
public const UPDATE_RECORDINGS = \BigBlueButton\Enum\ApiMethod::UPDATE_RECORDINGS;
public const GET_RECORDING_TEXT_TRACKS = \BigBlueButton\Enum\ApiMethod::GET_RECORDING_TEXT_TRACKS;
public const PUT_RECORDING_TEXT_TRACK = \BigBlueButton\Enum\ApiMethod::PUT_RECORDING_TEXT_TRACK;
public const HOOKS_CREATE = \BigBlueButton\Enum\ApiMethod::HOOKS_CREATE;
public const HOOKS_LIST = \BigBlueButton\Enum\ApiMethod::HOOKS_LIST;
public const HOOKS_DESTROY = \BigBlueButton\Enum\ApiMethod::HOOKS_DESTROY;
public const INSERT_DOCUMENT = \BigBlueButton\Enum\ApiMethod::INSERT_DOCUMENT;
}
9 changes: 5 additions & 4 deletions src/Core/GuestPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@

namespace BigBlueButton\Core;

/* @deprecated and will be removed in 6.0. Use \BigBlueButton\Enum\GuestPolicy instead */
final class GuestPolicy
{
public const ALWAYS_ACCEPT = 'ALWAYS_ACCEPT';
public const ALWAYS_DENY = 'ALWAYS_DENY';
public const ASK_MODERATOR = 'ASK_MODERATOR';
public const ALWAYS_ACCEPT_AUTH = 'ALWAYS_ACCEPT_AUTH';
public const ALWAYS_ACCEPT = \BigBlueButton\Enum\GuestPolicy::ALWAYS_ACCEPT;
public const ALWAYS_DENY = \BigBlueButton\Enum\GuestPolicy::ALWAYS_DENY;
public const ASK_MODERATOR = \BigBlueButton\Enum\GuestPolicy::ASK_MODERATOR;
public const ALWAYS_ACCEPT_AUTH = \BigBlueButton\Enum\GuestPolicy::ALWAYS_ACCEPT_AUTH;
}
9 changes: 5 additions & 4 deletions src/Core/MeetingLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@

namespace BigBlueButton\Core;

/* @deprecated Use \BigBlueButton\Enum\MeetingLayout instead */
final class MeetingLayout
{
public const CUSTOM_LAYOUT = 'CUSTOM_LAYOUT';
public const SMART_LAYOUT = 'SMART_LAYOUT';
public const PRESENTATION_FOCUS = 'PRESENTATION_FOCUS';
public const VIDEO_FOCUS = 'VIDEO_FOCUS';
public const CUSTOM_LAYOUT = \BigBlueButton\Enum\MeetingLayout::CUSTOM_LAYOUT;
public const SMART_LAYOUT = \BigBlueButton\Enum\MeetingLayout::SMART_LAYOUT;
public const PRESENTATION_FOCUS = \BigBlueButton\Enum\MeetingLayout::PRESENTATION_FOCUS;
public const VIDEO_FOCUS = \BigBlueButton\Enum\MeetingLayout::VIDEO_FOCUS;
}
46 changes: 46 additions & 0 deletions src/Enum/ApiMethod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

/**
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
*
* Copyright (c) 2016-2018 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*/

namespace BigBlueButton\Enum;

/**
* @psalm-immutable
*/
class ApiMethod extends Enum
{
public const CREATE = 'create';
public const JOIN = 'join';
public const ENTER = 'enter';
public const END = 'end';
public const IS_MEETING_RUNNING = 'isMeetingRunning';
public const GET_MEETING_INFO = 'getMeetingInfo';
public const GET_MEETINGS = 'getMeetings';
public const SIGN_OUT = 'signOut';
public const GET_RECORDINGS = 'getRecordings';
public const PUBLISH_RECORDINGS = 'publishRecordings';
public const DELETE_RECORDINGS = 'deleteRecordings';
public const UPDATE_RECORDINGS = 'updateRecordings';
public const GET_RECORDING_TEXT_TRACKS = 'getRecordingTextTracks';
public const PUT_RECORDING_TEXT_TRACK = 'putRecordingTextTrack';
public const HOOKS_CREATE = 'hooks/create';
public const HOOKS_LIST = 'hooks/list';
public const HOOKS_DESTROY = 'hooks/destroy';
public const INSERT_DOCUMENT = 'insertDocument';
}
4 changes: 2 additions & 2 deletions src/Enum/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ class Feature extends Enum
public const TIMER = 'timer';

/**
* @deprecated Use Feature::IMPORT_PRESENTATION_WITH_ANNOTATIONS_FROM_BREAKOUT_ROOMS instead
* @deprecated and will be removed in 6.0. Use Feature::IMPORT_PRESENTATION_WITH_ANNOTATIONS_FROM_BREAKOUT_ROOMS instead
*/
public const IMPORT_PRESENTATION_WITHANNOTATIONS_FROM_BREAKOUTROOMS = 'importPresentationWithAnnotationsFromBreakoutRooms';

/**
* @deprecated Use Feature::IMPORT_SHARED_NOTES_FROM_BREAKOUT_ROOMS instead
* @deprecated and will be removed in 6.0. Use Feature::IMPORT_SHARED_NOTES_FROM_BREAKOUT_ROOMS instead
*/
public const IMPORT_SHARED_NOTES_FROM_BREAKOUTROOMS = 'importSharedNotesFromBreakoutRooms';
}
32 changes: 32 additions & 0 deletions src/Enum/GuestPolicy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

/**
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
*
* Copyright (c) 2016-2021 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*/

namespace BigBlueButton\Enum;

/**
* @psalm-immutable
*/
class GuestPolicy extends Enum
{
public const ALWAYS_ACCEPT = 'ALWAYS_ACCEPT';
public const ALWAYS_DENY = 'ALWAYS_DENY';
public const ASK_MODERATOR = 'ASK_MODERATOR';
public const ALWAYS_ACCEPT_AUTH = 'ALWAYS_ACCEPT_AUTH';
}
32 changes: 32 additions & 0 deletions src/Enum/MeetingLayout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

/**
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
*
* Copyright (c) 2016-2021 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*/

namespace BigBlueButton\Enum;

/**
* @psalm-immutable
*/
class MeetingLayout extends Enum
{
public const CUSTOM_LAYOUT = 'CUSTOM_LAYOUT';
public const SMART_LAYOUT = 'SMART_LAYOUT';
public const PRESENTATION_FOCUS = 'PRESENTATION_FOCUS';
public const VIDEO_FOCUS = 'VIDEO_FOCUS';
}
18 changes: 9 additions & 9 deletions src/Parameters/CreateMeetingParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace BigBlueButton\Parameters;

use BigBlueButton\Core\GuestPolicy;
use BigBlueButton\Enum\GuestPolicy;

/**
* @method string getName()
Expand Down Expand Up @@ -506,7 +506,7 @@ public function isBreakout(): ?bool
}

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

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

/**
* @deprecated Use disabledFeatures instead
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
*/
public function setLearningDashboardEnabled(bool $learningDashboardEnabled): self
{
Expand All @@ -536,15 +536,15 @@ public function setLearningDashboardEnabled(bool $learningDashboardEnabled): sel
}

/**
* @deprecated Use disabledFeatures instead
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
*/
public function isLearningDashboardEnabled(): bool
{
return $this->learningDashboardEnabled;
}

/**
* @deprecated Use disabledFeatures instead
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
*/
public function setVirtualBackgroundsDisabled(bool $virtualBackgroundsDisabled): self
{
Expand All @@ -554,15 +554,15 @@ public function setVirtualBackgroundsDisabled(bool $virtualBackgroundsDisabled):
}

/**
* @deprecated Use disabledFeatures instead
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
*/
public function isVirtualBackgroundsDisabled(): bool
{
return $this->virtualBackgroundsDisabled;
}

/**
* @deprecated Use disabledFeatures instead
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
*/
public function setBreakoutRoomsEnabled(bool $breakoutRoomsEnabled): self
{
Expand All @@ -572,7 +572,7 @@ public function setBreakoutRoomsEnabled(bool $breakoutRoomsEnabled): self
}

/**
* @deprecated Use disabledFeatures instead
* @deprecated and will be removed in 6.0. Use disabledFeatures instead
*/
public function isBreakoutRoomsEnabled(): bool
{
Expand Down
7 changes: 5 additions & 2 deletions src/Parameters/JoinMeetingParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@
*/
class JoinMeetingParameters extends UserDataParameters
{
public const MODERATOR = 'MODERATOR';
public const VIEWER = 'VIEWER';
/* @deprecated and will be removed in 6.0. Use BigBlueButton\Enum\Role::MODERATOR instead */
public const MODERATOR = Role::MODERATOR;

/* @deprecated and will be removed in 6.0. Use BigBlueButton\Enum\Role::VIEWER instead */
public const VIEWER = Role::VIEWER;

/**
* @var string
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

namespace BigBlueButton;

use BigBlueButton\Core\GuestPolicy;
use BigBlueButton\Core\MeetingLayout;
use BigBlueButton\Enum\Feature;
use BigBlueButton\Enum\GuestPolicy;
use BigBlueButton\Enum\MeetingLayout;
use BigBlueButton\Enum\Role;
use BigBlueButton\Parameters\CreateMeetingParameters;
use BigBlueButton\Parameters\EndMeetingParameters;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/BigBlueButtonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace BigBlueButton;

use BigBlueButton\Core\ApiMethod;
use BigBlueButton\Enum\ApiMethod;
use BigBlueButton\Enum\HashingAlgorithm;
use BigBlueButton\Exceptions\ConfigException;
use BigBlueButton\Exceptions\NetworkException;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Parameters/CreateMeetingParametersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

namespace BigBlueButton\Parameters;

use BigBlueButton\Core\GuestPolicy;
use BigBlueButton\Enum\Feature;
use BigBlueButton\Enum\GuestPolicy;
use BigBlueButton\TestCase;

/**
Expand Down

0 comments on commit 69f46ef

Please sign in to comment.