PHP Class SimpleSoftwareIO\SMS\Drivers\TwilioSMS

Inheritance: extends AbstractSMS, implements SimpleSoftwareIO\SMS\Drivers\DriverInterface
Show file Open project: simplesoftwareio/simple-sms

Protected Properties

Property Type Description
$authToken string Holds the Twilio auth token.
$twilio Services_Twilio The Twilio SDK.
$url string Holds the request URL to verify a Twilio push.
$verify boolean Determines if requests should be checked to be authentic.

Public Methods

Method Description
__construct ( Services_Twilio $twilio, $authToken, $url, boolean $verify = false ) Constructs the TwilioSMS object.
checkMessages ( array $options = [] ) : array Checks the server for messages and returns their results.
getMessage ( string | integer $messageId ) : IncomingMessage Gets a single message by it's ID.
receive ( mixed $raw ) : IncomingMessage Receives an incoming message via REST call.
send ( OutgoingMessage $message ) Sends a SMS message.

Protected Methods

Method Description
processReceive ( $raw ) Processing the raw information from a request and inputs it into the IncomingMessage object.
validateRequest ( ) Checks if a message is authentic from Twilio.

Method Details

__construct() public method

Constructs the TwilioSMS object.
public __construct ( Services_Twilio $twilio, $authToken, $url, boolean $verify = false )
$twilio Services_Twilio
$authToken
$url
$verify boolean

checkMessages() public method

Checks the server for messages and returns their results.
public checkMessages ( array $options = [] ) : array
$options array
return array

getMessage() public method

Gets a single message by it's ID.
public getMessage ( string | integer $messageId ) : IncomingMessage
$messageId string | integer
return SimpleSoftwareIO\SMS\IncomingMessage

processReceive() protected method

Processing the raw information from a request and inputs it into the IncomingMessage object.
protected processReceive ( $raw )
$raw

receive() public method

Receives an incoming message via REST call.
public receive ( mixed $raw ) : IncomingMessage
$raw mixed
return SimpleSoftwareIO\SMS\IncomingMessage

send() public method

Sends a SMS message.
public send ( OutgoingMessage $message )
$message SimpleSoftwareIO\SMS\OutgoingMessage

validateRequest() protected method

Checks if a message is authentic from Twilio.
protected validateRequest ( )

Property Details

$authToken protected property

Holds the Twilio auth token.
protected string $authToken
return string

$twilio protected property

The Twilio SDK.
protected Services_Twilio $twilio
return Services_Twilio

$url protected property

Holds the request URL to verify a Twilio push.
protected string $url
return string

$verify protected property

Determines if requests should be checked to be authentic.
protected bool $verify
return boolean