From bb616e6fb6227c69a404d4956150f7830623a908 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 17 May 2023 15:15:00 -0400 Subject: [PATCH] Add return types to the implemented functions --- .gitignore | 3 ++- src/Messaging/Models/BandwidthCallbackMessage.php | 2 +- src/Messaging/Models/BandwidthMessage.php | 2 +- src/Messaging/Models/BandwidthMessageItem.php | 2 +- src/Messaging/Models/BandwidthMessagesList.php | 2 +- src/Messaging/Models/DeferredResult.php | 2 +- src/Messaging/Models/Media.php | 2 +- src/Messaging/Models/MessageRequest.php | 2 +- src/Messaging/Models/PageInfo.php | 2 +- src/Messaging/Models/Tag.php | 2 +- src/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.php | 2 +- src/MultiFactorAuth/Models/TwoFactorMessagingResponse.php | 2 +- src/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.php | 2 +- src/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.php | 2 +- src/MultiFactorAuth/Models/TwoFactorVoiceResponse.php | 2 +- src/Voice/Models/CallCallback.php | 2 +- src/Voice/Models/CallRecordingMetadata.php | 2 +- src/Voice/Models/CallState.php | 2 +- src/Voice/Models/ConferenceCallback.php | 2 +- src/Voice/Models/ConferenceMemberState.php | 2 +- src/Voice/Models/ConferenceRecordingMetadata.php | 2 +- src/Voice/Models/ConferenceState.php | 2 +- src/Voice/Models/CreateCallRequest.php | 2 +- src/Voice/Models/CreateCallResponse.php | 2 +- src/Voice/Models/Diversion.php | 2 +- src/Voice/Models/MachineDetectionConfiguration.php | 2 +- src/Voice/Models/ModifyCallRecordingRequest.php | 2 +- src/Voice/Models/ModifyCallRequest.php | 2 +- src/Voice/Models/ModifyConferenceRequest.php | 2 +- src/Voice/Models/TranscribeRecordingRequest.php | 2 +- src/Voice/Models/Transcript.php | 2 +- src/Voice/Models/Transcription.php | 2 +- src/Voice/Models/TranscriptionMetadata.php | 2 +- src/Voice/Models/TranscriptionResponse.php | 2 +- src/WebRtc/Models/AccountsParticipantsResponse.php | 2 +- src/WebRtc/Models/Participant.php | 2 +- src/WebRtc/Models/ParticipantSubscription.php | 2 +- src/WebRtc/Models/Session.php | 2 +- src/WebRtc/Models/Subscriptions.php | 2 +- tests/ApiTest.php | 4 ++-- 40 files changed, 42 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 4fa7f9b..8cb8bd3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ vendor composer.lock .phpunit.result.cache -composer.phar \ No newline at end of file +composer.phar +.idea diff --git a/src/Messaging/Models/BandwidthCallbackMessage.php b/src/Messaging/Models/BandwidthCallbackMessage.php index 8f4fe13..ca22d91 100644 --- a/src/Messaging/Models/BandwidthCallbackMessage.php +++ b/src/Messaging/Models/BandwidthCallbackMessage.php @@ -66,7 +66,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['time'] = $this->time; diff --git a/src/Messaging/Models/BandwidthMessage.php b/src/Messaging/Models/BandwidthMessage.php index 4271f6c..2e0bc0c 100644 --- a/src/Messaging/Models/BandwidthMessage.php +++ b/src/Messaging/Models/BandwidthMessage.php @@ -111,7 +111,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['id'] = $this->id; diff --git a/src/Messaging/Models/BandwidthMessageItem.php b/src/Messaging/Models/BandwidthMessageItem.php index c310763..2165544 100644 --- a/src/Messaging/Models/BandwidthMessageItem.php +++ b/src/Messaging/Models/BandwidthMessageItem.php @@ -136,7 +136,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['messageId'] = $this->messageId; diff --git a/src/Messaging/Models/BandwidthMessagesList.php b/src/Messaging/Models/BandwidthMessagesList.php index 75362bc..8b4dc44 100644 --- a/src/Messaging/Models/BandwidthMessagesList.php +++ b/src/Messaging/Models/BandwidthMessagesList.php @@ -45,7 +45,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['totalCount'] = $this->totalCount; diff --git a/src/Messaging/Models/DeferredResult.php b/src/Messaging/Models/DeferredResult.php index 527c3ef..70c71d7 100644 --- a/src/Messaging/Models/DeferredResult.php +++ b/src/Messaging/Models/DeferredResult.php @@ -38,7 +38,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['result'] = $this->result; diff --git a/src/Messaging/Models/Media.php b/src/Messaging/Models/Media.php index 659850f..942cd45 100644 --- a/src/Messaging/Models/Media.php +++ b/src/Messaging/Models/Media.php @@ -45,7 +45,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['content'] = $this->content; diff --git a/src/Messaging/Models/MessageRequest.php b/src/Messaging/Models/MessageRequest.php index 258fecd..08ddbc9 100644 --- a/src/Messaging/Models/MessageRequest.php +++ b/src/Messaging/Models/MessageRequest.php @@ -78,7 +78,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['applicationId'] = $this->applicationId; diff --git a/src/Messaging/Models/PageInfo.php b/src/Messaging/Models/PageInfo.php index af9587e..2250bf7 100644 --- a/src/Messaging/Models/PageInfo.php +++ b/src/Messaging/Models/PageInfo.php @@ -52,7 +52,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['prevPage'] = $this->prevPage; diff --git a/src/Messaging/Models/Tag.php b/src/Messaging/Models/Tag.php index 6c51d90..87d0a01 100644 --- a/src/Messaging/Models/Tag.php +++ b/src/Messaging/Models/Tag.php @@ -38,7 +38,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['key'] = $this->key; diff --git a/src/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.php b/src/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.php index 1d8e0ee..4d93710 100644 --- a/src/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.php +++ b/src/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.php @@ -76,7 +76,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['to'] = $this->to; diff --git a/src/MultiFactorAuth/Models/TwoFactorMessagingResponse.php b/src/MultiFactorAuth/Models/TwoFactorMessagingResponse.php index d68e75e..3ffe87b 100644 --- a/src/MultiFactorAuth/Models/TwoFactorMessagingResponse.php +++ b/src/MultiFactorAuth/Models/TwoFactorMessagingResponse.php @@ -31,7 +31,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['messageId'] = $this->messageId; diff --git a/src/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.php b/src/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.php index d4275e6..d689f81 100644 --- a/src/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.php +++ b/src/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.php @@ -31,7 +31,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['valid'] = $this->valid; diff --git a/src/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.php b/src/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.php index 984a75e..ac2b654 100644 --- a/src/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.php +++ b/src/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.php @@ -66,7 +66,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['to'] = $this->to; diff --git a/src/MultiFactorAuth/Models/TwoFactorVoiceResponse.php b/src/MultiFactorAuth/Models/TwoFactorVoiceResponse.php index 25bf261..c8f4b69 100644 --- a/src/MultiFactorAuth/Models/TwoFactorVoiceResponse.php +++ b/src/MultiFactorAuth/Models/TwoFactorVoiceResponse.php @@ -31,7 +31,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['callId'] = $this->callId; diff --git a/src/Voice/Models/CallCallback.php b/src/Voice/Models/CallCallback.php index c21f2dd..4401a50 100644 --- a/src/Voice/Models/CallCallback.php +++ b/src/Voice/Models/CallCallback.php @@ -235,7 +235,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['eventType'] = $this->eventType; diff --git a/src/Voice/Models/CallRecordingMetadata.php b/src/Voice/Models/CallRecordingMetadata.php index 139e67b..cd65992 100644 --- a/src/Voice/Models/CallRecordingMetadata.php +++ b/src/Voice/Models/CallRecordingMetadata.php @@ -156,7 +156,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['applicationId'] = $this->applicationId; diff --git a/src/Voice/Models/CallState.php b/src/Voice/Models/CallState.php index 08e2e54..6a6540e 100644 --- a/src/Voice/Models/CallState.php +++ b/src/Voice/Models/CallState.php @@ -162,7 +162,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['callId'] = $this->callId; diff --git a/src/Voice/Models/ConferenceCallback.php b/src/Voice/Models/ConferenceCallback.php index 7fab464..840f012 100644 --- a/src/Voice/Models/ConferenceCallback.php +++ b/src/Voice/Models/ConferenceCallback.php @@ -144,7 +144,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['conferenceId'] = $this->conferenceId; diff --git a/src/Voice/Models/ConferenceMemberState.php b/src/Voice/Models/ConferenceMemberState.php index 406a769..9b25767 100644 --- a/src/Voice/Models/ConferenceMemberState.php +++ b/src/Voice/Models/ConferenceMemberState.php @@ -66,7 +66,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['callId'] = $this->callId; diff --git a/src/Voice/Models/ConferenceRecordingMetadata.php b/src/Voice/Models/ConferenceRecordingMetadata.php index db38412..7277ab5 100644 --- a/src/Voice/Models/ConferenceRecordingMetadata.php +++ b/src/Voice/Models/ConferenceRecordingMetadata.php @@ -107,7 +107,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['accountId'] = $this->accountId; diff --git a/src/Voice/Models/ConferenceState.php b/src/Voice/Models/ConferenceState.php index d204467..8ef6499 100644 --- a/src/Voice/Models/ConferenceState.php +++ b/src/Voice/Models/ConferenceState.php @@ -84,7 +84,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['id'] = $this->id; diff --git a/src/Voice/Models/CreateCallRequest.php b/src/Voice/Models/CreateCallRequest.php index c58f660..2474794 100644 --- a/src/Voice/Models/CreateCallRequest.php +++ b/src/Voice/Models/CreateCallRequest.php @@ -164,7 +164,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['from'] = $this->from; diff --git a/src/Voice/Models/CreateCallResponse.php b/src/Voice/Models/CreateCallResponse.php index 5f11c8c..428e6ad 100644 --- a/src/Voice/Models/CreateCallResponse.php +++ b/src/Voice/Models/CreateCallResponse.php @@ -183,7 +183,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['accountId'] = $this->accountId; diff --git a/src/Voice/Models/Diversion.php b/src/Voice/Models/Diversion.php index 391d810..9026e22 100644 --- a/src/Voice/Models/Diversion.php +++ b/src/Voice/Models/Diversion.php @@ -52,7 +52,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['reason'] = $this->reason; diff --git a/src/Voice/Models/MachineDetectionConfiguration.php b/src/Voice/Models/MachineDetectionConfiguration.php index bd91b57..8745f83 100644 --- a/src/Voice/Models/MachineDetectionConfiguration.php +++ b/src/Voice/Models/MachineDetectionConfiguration.php @@ -140,7 +140,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['mode'] = $this->mode; diff --git a/src/Voice/Models/ModifyCallRecordingRequest.php b/src/Voice/Models/ModifyCallRecordingRequest.php index 08096c7..d2a5355 100644 --- a/src/Voice/Models/ModifyCallRecordingRequest.php +++ b/src/Voice/Models/ModifyCallRecordingRequest.php @@ -32,7 +32,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['state'] = $this->state; diff --git a/src/Voice/Models/ModifyCallRequest.php b/src/Voice/Models/ModifyCallRequest.php index acd8147..9807096 100644 --- a/src/Voice/Models/ModifyCallRequest.php +++ b/src/Voice/Models/ModifyCallRequest.php @@ -100,7 +100,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['state'] = $this->state; diff --git a/src/Voice/Models/ModifyConferenceRequest.php b/src/Voice/Models/ModifyConferenceRequest.php index bb5206a..7d9496b 100644 --- a/src/Voice/Models/ModifyConferenceRequest.php +++ b/src/Voice/Models/ModifyConferenceRequest.php @@ -87,7 +87,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['status'] = $this->status; diff --git a/src/Voice/Models/TranscribeRecordingRequest.php b/src/Voice/Models/TranscribeRecordingRequest.php index b2a2ac2..16c011a 100644 --- a/src/Voice/Models/TranscribeRecordingRequest.php +++ b/src/Voice/Models/TranscribeRecordingRequest.php @@ -66,7 +66,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['callbackUrl'] = $this->callbackUrl; diff --git a/src/Voice/Models/Transcript.php b/src/Voice/Models/Transcript.php index b162f4f..cea62f6 100644 --- a/src/Voice/Models/Transcript.php +++ b/src/Voice/Models/Transcript.php @@ -38,7 +38,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['text'] = $this->text; diff --git a/src/Voice/Models/Transcription.php b/src/Voice/Models/Transcription.php index 784c03f..84057a9 100644 --- a/src/Voice/Models/Transcription.php +++ b/src/Voice/Models/Transcription.php @@ -52,7 +52,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['id'] = $this->id; diff --git a/src/Voice/Models/TranscriptionMetadata.php b/src/Voice/Models/TranscriptionMetadata.php index 402eaf7..2026499 100644 --- a/src/Voice/Models/TranscriptionMetadata.php +++ b/src/Voice/Models/TranscriptionMetadata.php @@ -54,7 +54,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['id'] = $this->id; diff --git a/src/Voice/Models/TranscriptionResponse.php b/src/Voice/Models/TranscriptionResponse.php index 618e935..4c9334a 100644 --- a/src/Voice/Models/TranscriptionResponse.php +++ b/src/Voice/Models/TranscriptionResponse.php @@ -31,7 +31,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['transcripts'] = isset($this->transcripts) ? diff --git a/src/WebRtc/Models/AccountsParticipantsResponse.php b/src/WebRtc/Models/AccountsParticipantsResponse.php index 50974f1..87695c1 100644 --- a/src/WebRtc/Models/AccountsParticipantsResponse.php +++ b/src/WebRtc/Models/AccountsParticipantsResponse.php @@ -40,7 +40,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['participant'] = $this->participant; diff --git a/src/WebRtc/Models/Participant.php b/src/WebRtc/Models/Participant.php index 81dda05..7aa3962 100644 --- a/src/WebRtc/Models/Participant.php +++ b/src/WebRtc/Models/Participant.php @@ -81,7 +81,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['id'] = $this->id; diff --git a/src/WebRtc/Models/ParticipantSubscription.php b/src/WebRtc/Models/ParticipantSubscription.php index 74ba85e..8d484f8 100644 --- a/src/WebRtc/Models/ParticipantSubscription.php +++ b/src/WebRtc/Models/ParticipantSubscription.php @@ -32,7 +32,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['participantId'] = $this->participantId; diff --git a/src/WebRtc/Models/Session.php b/src/WebRtc/Models/Session.php index ba76c05..ca1a70c 100644 --- a/src/WebRtc/Models/Session.php +++ b/src/WebRtc/Models/Session.php @@ -38,7 +38,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['id'] = $this->id; diff --git a/src/WebRtc/Models/Subscriptions.php b/src/WebRtc/Models/Subscriptions.php index e57572d..499aba4 100644 --- a/src/WebRtc/Models/Subscriptions.php +++ b/src/WebRtc/Models/Subscriptions.php @@ -42,7 +42,7 @@ public function __construct() /** * Encode this object to JSON */ - public function jsonSerialize() + public function jsonSerialize(): array { $json = array(); $json['sessionId'] = $this->sessionId; diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 87e317b..2a5244a 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -88,7 +88,7 @@ public function testCreateCallAndGetCallState() { $this->assertTrue(strlen($callId) > 0); $this->assertTrue(is_a($response->getResult()->enqueuedTime, 'DateTime')); - sleep(1); + sleep(15); //get phone call information $response = $this->bandwidthClient->getVoice()->getClient()->getCall(getenv("BW_ACCOUNT_ID"), $callId); @@ -120,7 +120,7 @@ public function testCreateCallWithAmdAndGetCallState() { $callId = $response->getResult()->callId; $this->assertTrue(strlen($callId) > 0); - sleep(1); + sleep(15); //get phone call information $response = $this->bandwidthClient->getVoice()->getClient()->getCall(getenv("BW_ACCOUNT_ID"), $callId);