[TASK] Removed the linebreak from the buffers in the ConnectionHandler.
[TASK] Added a WrongDatatypeException [TASK] Started to implement the ProtocolHandler in a different way. [TASK] Started to put buffers into the ProtocolHandler. [!!!] Committing broken code.
This commit is contained in:
@@ -32,8 +32,12 @@ abstract class Client_AbstractClient {
|
||||
* Injects ProtocolHandler
|
||||
* @param mixed $protocolHandler instance of Protocol_AbstractProtocolHandler
|
||||
* @return void
|
||||
* @throws Exception_WrongDatatypeException
|
||||
*/
|
||||
public function injectProtocolHandler($protocolHandler) {
|
||||
if(!$protocolHandler instanceof Protocol_AbstractProtocolHandler) {
|
||||
throw new Exception_WrongDatatypeException("Cannot inject ProtocolHandler! Expected an instance of Protocol_AbstractProtocolHandler, '" . get_type($protocolHandler) . "' given.", 1291156562);
|
||||
}
|
||||
$this->protocolHandler = $protocolHandler;
|
||||
}
|
||||
|
||||
@@ -44,8 +48,8 @@ abstract class Client_AbstractClient {
|
||||
* @return string
|
||||
*/
|
||||
public function processRawData($rawData) {
|
||||
$contentObject = $this->protocolHandler->parse($rawData);
|
||||
return $this->processContentObject($contentObject);
|
||||
$contentObject = $this->protocolHandler->pushRawData($rawData);
|
||||
return $this->processContentObject($this->protocolHandler->);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,8 +92,12 @@ abstract class Client_AbstractClient {
|
||||
/**
|
||||
* Injects ClientManager
|
||||
* @param Client_ClientManager $clientManager
|
||||
* @throws Exception_WrongDatatypeException
|
||||
*/
|
||||
public function injectClientManager($clientManager) {
|
||||
if(!$clientManager instanceof Client_ClientManager) {
|
||||
throw new Exception_WrongDatatypeException("Cannot inject ClientManager! Expected an instance of Client_ClientManager, '" . get_type($clientManager) . "' given.", 1291156565);
|
||||
}
|
||||
$this->clientManager = $clientManager;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user