From: Roland Haeder Date: Tue, 23 Dec 2014 22:45:10 +0000 (+0100) Subject: A much better name is HandleableProtocol. X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=ec670451fafdd675c346232d6580c8f291a23d3e A much better name is HandleableProtocol. Signed-off-by: Roland Häder --- diff --git a/inc/classes/exceptions/socket/class_NoSocketRegisteredException.php b/inc/classes/exceptions/socket/class_NoSocketRegisteredException.php index b919e558..e8d84753 100644 --- a/inc/classes/exceptions/socket/class_NoSocketRegisteredException.php +++ b/inc/classes/exceptions/socket/class_NoSocketRegisteredException.php @@ -25,7 +25,7 @@ class NoSocketRegisteredException extends AbstractSocketException { /** * A Constructor for this exception * - * @param $protocolInstance An instance of a ProtocolHandler class + * @param $protocolInstance An instance of a HandleableProtocol class * @param $code Error code * @return void */ diff --git a/inc/classes/interfaces/handler/protocol/class_HandleableProtocol.php b/inc/classes/interfaces/handler/protocol/class_HandleableProtocol.php new file mode 100644 index 00000000..8cfe6d60 --- /dev/null +++ b/inc/classes/interfaces/handler/protocol/class_HandleableProtocol.php @@ -0,0 +1,41 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface HandleableProtocol extends Handleable { + /** + * Getter for port number to satify HandleableProtocol + * + * @return $port The port number + */ + function getPort (); + + /** + * Getter for protocol name + * + * @return $protocol Name of used protocol + */ + function getProtocolName (); +} + +// [EOF] +?> diff --git a/inc/classes/interfaces/handler/protocol/class_ProtocolHandler.php b/inc/classes/interfaces/handler/protocol/class_ProtocolHandler.php deleted file mode 100644 index ed8c11e3..00000000 --- a/inc/classes/interfaces/handler/protocol/class_ProtocolHandler.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface ProtocolHandler extends Handleable { - /** - * Getter for port number to satify ProtocolHandler - * - * @return $port The port number - */ - function getPort (); - - /** - * Getter for protocol name - * - * @return $protocol Name of used protocol - */ - function getProtocolName (); -} - -// [EOF] -?> diff --git a/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php b/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php index 62ac1874..1f197295 100644 --- a/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php +++ b/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php @@ -26,7 +26,7 @@ interface RegisterableSocket extends Registerable { * Checks whether given socket resource is registered. If $socketResource is * FALSE only the instance will be checked. * - * @param $protocolInstance An instance of a ProtocolHandler class + * @param $protocolInstance An instance of a HandleableProtocol class * @param $socketResource A valid socket resource * @return $isRegistered Whether the given socket resource is registered */ @@ -35,7 +35,7 @@ interface RegisterableSocket extends Registerable { /** * Registeres given socket for listener or throws an exception if it is already registered * - * @param $protocolInstance An instance of a ProtocolHandler class + * @param $protocolInstance An instance of a HandleableProtocol class * @param $socketResource A valid socket resource * @return void * @throws SocketAlreadyRegisteredException If the given socket is already registered @@ -45,7 +45,7 @@ interface RegisterableSocket extends Registerable { /** * Getter for given listener's socket resource * - * @param $protocolInstance An instance of a ProtocolHandler class + * @param $protocolInstance An instance of a HandleableProtocol class * @return $socketResource A valid socket resource * @throws NoSocketRegisteredException If the requested socket is not registered */ @@ -55,7 +55,7 @@ interface RegisterableSocket extends Registerable { * "Getter" for protocol/connection instance from given package data * * @param $packageData Raw package data - * @return $protocolInstance An instance of a ProtocolHandler class + * @return $protocolInstance An instance of a HandleableProtocol class */ function getHandlerInstanceFromPackageData (array $packageData); } diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index d5a56141..07e9a2c6 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -129,7 +129,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { private $parserInstance = NULL; /** - * A ProtocolHandler instance + * A HandleableProtocol instance */ private $protocolInstance = NULL; @@ -1018,9 +1018,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { } /** - * Setter for ProtocolHandler instance + * Setter for HandleableProtocol instance * - * @param $protocolInstance An instance of an ProtocolHandler + * @param $protocolInstance An instance of an HandleableProtocol * @return void */ public final function setProtocolInstance (ProtocolHandler $protocolInstance = NULL) { @@ -1028,9 +1028,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { } /** - * Getter for ProtocolHandler instance + * Getter for HandleableProtocol instance * - * @return $protocolInstance An instance of an ProtocolHandler + * @return $protocolInstance An instance of an HandleableProtocol */ public final function getProtocolInstance () { return $this->protocolInstance; diff --git a/inc/classes/main/container/socket/class_SocketContainer.php b/inc/classes/main/container/socket/class_SocketContainer.php index 0cec3448..bfc3bd2c 100644 --- a/inc/classes/main/container/socket/class_SocketContainer.php +++ b/inc/classes/main/container/socket/class_SocketContainer.php @@ -36,11 +36,11 @@ class SocketContainer extends BaseContainer implements Registerable { * Creates an instance of this Container class and prepares it for usage * * @param $socketResource A valid socket resource - * @param $protocolInstance A ProtocolHandler instance + * @param $protocolInstance A HandleableProtocol instance * @param $packageData Raw package data * @return $containerInstance An instance of this Container class */ - public static final function createSocketContainer ($socketResource, ProtocolHandler $protocolInstance = NULL, array $packageData = array()) { + public static final function createSocketContainer ($socketResource, HandleableProtocol $protocolInstance = NULL, array $packageData = array()) { // Get a new instance $containerInstance = new SocketContainer(); diff --git a/inc/classes/main/factories/client/class_ClientFactory.php b/inc/classes/main/factories/client/class_ClientFactory.php index 544ef8f1..3ef532d1 100644 --- a/inc/classes/main/factories/client/class_ClientFactory.php +++ b/inc/classes/main/factories/client/class_ClientFactory.php @@ -36,7 +36,7 @@ class ClientFactory extends ObjectFactory { * Creates a client object for given protocol. This method uses the * registry pattern to cache those instances. * - * @param $protocolInstance An instance of a ProtocolHandler class to create a client object for (e.g. 'http' for a HTTP/1.1 client) + * @param $protocolInstance An instance of a HandleableProtocol class to create a client object for (e.g. 'http' for a HTTP/1.1 client) * @param $socketResource A valid socket resource (optional) * @return $clientInstance An instance of the requested client */