laravel-websockets/src/Server/MockableConnection.php

45 lines
795 B
PHP
Raw Normal View History

2020-09-15 09:30:17 +00:00
<?php
namespace BeyondCode\LaravelWebSockets\Server;
use Ratchet\ConnectionInterface;
use stdClass;
class MockableConnection implements ConnectionInterface
{
/**
* Create a new Mockable connection.
*
* @param string|int $appId
* @param string $socketId
* @return void
*/
public function __construct($appId, string $socketId)
{
$this->app = new stdClass;
$this->app->id = $appId;
$this->socketId = $socketId;
}
/**
2020-09-15 09:30:43 +00:00
* Send data to the connection.
2020-09-15 09:30:17 +00:00
* @param string $data
* @return \Ratchet\ConnectionInterface
*/
2020-09-15 09:30:43 +00:00
public function send($data)
2020-09-15 09:30:17 +00:00
{
//
}
/**
2020-09-15 09:30:43 +00:00
* Close the connection.
2020-09-15 09:30:17 +00:00
*
* @return void
*/
2020-09-15 09:30:43 +00:00
public function close()
2020-09-15 09:30:17 +00:00
{
//
}
}