Skip to content

Commit 3f1466c

Browse files
authored
Merge pull request #82 from FelixJacobi/add-parameter-typehints
Added parameter typehints where possible
2 parents adc30ee + 8bbed88 commit 3f1466c

38 files changed

Lines changed: 411 additions & 389 deletions

src/BigBlueButton.php

Lines changed: 97 additions & 105 deletions
Large diffs are not rendered by default.

src/Core/ApiMethod.php

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,40 @@
1818
*/
1919
namespace BigBlueButton\Core;
2020

21-
abstract class ApiMethod
21+
/**
22+
* @final since 4.0.
23+
*/
24+
class ApiMethod
2225
{
23-
const CREATE = 'create';
24-
const JOIN = 'join';
25-
const ENTER = 'enter';
26-
const END = 'end';
27-
const IS_MEETING_RUNNING = 'isMeetingRunning';
28-
const GET_MEETING_INFO = 'getMeetingInfo';
29-
const GET_MEETINGS = 'getMeetings';
26+
public const CREATE = 'create';
27+
public const JOIN = 'join';
28+
public const ENTER = 'enter';
29+
public const END = 'end';
30+
public const IS_MEETING_RUNNING = 'isMeetingRunning';
31+
public const GET_MEETING_INFO = 'getMeetingInfo';
32+
public const GET_MEETINGS = 'getMeetings';
3033
/**
3134
* @deprecated since 4.0 and will be removed in 4.1. The getDefaultConfigXML API was related to the old Flash client which is no longer available since BigBlueButton 2.2. In BigBlueButton 2.3 the whole API call was removed.
3235
*/
33-
const GET_DEFAULT_CONFIG_XML = 'getDefaultConfigXML';
36+
public const GET_DEFAULT_CONFIG_XML = 'getDefaultConfigXML';
3437
/**
3538
* @deprecated since 4.0 and will be removed in 4.1. The setConfigXML API was related to the old Flash client which is no longer available since BigBlueButton 2.2. In BigBlueButton 2.3 the whole API call was removed.
3639
*/
37-
const SET_CONFIG_XML = 'setConfigXML';
40+
public const SET_CONFIG_XML = 'setConfigXML';
3841
/**
3942
* Note: Unused in the whole project.
4043
*
4144
* @deprecated since 4.0 and will be removed in 4.1. The configXML API was related to the old Flash client which is no longer available since BigBlueButton 2.2. In BigBlueButton 2.3 the whole API call was removed.
4245
*/
43-
const CONFIG_XML = 'configXML';
44-
const SIGN_OUT = 'signOut';
45-
const GET_RECORDINGS = 'getRecordings';
46-
const PUBLISH_RECORDINGS = 'publishRecordings';
47-
const DELETE_RECORDINGS = 'deleteRecordings';
48-
const UPDATE_RECORDINGS = 'updateRecordings';
49-
const GET_RECORDING_TEXT_TRACKS = 'getRecordingTextTracks';
50-
const PUT_RECORDING_TEXT_TRACK = 'putRecordingTextTrack';
51-
const HOOKS_CREATE = 'hooks/create';
52-
const HOOKS_LIST = 'hooks/list';
53-
const HOOKS_DESTROY = 'hooks/destroy';
46+
public const CONFIG_XML = 'configXML';
47+
public const SIGN_OUT = 'signOut';
48+
public const GET_RECORDINGS = 'getRecordings';
49+
public const PUBLISH_RECORDINGS = 'publishRecordings';
50+
public const DELETE_RECORDINGS = 'deleteRecordings';
51+
public const UPDATE_RECORDINGS = 'updateRecordings';
52+
public const GET_RECORDING_TEXT_TRACKS = 'getRecordingTextTracks';
53+
public const PUT_RECORDING_TEXT_TRACK = 'putRecordingTextTrack';
54+
public const HOOKS_CREATE = 'hooks/create';
55+
public const HOOKS_LIST = 'hooks/list';
56+
public const HOOKS_DESTROY = 'hooks/destroy';
5457
}

src/Core/Attendee.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ class Attendee
6565
*/
6666
private $clientType;
6767

68-
/**
69-
* Attendee constructor.
70-
* @param $xml \SimpleXMLElement
71-
*/
72-
public function __construct($xml)
68+
public function __construct(\SimpleXMLElement $xml)
7369
{
7470
$this->userId = $xml->userID->__toString();
7571
$this->fullName = $xml->fullName->__toString();

src/Core/Hook.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ class Hook
5656
*/
5757
private $rawData;
5858

59-
/**
60-
* Meeting constructor.
61-
* @param $xml \SimpleXMLElement
62-
*/
63-
public function __construct($xml)
59+
public function __construct(\SimpleXMLElement $xml)
6460
{
6561
$this->rawXml = $xml;
6662
$this->hookId = (int) $xml->hookID->__toString();

src/Core/Meeting.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,7 @@ class Meeting
156156
*/
157157
private $isBreakout;
158158

159-
/**
160-
* Meeting constructor.
161-
* @param $xml \SimpleXMLElement
162-
*/
163-
public function __construct($xml)
159+
public function __construct(\SimpleXMLElement $xml)
164160
{
165161
$this->rawXml = $xml;
166162
$this->meetingId = $xml->meetingID->__toString();

src/Core/Record.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ class Record
3737
private $playbackLength;
3838
private $metas;
3939

40-
/**
41-
* Record constructor.
42-
* @param $xml \SimpleXMLElement
43-
*/
44-
public function __construct($xml)
40+
public function __construct(\SimpleXMLElement $xml)
4541
{
4642
$this->recordId = $xml->recordID->__toString();
4743
$this->meetingId = $xml->meetingID->__toString();

src/Core/Track.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,7 @@ class Track
4949
*/
5050
private $source;
5151

52-
/**
53-
* Track constructor.
54-
*
55-
* @param $track
56-
*/
57-
public function __construct($track)
52+
public function __construct(object $track)
5853
{
5954
$this->href = $track->href;
6055
$this->kind = $track->kind;

src/Exceptions/BaseException.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
11
<?php
22

3+
declare(strict_types=1);
4+
5+
/**
6+
* This file is part of littleredbutton/bigbluebutton-api-php.
7+
*
8+
* littleredbutton/bigbluebutton-api-php is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Lesser General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* littleredbutton/bigbluebutton-api-php is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public License
19+
* along with littleredbutton/bigbluebutton-api-php. If not, see <http://www.gnu.org/licenses/>.
20+
*/
321
namespace BigBlueButton\Exceptions;
422

523
use Exception;
624

25+
/**
26+
* @abstract since 4.0.
27+
*/
728
class BaseException extends Exception
829
{
930
}

src/Exceptions/ConfigException.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
<?php
22

3+
declare(strict_types=1);
4+
5+
/**
6+
* This file is part of littleredbutton/bigbluebutton-api-php.
7+
*
8+
* littleredbutton/bigbluebutton-api-php is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Lesser General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* littleredbutton/bigbluebutton-api-php is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public License
19+
* along with littleredbutton/bigbluebutton-api-php. If not, see <http://www.gnu.org/licenses/>.
20+
*/
321
namespace BigBlueButton\Exceptions;
422

23+
/**
24+
* @final since 4.0.
25+
*/
526
class ConfigException extends BaseException
627
{
728
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
<?php
22

3+
declare(strict_types=1);
4+
5+
/**
6+
* This file is part of littleredbutton/bigbluebutton-api-php.
7+
*
8+
* littleredbutton/bigbluebutton-api-php is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Lesser General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* littleredbutton/bigbluebutton-api-php is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public License
19+
* along with littleredbutton/bigbluebutton-api-php. If not, see <http://www.gnu.org/licenses/>.
20+
*/
321
namespace BigBlueButton\Exceptions;
422

23+
/**
24+
* @final since 4.0.
25+
*/
526
class NetworkException extends BaseException
627
{
728
}

0 commit comments

Comments
 (0)