Merge branch 'refs/heads/app-refactor' into wamp
This commit is contained in:
commit
81700d8cd4
@ -7,12 +7,6 @@ use Ratchet\Resource\Connection;
|
|||||||
* It impelemtns the decorator and command pattern to build an application stack
|
* It impelemtns the decorator and command pattern to build an application stack
|
||||||
*/
|
*/
|
||||||
interface ApplicationInterface {
|
interface ApplicationInterface {
|
||||||
/**
|
|
||||||
* Decorator pattern
|
|
||||||
* @param Ratchet\ApplicationInterface Application to wrap in protocol
|
|
||||||
*/
|
|
||||||
public function __construct(ApplicationInterface $app = null);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When a new connection is opened it will be passed to this method
|
* When a new connection is opened it will be passed to this method
|
||||||
* @param Ratchet\Resource\Connection The socket/connection that just connected to your application
|
* @param Ratchet\Resource\Connection The socket/connection that just connected to your application
|
||||||
|
@ -41,11 +41,7 @@ class App implements ApplicationInterface {
|
|||||||
*/
|
*/
|
||||||
protected $_run = true;
|
protected $_run = true;
|
||||||
|
|
||||||
public function __construct(ApplicationInterface $application = null) {
|
public function __construct(ApplicationInterface $application) {
|
||||||
if (null === $application) {
|
|
||||||
throw new \UnexpectedValueException("Server requires an application to run off of");
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->_app = $application;
|
$this->_app = $application;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,11 +41,7 @@ class App implements ApplicationInterface, ConfiguratorInterface {
|
|||||||
|
|
||||||
protected $_mask_payload = false;
|
protected $_mask_payload = false;
|
||||||
|
|
||||||
public function __construct(ApplicationInterface $app = null) {
|
public function __construct(ApplicationInterface $app) {
|
||||||
if (null === $app) {
|
|
||||||
throw new \UnexpectedValueException("WebSocket requires an application to run");
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->_app = $app;
|
$this->_app = $app;
|
||||||
$this->_factory = new Factory;
|
$this->_factory = new Factory;
|
||||||
}
|
}
|
||||||
|
@ -36,11 +36,6 @@ class AppTest extends \PHPUnit_Framework_TestCase {
|
|||||||
return array_pop($connections);
|
return array_pop($connections);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDoNotAllowStacklessServer() {
|
|
||||||
$this->setExpectedException('UnexpectedValueException');
|
|
||||||
new ServerApp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testOnOpenPassesClonedSocket() {
|
public function testOnOpenPassesClonedSocket() {
|
||||||
$this->_server->run($this->_catalyst);
|
$this->_server->run($this->_catalyst);
|
||||||
$master = $this->getMasterConnection();
|
$master = $this->getMasterConnection();
|
||||||
|
Loading…
Reference in New Issue
Block a user