Skip to content

Commit 62dcbe1

Browse files
committed
Merge branch 'master' into 5.0
2 parents cedd8ee + ea8c6fa commit 62dcbe1

File tree

117 files changed

+1151
-1159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+1151
-1159
lines changed

.php-cs-fixer.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
// Invoke the config easily with `php-cs-fixer fix`
4+
5+
$finder = \PhpCsFixer\Finder::create()
6+
->files()
7+
->name('*.php')
8+
->in(__DIR__ . '/src')
9+
->in(__DIR__ . '/tests');
10+
11+
$config = new PhpCsFixer\Config();
12+
13+
return $config
14+
->setUsingCache(false)
15+
->setRules([
16+
'@Symfony' => true,
17+
'@Symfony:risky' => true,
18+
'yoda_style' => false,
19+
'single_line_throw' => false,
20+
'increment_style' => false,
21+
])
22+
->setRiskyAllowed(true)
23+
->setFinder($finder);

.php_cs

Lines changed: 0 additions & 54 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"fakerphp/faker": "^1.14"
128128
}
129129
},
130-
"friendsofphp/php-cs-fixer": "^3.7",
130+
"friendsofphp/php-cs-fixer": "^3.3",
131131
"php-coveralls/php-coveralls": "^2.4",
132132
"phpunit/phpunit": "^8",
133133
"vimeo/psalm": "^4.22"

src/BigBlueButton.php

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
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+
1920
namespace BigBlueButton;
2021

2122
use BigBlueButton\Core\ApiMethod;
@@ -32,13 +33,13 @@
3233
use BigBlueButton\Parameters\GetMeetingInfoParameters;
3334
use BigBlueButton\Parameters\GetRecordingsParameters;
3435
use BigBlueButton\Parameters\GetRecordingTextTracksParameters;
35-
use BigBlueButton\Parameters\PutRecordingTextTrackParameters;
3636
use BigBlueButton\Parameters\HooksCreateParameters;
3737
use BigBlueButton\Parameters\HooksDestroyParameters;
3838
use BigBlueButton\Parameters\InsertDocumentParameters;
3939
use BigBlueButton\Parameters\IsMeetingRunningParameters;
4040
use BigBlueButton\Parameters\JoinMeetingParameters;
4141
use BigBlueButton\Parameters\PublishRecordingsParameters;
42+
use BigBlueButton\Parameters\PutRecordingTextTrackParameters;
4243
use BigBlueButton\Parameters\UpdateRecordingsParameters;
4344
use BigBlueButton\Responses\ApiVersionResponse;
4445
use BigBlueButton\Responses\CreateMeetingResponse;
@@ -48,27 +49,27 @@
4849
use BigBlueButton\Responses\GetMeetingsResponse;
4950
use BigBlueButton\Responses\GetRecordingsResponse;
5051
use BigBlueButton\Responses\GetRecordingTextTracksResponse;
51-
use BigBlueButton\Responses\PutRecordingTextTrackResponse;
5252
use BigBlueButton\Responses\HooksCreateResponse;
5353
use BigBlueButton\Responses\HooksDestroyResponse;
5454
use BigBlueButton\Responses\HooksListResponse;
5555
use BigBlueButton\Responses\InsertDocumentResponse;
5656
use BigBlueButton\Responses\IsMeetingRunningResponse;
5757
use BigBlueButton\Responses\JoinMeetingResponse;
5858
use BigBlueButton\Responses\PublishRecordingsResponse;
59+
use BigBlueButton\Responses\PutRecordingTextTrackResponse;
5960
use BigBlueButton\Responses\UpdateRecordingsResponse;
6061
use BigBlueButton\Util\UrlBuilder;
6162
use SimpleXMLElement;
6263

6364
/**
64-
* Class BigBlueButton
65+
* Class BigBlueButton.
66+
*
6567
* @final since 4.0.
66-
* @package BigBlueButton
6768
*/
6869
class 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

src/Core/ApiMethod.php

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,27 @@
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+
1920
namespace BigBlueButton\Core;
2021

2122
final class ApiMethod
2223
{
23-
public const CREATE = 'create';
24-
public const JOIN = 'join';
25-
public const ENTER = 'enter';
26-
public const END = 'end';
27-
public const IS_MEETING_RUNNING = 'isMeetingRunning';
28-
public const GET_MEETING_INFO = 'getMeetingInfo';
29-
public const GET_MEETINGS = 'getMeetings';
30-
public const SIGN_OUT = 'signOut';
31-
public const GET_RECORDINGS = 'getRecordings';
32-
public const PUBLISH_RECORDINGS = 'publishRecordings';
33-
public const DELETE_RECORDINGS = 'deleteRecordings';
34-
public const UPDATE_RECORDINGS = 'updateRecordings';
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';
3536
public const GET_RECORDING_TEXT_TRACKS = 'getRecordingTextTracks';
36-
public const PUT_RECORDING_TEXT_TRACK = 'putRecordingTextTrack';
37-
public const HOOKS_CREATE = 'hooks/create';
38-
public const HOOKS_LIST = 'hooks/list';
39-
public const HOOKS_DESTROY = 'hooks/destroy';
40-
public const INSERT_DOCUMENT = 'insertDocument';
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';
4142
}

0 commit comments

Comments
 (0)