Loosened Dependencies
Removed construct dependency from ApplicationInterface - changing full decorator to changeable stack.
This commit is contained in:
parent
d37237c274
commit
ed3cfc16da
@ -41,11 +41,7 @@ class App implements ApplicationInterface {
|
||||
*/
|
||||
protected $_run = true;
|
||||
|
||||
public function __construct(ApplicationInterface $application = null) {
|
||||
if (null === $application) {
|
||||
throw new \UnexpectedValueException("Server requires an application to run off of");
|
||||
}
|
||||
|
||||
public function __construct(ApplicationInterface $application) {
|
||||
$this->_app = $application;
|
||||
}
|
||||
|
||||
|
@ -41,11 +41,7 @@ class App implements ApplicationInterface, ConfiguratorInterface {
|
||||
|
||||
protected $_mask_payload = false;
|
||||
|
||||
public function __construct(ApplicationInterface $app = null) {
|
||||
if (null === $app) {
|
||||
throw new \UnexpectedValueException("WebSocket requires an application to run");
|
||||
}
|
||||
|
||||
public function __construct(ApplicationInterface $app) {
|
||||
$this->_app = $app;
|
||||
$this->_factory = new Factory;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ interface WebSocketAppInterface extends ApplicationInterface {
|
||||
* Currently instead of this, I'm setting header in the Connection object passed around...not sure which I like more
|
||||
* @param string
|
||||
*/
|
||||
function setHeaders($headers);
|
||||
//function setHeaders($headers);
|
||||
|
||||
/**
|
||||
* @return string
|
||||
|
@ -36,11 +36,6 @@ class AppTest extends \PHPUnit_Framework_TestCase {
|
||||
return array_pop($connections);
|
||||
}
|
||||
|
||||
public function testDoNotAllowStacklessServer() {
|
||||
$this->setExpectedException('UnexpectedValueException');
|
||||
new ServerApp;
|
||||
}
|
||||
|
||||
public function testOnOpenPassesClonedSocket() {
|
||||
$this->_server->run($this->_catalyst);
|
||||
$master = $this->getMasterConnection();
|
||||
|
Loading…
Reference in New Issue
Block a user