Skip to content

Commit 0ad602d

Browse files
authored
Merge pull request #220 from DigitalTimK/bugfix/meetinginfo
Transform to php74 (cont'd)
2 parents 101097b + 5a20a6d commit 0ad602d

12 files changed

+30
-102
lines changed

src/Parameters/BaseParameters.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,12 @@
2525
*/
2626
abstract class BaseParameters
2727
{
28-
/**
29-
* @return string
30-
*/
31-
abstract public function getHTTPQuery();
28+
abstract public function getHTTPQuery(): string;
3229

3330
/**
3431
* @param mixed $array
35-
*
36-
* @return string
3732
*/
38-
protected function buildHTTPQuery($array)
33+
protected function buildHTTPQuery($array): string
3934
{
4035
return str_replace(['%20', '!', "'", '(', ')', '*'], ['+', '%21', '%27', '%28', '%29', '%2A'], http_build_query(array_filter($array), '', '&', \PHP_QUERY_RFC3986));
4136
}

src/Responses/ApiVersionResponse.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,17 @@
2525
*/
2626
class ApiVersionResponse extends BaseResponse
2727
{
28-
/**
29-
* @return string
30-
*/
31-
public function getVersion()
28+
public function getVersion(): string
3229
{
3330
return $this->rawXml->version->__toString();
3431
}
3532

36-
/**
37-
* @return string
38-
*/
39-
public function getApiVersion()
33+
public function getApiVersion(): string
4034
{
4135
return $this->rawXml->apiVersion->__toString();
4236
}
4337

44-
/**
45-
* @return string
46-
*/
47-
public function getBbbVersion()
38+
public function getBbbVersion(): string
4839
{
4940
return $this->rawXml->bbbVersion->__toString();
5041
}

src/Responses/BaseJsonResponse.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ public function getRawJson()
4646
return json_encode($this->data);
4747
}
4848

49-
/**
50-
* @return null|mixed
51-
*/
52-
public function getMessage()
49+
public function getMessage(): ?string
5350
{
5451
if ($this->failed()) {
5552
return $this->data->response->message;
@@ -58,10 +55,7 @@ public function getMessage()
5855
return null;
5956
}
6057

61-
/**
62-
* @return null|mixed
63-
*/
64-
public function getMessageKey()
58+
public function getMessageKey(): ?string
6559
{
6660
if ($this->failed()) {
6761
return $this->data->response->messageKey;
@@ -71,9 +65,11 @@ public function getMessageKey()
7165
}
7266

7367
/**
74-
* @return mixed
68+
* Return will be either 'SUCCESS' or 'FAILED' (nothing else).
69+
*
70+
* @see: https://docs.bigbluebutton.org/development/api/#api-calls
7571
*/
76-
public function getReturnCode()
72+
public function getReturnCode(): string
7773
{
7874
return $this->data->response->returncode;
7975
}

src/Responses/DeleteRecordingsResponse.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@
2525
*/
2626
class DeleteRecordingsResponse extends BaseResponse
2727
{
28-
/**
29-
* @return null|bool
30-
*/
31-
public function isDeleted()
28+
public function isDeleted(): bool
3229
{
33-
return 'true' == $this->rawXml->deleted->__toString();
30+
return 'true' === $this->rawXml->deleted->__toString();
3431
}
3532
}

src/Responses/GetMeetingInfoResponse.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,8 @@
2727
*/
2828
class GetMeetingInfoResponse extends BaseResponse
2929
{
30-
/**
31-
* @var Meeting
32-
*/
33-
private $meeting;
34-
35-
/**
36-
* @return Meeting
37-
*/
38-
public function getMeeting()
30+
public function getMeeting(): Meeting
3931
{
40-
if (null === $this->meeting) {
41-
$this->meeting = new Meeting($this->rawXml);
42-
}
43-
44-
return $this->meeting;
32+
return new Meeting($this->rawXml);
4533
}
4634
}

src/Responses/HooksCreateResponse.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,17 @@
2525
*/
2626
class HooksCreateResponse extends BaseResponse
2727
{
28-
/**
29-
* @return int
30-
*/
31-
public function getHookId()
28+
public function getHookId(): int
3229
{
3330
return (int) $this->rawXml->hookID->__toString();
3431
}
3532

36-
/**
37-
* @return null|bool
38-
*/
39-
public function isPermanentHook()
33+
public function isPermanentHook(): bool
4034
{
4135
return 'true' === $this->rawXml->permanentHook->__toString();
4236
}
4337

44-
/**
45-
* @return null|bool
46-
*/
47-
public function hasRawData()
38+
public function hasRawData(): bool
4839
{
4940
return 'true' === $this->rawXml->rawData->__toString();
5041
}

src/Responses/HooksDestroyResponse.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
*/
2626
class HooksDestroyResponse extends BaseResponse
2727
{
28-
/**
29-
* @return null|bool
30-
*/
31-
public function removed()
28+
public function removed(): bool
3229
{
3330
return 'true' === $this->rawXml->removed->__toString();
3431
}

src/Responses/IsMeetingRunningResponse.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
*/
2626
class IsMeetingRunningResponse extends BaseResponse
2727
{
28-
/**
29-
* @return null|bool
30-
*/
31-
public function isRunning()
28+
public function isRunning(): bool
3229
{
3330
return 'true' === $this->rawXml->running->__toString();
3431
}

src/Responses/JoinMeetingResponse.php

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,50 +25,32 @@
2525
*/
2626
class JoinMeetingResponse extends BaseResponse
2727
{
28-
/**
29-
* @return string
30-
*/
31-
public function getMeetingId()
28+
public function getMeetingId(): string
3229
{
3330
return $this->rawXml->meeting_id->__toString();
3431
}
3532

36-
/**
37-
* @return string
38-
*/
39-
public function getUserId()
33+
public function getUserId(): string
4034
{
4135
return $this->rawXml->user_id->__toString();
4236
}
4337

44-
/**
45-
* @return string
46-
*/
47-
public function getAuthToken()
38+
public function getAuthToken(): string
4839
{
4940
return $this->rawXml->auth_token->__toString();
5041
}
5142

52-
/**
53-
* @return string
54-
*/
55-
public function getSessionToken()
43+
public function getSessionToken(): string
5644
{
5745
return $this->rawXml->session_token->__toString();
5846
}
5947

60-
/**
61-
* @return string
62-
*/
63-
public function getGuestStatus()
48+
public function getGuestStatus(): string
6449
{
6550
return $this->rawXml->guestStatus->__toString();
6651
}
6752

68-
/**
69-
* @return string
70-
*/
71-
public function getUrl()
53+
public function getUrl(): string
7254
{
7355
return $this->rawXml->url->__toString();
7456
}

src/Responses/PublishRecordingsResponse.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
*/
2626
class PublishRecordingsResponse extends BaseResponse
2727
{
28-
/**
29-
* @return null|bool
30-
*/
31-
public function isPublished()
28+
public function isPublished(): bool
3229
{
3330
return 'true' === $this->rawXml->published->__toString();
3431
}

0 commit comments

Comments
 (0)