Inject RequestVerfier instead of instantiating

This commit is contained in:
Chris Boden 2016-02-15 17:03:10 -05:00
parent e75c843fc9
commit ac4d13cc09
2 changed files with 3 additions and 3 deletions

View File

@ -17,8 +17,8 @@ class ServerNegotiator implements NegotiatorInterface {
private $_strictSubProtocols = true; private $_strictSubProtocols = true;
public function __construct() { public function __construct(RequestVerifier $requestVerifier) {
$this->verifier = new RequestVerifier; $this->verifier = $requestVerifier;
} }
/** /**

View File

@ -11,7 +11,7 @@ $socket = new \React\Socket\Server($loop);
$server = new \React\Http\Server($socket); $server = new \React\Http\Server($socket);
$closeFrameChecker = new \Ratchet\RFC6455\Messaging\CloseFrameChecker; $closeFrameChecker = new \Ratchet\RFC6455\Messaging\CloseFrameChecker;
$negotiator = new \Ratchet\RFC6455\Handshake\ServerNegotiator; $negotiator = new \Ratchet\RFC6455\Handshake\ServerNegotiator(new \Ratchet\RFC6455\Handshake\RequestVerifier);
$uException = new \UnderflowException; $uException = new \UnderflowException;