PHP Class rcrowe\Hippy\Client

Show file Open project: rcrowe/hippy Class Usage Examples

Protected Properties

Property Type Description
$from Name the message will be sent from.
$room Name or id of the room.
$token Admin or notification token.
$transport rcrowe\Hippy\Transport\TransportInterface

Public Methods

Method Description
__construct ( rcrowe\Hippy\Transport\TransportInterface $transport ) Create a new instance on the client
getFrom ( ) : string Get who the message will be sent from.
getRoom ( ) : string | integer Get the room the message will be sent to.
getToken ( ) : string Get the token used to authenticate with.
getTransport ( ) : rcrowe\Hippy\Transport\TransportInterface Return the TransportInterface that will actually send the message.
send ( rcrowe\Hippy\Message\SenderInterface $msg ) : void Send a single message or a queue of messages. A queue must implement \Iterator in order to work.
setFrom ( string $from ) : void Set who the message will be sent from.
setRoom ( string $room ) : void Set the room that the message will be sent to.
setToken ( string $token ) : void Set the token used to authenticate with.
setTransport ( rcrowe\Hippy\Transport\TransportInterface $transport ) : void Set the instance of TransportInterface that will actually send the message.

Method Details

__construct() public method

Create a new instance on the client
public __construct ( rcrowe\Hippy\Transport\TransportInterface $transport )
$transport rcrowe\Hippy\Transport\TransportInterface

getFrom() public method

Get who the message will be sent from.
public getFrom ( ) : string
return string

getRoom() public method

Get the room the message will be sent to.
public getRoom ( ) : string | integer
return string | integer

getToken() public method

Get the token used to authenticate with.
public getToken ( ) : string
return string

getTransport() public method

Return the TransportInterface that will actually send the message.
public getTransport ( ) : rcrowe\Hippy\Transport\TransportInterface
return rcrowe\Hippy\Transport\TransportInterface

send() public method

Send a single message or a queue of messages. A queue must implement \Iterator in order to work.
public send ( rcrowe\Hippy\Message\SenderInterface $msg ) : void
$msg rcrowe\Hippy\Message\SenderInterface
return void

setFrom() public method

Set who the message will be sent from.
public setFrom ( string $from ) : void
$from string Message will be sent by this user.
return void

setRoom() public method

Set the room that the message will be sent to.
public setRoom ( string $room ) : void
$room string Room name or id.
return void

setToken() public method

Set the token used to authenticate with.
public setToken ( string $token ) : void
$token string API token. See https://{domain}.hipchat.com/admin/api.
return void

setTransport() public method

Set the instance of TransportInterface that will actually send the message.
public setTransport ( rcrowe\Hippy\Transport\TransportInterface $transport ) : void
$transport rcrowe\Hippy\Transport\TransportInterface
return void

Property Details

$from protected property

Name the message will be sent from.
protected $from

$room protected property

Name or id of the room.
protected $room

$token protected property

Admin or notification token.
protected $token

$transport protected property

protected TransportInterface,rcrowe\Hippy\Transport $transport
return rcrowe\Hippy\Transport\TransportInterface