From: Roland Häder Date: Thu, 21 Jul 2011 20:17:38 +0000 (+0000) Subject: Minor improvements here and there: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=da1c915e6b217c496f668051f66b8f177175e1bd;p=core.git Minor improvements here and there: - Messages of socket exceptions made more clear - $protocolInstance can be NULL --- diff --git a/inc/classes/exceptions/socket/class_InvalidSocketException.php b/inc/classes/exceptions/socket/class_InvalidSocketException.php index a6b69c41..27ccb5d5 100644 --- a/inc/classes/exceptions/socket/class_InvalidSocketException.php +++ b/inc/classes/exceptions/socket/class_InvalidSocketException.php @@ -32,7 +32,7 @@ class InvalidSocketException extends FrameworkException { */ public function __construct (array $messageData, $code) { // Construct the message - $message = sprintf("[%s:] Invalid socket (type %s != resource). errno=%s, errstr=%s", + $message = sprintf("[%s:] Invalid socket, type=%s, errno=%s, errstr=%s", $messageData[0]->__toString(), $messageData[1], $messageData[2], diff --git a/inc/classes/exceptions/socket/class_SocketConnectionException.php b/inc/classes/exceptions/socket/class_SocketConnectionException.php index 2e53617d..c7210108 100644 --- a/inc/classes/exceptions/socket/class_SocketConnectionException.php +++ b/inc/classes/exceptions/socket/class_SocketConnectionException.php @@ -33,7 +33,7 @@ class SocketConnectionException extends FrameworkException { */ public function __construct (array $messageData, $code) { // Construct the message - $message = sprintf("[%s:] Could not make a connection! (type %s != resource). errno=%s, errstr=%s", + $message = sprintf("[%s:] Could not make a connection, type=%s, errno=%s, errstr=%s", $messageData[0]->__toString(), $messageData[1], $messageData[2], diff --git a/inc/classes/exceptions/socket/class_SocketCreationException.php b/inc/classes/exceptions/socket/class_SocketCreationException.php index 12155de4..d3260a61 100644 --- a/inc/classes/exceptions/socket/class_SocketCreationException.php +++ b/inc/classes/exceptions/socket/class_SocketCreationException.php @@ -33,7 +33,7 @@ class SocketCreationException extends FrameworkException { */ public function __construct (array $messageData, $code) { // Construct the message - $message = sprintf("[%s:] Cannot create socket (type %s != resource). errno=%s, errstr=%s", + $message = sprintf("[%s:] Cannot create socket, type=%s, errno=%s, errstr=%s", $messageData[0]->__toString(), $messageData[1], $messageData[2], diff --git a/inc/classes/exceptions/socket/class_SocketOptionException.php b/inc/classes/exceptions/socket/class_SocketOptionException.php index c63a0ada..a0528277 100644 --- a/inc/classes/exceptions/socket/class_SocketOptionException.php +++ b/inc/classes/exceptions/socket/class_SocketOptionException.php @@ -33,7 +33,7 @@ class SocketOptionException extends FrameworkException { */ public function __construct (array $messageData, $code) { // Construct the message - $message = sprintf("[%s:] Changing option on socket failed! (type %s != resource). errno=%s, errstr=%s", + $message = sprintf("[%s:] Changing option on socket failed, type=%s, errno=%s, errstr=%s", $messageData[0]->__toString(), $messageData[1], $messageData[2], diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 6ac52f82..731a7251 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -1510,7 +1510,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @param $protocolInstance An instance of an ProtocolHandler * @return void */ - public final function setProtocolInstance (ProtocolHandler $protocolInstance) { + public final function setProtocolInstance (ProtocolHandler $protocolInstance = NULL) { $this->protocolInstance = $protocolInstance; } diff --git a/inc/classes/main/container/socket/class_SocketContainer.php b/inc/classes/main/container/socket/class_SocketContainer.php index ea541387..8b70b954 100644 --- a/inc/classes/main/container/socket/class_SocketContainer.php +++ b/inc/classes/main/container/socket/class_SocketContainer.php @@ -40,7 +40,7 @@ class SocketContainer extends BaseContainer implements Registerable { * @param $packageData Raw package data * @return $containerInstance An instance of this Container class */ - public static final function createSocketContainer ($socketResource, ProtocolHandler $protocolInstance, array $packageData) { + public static final function createSocketContainer ($socketResource, ProtocolHandler $protocolInstance = NULL, array $packageData) { // Get a new instance $containerInstance = new SocketContainer();