rcrowe\Hippy\Facade::init PHP Method

init() public static method

Initialise the facade. Must be called first.
public static init ( string $token, string | integer $room, string $from, rcrowe\Hippy\Transport\TransportInterface $transport = null )
$token string API token.
$room string | integer Room to send message to.
$from string Who the message is from.
$transport rcrowe\Hippy\Transport\TransportInterface
    public static function init($token, $room, $from, $transport = null)
    {
        if ($transport === null) {
            $transport = new Guzzle($token, $room, $from);
        }
        static::$client = new Client($transport);
        static::$queue = new Queue();
    }

Usage Example

Example #1
0
 public function testMultipleInit()
 {
     Hippy::init('321', 'hippy', 'Rob');
     Hippy::init('123', 'hippy', 'Rob');
     list($client, $queue) = $this->getObjects();
     $this->assertEquals($client->getToken(), '123');
 }
All Usage Examples Of rcrowe\Hippy\Facade::init