Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return static instead of type of class #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/Voice/Bxml/Bridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function __construct(string $targetCall) {
*
* @param string $bridgeCompleteUrl URL to send the bridge complete event to
*/
public function bridgeCompleteUrl(string $bridgeCompleteUrl): Bridge {
public function bridgeCompleteUrl(string $bridgeCompleteUrl): static {
$this->bridgeCompleteUrl = $bridgeCompleteUrl;
return $this;
}
Expand All @@ -96,7 +96,7 @@ public function bridgeCompleteUrl(string $bridgeCompleteUrl): Bridge {
*
* @param string $bridgeCompleteMethod HTTP method to send the bridge complete event
*/
public function bridgeCompleteMethod(string $bridgeCompleteMethod): Bridge {
public function bridgeCompleteMethod(string $bridgeCompleteMethod): static {
$this->bridgeCompleteMethod = $bridgeCompleteMethod;
return $this;
}
Expand All @@ -106,7 +106,7 @@ public function bridgeCompleteMethod(string $bridgeCompleteMethod): Bridge {
*
* @param string $bridgeTargetCompleteUrl URL to send the bridge target complete event to
*/
public function bridgeTargetCompleteUrl(string $bridgeTargetCompleteUrl): Bridge {
public function bridgeTargetCompleteUrl(string $bridgeTargetCompleteUrl): static {
$this->bridgeTargetCompleteUrl = $bridgeTargetCompleteUrl;
return $this;
}
Expand All @@ -116,7 +116,7 @@ public function bridgeTargetCompleteUrl(string $bridgeTargetCompleteUrl): Bridge
*
* @param string $bridgeTargetCompleteMethod HTTP method to send the bridge target complete event
*/
public function bridgeTargetCompleteMethod(string $bridgeTargetCompleteMethod): Bridge {
public function bridgeTargetCompleteMethod(string $bridgeTargetCompleteMethod): static {
$this->bridgeTargetCompleteMethod = $bridgeTargetCompleteMethod;
return $this;
}
Expand All @@ -126,7 +126,7 @@ public function bridgeTargetCompleteMethod(string $bridgeTargetCompleteMethod):
*
* @param string $username HTTP basic auth username for sending events
*/
public function username(string $username): Bridge {
public function username(string $username): static {
$this->username = $username;
return $this;
}
Expand All @@ -136,7 +136,7 @@ public function username(string $username): Bridge {
*
* @param string $password HTTP basic auth password for sending events
*/
public function password(string $password): Bridge {
public function password(string $password): static {
$this->password = $password;
return $this;
}
Expand All @@ -146,7 +146,7 @@ public function password(string $password): Bridge {
*
* @param string $tag String to include in events
*/
public function tag(string $tag): Bridge {
public function tag(string $tag): static {
$this->tag = $tag;
return $this;
}
Expand All @@ -156,7 +156,7 @@ public function tag(string $tag): Bridge {
*
* @param string $bridgeCompleteFallbackUrl Fallback URL for bridge complete callback events
*/
public function bridgeCompleteFallbackUrl(string $bridgeCompleteFallbackUrl): Bridge {
public function bridgeCompleteFallbackUrl(string $bridgeCompleteFallbackUrl): static {
$this->bridgeCompleteFallbackUrl = $bridgeCompleteFallbackUrl;
return $this;
}
Expand All @@ -166,7 +166,7 @@ public function bridgeCompleteFallbackUrl(string $bridgeCompleteFallbackUrl): Br
*
* @param string $bridgeCompleteFallbackMethod HTTP method for bridge complete fallback requests
*/
public function bridgeCompleteFallbackMethod(string $bridgeCompleteFallbackMethod): Bridge {
public function bridgeCompleteFallbackMethod(string $bridgeCompleteFallbackMethod): static {
$this->bridgeCompleteFallbackMethod = $bridgeCompleteFallbackMethod;
return $this;
}
Expand All @@ -176,7 +176,7 @@ public function bridgeCompleteFallbackMethod(string $bridgeCompleteFallbackMetho
*
* @param string $bridgeTargetCompleteFallbackUrl Fallback URL for bridge target complete callback events
*/
public function bridgeTargetCompleteFallbackUrl(string $bridgeTargetCompleteFallbackUrl): Bridge {
public function bridgeTargetCompleteFallbackUrl(string $bridgeTargetCompleteFallbackUrl): static {
$this->bridgeTargetCompleteFallbackUrl = $bridgeTargetCompleteFallbackUrl;
return $this;
}
Expand All @@ -186,7 +186,7 @@ public function bridgeTargetCompleteFallbackUrl(string $bridgeTargetCompleteFall
*
* @param string $bridgeTargetCompleteFallbackMethod HTTP method for bridge target complete fallback events
*/
public function bridgeTargetCompleteFallbackMethod(string $bridgeTargetCompleteFallbackMethod): Bridge {
public function bridgeTargetCompleteFallbackMethod(string $bridgeTargetCompleteFallbackMethod): static {
$this->bridgeTargetCompleteFallbackMethod = $bridgeTargetCompleteFallbackMethod;
return $this;
}
Expand All @@ -196,7 +196,7 @@ public function bridgeTargetCompleteFallbackMethod(string $bridgeTargetCompleteF
*
* @param string $fallbackUsername HTTP basic auth username for fallback events
*/
public function fallbackUsername(string $fallbackUsername): Bridge {
public function fallbackUsername(string $fallbackUsername): static {
$this->fallbackUsername = $fallbackUsername;
return $this;
}
Expand All @@ -206,7 +206,7 @@ public function fallbackUsername(string $fallbackUsername): Bridge {
*
* @param string $fallbackPassword HTTP basic auth password
*/
public function fallbackPassword(string $fallbackPassword): Bridge {
public function fallbackPassword(string $fallbackPassword): static {
$this->fallbackPassword = $fallbackPassword;
return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Voice/Bxml/Bxml.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct() {
*
* @param Verb $verb The verb to add to the list
*/
public function addVerb(Verb $verb): Bxml {
public function addVerb(Verb $verb): static {
array_push($this->verbs, $verb);
return $this;
}
Expand Down
26 changes: 13 additions & 13 deletions src/Voice/Bxml/Conference.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function __construct(string $conferenceName) {
*
* @param string $tag A custom string to be included in callbacks
*/
public function tag(string $tag): Conference {
public function tag(string $tag): static {
$this->tag = $tag;
return $this;
}
Expand All @@ -92,7 +92,7 @@ public function tag(string $tag): Conference {
*
* @param string $username Username for basic auth for callbacks
*/
public function username(string $username): Conference {
public function username(string $username): static {
$this->username = $username;
return $this;
}
Expand All @@ -102,7 +102,7 @@ public function username(string $username): Conference {
*
* @param string $password Password for basic auth for callbacks
*/
public function password(string $password): Conference {
public function password(string $password): static {
$this->password = $password;
return $this;
}
Expand All @@ -112,7 +112,7 @@ public function password(string $password): Conference {
*
* @param string $conferenceEventUrl URL to receive conference events
*/
public function conferenceEventUrl(string $conferenceEventUrl): Conference {
public function conferenceEventUrl(string $conferenceEventUrl): static {
$this->conferenceEventUrl = $conferenceEventUrl;
return $this;
}
Expand All @@ -122,7 +122,7 @@ public function conferenceEventUrl(string $conferenceEventUrl): Conference {
*
* @param string $conferenceEventMethod HTTP method for conference events
*/
public function conferenceEventMethod(string $conferenceEventMethod): Conference {
public function conferenceEventMethod(string $conferenceEventMethod): static {
$this->conferenceEventMethod = $conferenceEventMethod;
return $this;
}
Expand All @@ -132,7 +132,7 @@ public function conferenceEventMethod(string $conferenceEventMethod): Conference
*
* @param string $callIdsToCoach A string of comma separated call IDs to coach
*/
public function callIdsToCoach(string $callIdsToCoach): Conference {
public function callIdsToCoach(string $callIdsToCoach): static {
$this->callIdsToCoach = $callIdsToCoach;
return $this;
}
Expand All @@ -142,7 +142,7 @@ public function callIdsToCoach(string $callIdsToCoach): Conference {
*
* @param array $callIdsToCoach An array of call IDs to coach
*/
public function callIdsToCoachArray(array $callIdsToCoach): Conference {
public function callIdsToCoachArray(array $callIdsToCoach): static {
$this->callIdsToCoach = implode(",", $callIdsToCoach);
return $this;
}
Expand All @@ -152,7 +152,7 @@ public function callIdsToCoachArray(array $callIdsToCoach): Conference {
*
* @param boolean $mute Determines if conference members should be on mute
*/
public function mute(bool $mute): Conference {
public function mute(bool $mute): static {
$this->mute = $mute;
return $this;
}
Expand All @@ -162,7 +162,7 @@ public function mute(bool $mute): Conference {
*
* @param boolean $hold Determines if conference members should be on hold
*/
public function hold(bool $hold): Conference {
public function hold(bool $hold): static {
$this->hold = $hold;
return $this;
}
Expand All @@ -172,7 +172,7 @@ public function hold(bool $hold): Conference {
*
* @param string $conferenceEventFallbackUrl Fallback url for conference events
*/
public function conferenceEventFallbackUrl(string $conferenceEventFallbackUrl): Conference {
public function conferenceEventFallbackUrl(string $conferenceEventFallbackUrl): static {
$this->conferenceEventFallbackUrl = $conferenceEventFallbackUrl;
return $this;
}
Expand All @@ -182,7 +182,7 @@ public function conferenceEventFallbackUrl(string $conferenceEventFallbackUrl):
*
* @param string $conferenceEventFallbackMethod HTTP method for fallback events
*/
public function conferenceEventFallbackMethod(string $conferenceEventFallbackMethod): Conference {
public function conferenceEventFallbackMethod(string $conferenceEventFallbackMethod): static {
$this->conferenceEventFallbackMethod = $conferenceEventFallbackMethod;
return $this;
}
Expand All @@ -192,7 +192,7 @@ public function conferenceEventFallbackMethod(string $conferenceEventFallbackMet
*
* @param string $fallbackUsername HTTP basic auth username for fallback events
*/
public function fallbackUsername(string $fallbackUsername): Conference {
public function fallbackUsername(string $fallbackUsername): static {
$this->fallbackUsername = $fallbackUsername;
return $this;
}
Expand All @@ -202,7 +202,7 @@ public function fallbackUsername(string $fallbackUsername): Conference {
*
* @param string $fallbackPassword HTTP basic auth password for fallback events
*/
public function fallbackPassword(string $fallbackPassword): Conference {
public function fallbackPassword(string $fallbackPassword): static {
$this->fallbackPassword = $fallbackPassword;
return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Voice/Bxml/CustomParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CustomParam extends Verb {
*
* @param string $name (required) The name of this parameter, up to 256 characters.
*/
public function name(string $name): CustomParam {
public function name(string $name): static {
$this->name = $name;
return $this;
}
Expand All @@ -39,7 +39,7 @@ public function name(string $name): CustomParam {
*
* @param string $value (required) The value of this parameter, up to 2048 characters.
*/
public function value(string $value): CustomParam {
public function value(string $value): static {
$this->value = $value;
return $this;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Voice/Bxml/Forward.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Forward extends Verb {
*
* @param string $to The phone number to receive the phone call
*/
public function to(string $to): Forward {
public function to(string $to): static {
$this->to = $to;
return $this;
}
Expand All @@ -51,7 +51,7 @@ public function to(string $to): Forward {
*
* @param string $from The phone number to make the phone call
*/
public function from(string $from): Forward {
public function from(string $from): static {
$this->from = $from;
return $this;
}
Expand All @@ -61,7 +61,7 @@ public function from(string $from): Forward {
*
* @param string $callTimeout The timeout in seconds for the phone call
*/
public function callTimeout(string $callTimeout): Forward {
public function callTimeout(string $callTimeout): static {
$this->callTimeout = $callTimeout;
return $this;
}
Expand All @@ -71,7 +71,7 @@ public function callTimeout(string $callTimeout): Forward {
*
* @param string $diversionTreatment The diversion treatment for the phone call
*/
public function diversionTreatment(string $diversionTreatment): Forward {
public function diversionTreatment(string $diversionTreatment): static {
$this->diversionTreatment = $diversionTreatment;
return $this;
}
Expand All @@ -81,7 +81,7 @@ public function diversionTreatment(string $diversionTreatment): Forward {
*
* @param string $diversionReason The diversion treatment for the phone call
*/
public function diversionReason(string $diversionReason): Forward {
public function diversionReason(string $diversionReason): static {
$this->diversionReason = $diversionReason;
return $this;
}
Expand Down
Loading
Loading