From: Roland Haeder Date: Fri, 17 Oct 2014 21:17:42 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2aab30677b2438b2a265ad045b1ac22a9e680d9b;p=hub.git Continued: - Added new general HubHelper interface and let it extend/implement by suitable classes/interfaces - Used the new interface as type-hint in enqueueRawDataFromTemplate() Signed-off-by: Roland Haeder --- diff --git a/application/hub/interfaces/helper/connections/class_ConnectionHelper.php b/application/hub/interfaces/helper/connections/class_ConnectionHelper.php index e5e9450e0..4074932f8 100644 --- a/application/hub/interfaces/helper/connections/class_ConnectionHelper.php +++ b/application/hub/interfaces/helper/connections/class_ConnectionHelper.php @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -interface ConnectionHelper extends Helper { +interface ConnectionHelper extends HubHelper { /** * Sends raw package data to the recipient * diff --git a/application/hub/interfaces/helper/dht/class_HelpableDht.php b/application/hub/interfaces/helper/dht/class_HelpableDht.php index 91ce1b2e7..a7aafa2b1 100644 --- a/application/hub/interfaces/helper/dht/class_HelpableDht.php +++ b/application/hub/interfaces/helper/dht/class_HelpableDht.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -interface HelpableDht extends Helper { +interface HelpableDht extends HubHelper { /** * Loads the descriptor XML file * diff --git a/application/hub/interfaces/helper/hub/class_HubHelper.php b/application/hub/interfaces/helper/hub/class_HubHelper.php new file mode 100644 index 000000000..5ef351e65 --- /dev/null +++ b/application/hub/interfaces/helper/hub/class_HubHelper.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Hub 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 HubHelper extends Helper { +} + +// [EOF] +?> diff --git a/application/hub/interfaces/helper/node/class_HelpableNode.php b/application/hub/interfaces/helper/node/class_HelpableNode.php index f53af5b8f..fc783208b 100644 --- a/application/hub/interfaces/helper/node/class_HelpableNode.php +++ b/application/hub/interfaces/helper/node/class_HelpableNode.php @@ -1,6 +1,6 @@ * @version 0.0.0 @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -interface HelpableNode extends Helper { +interface HelpableNode extends HubHelper { /** * Loads the descriptor XML file * diff --git a/application/hub/interfaces/package/class_Deliverable.php b/application/hub/interfaces/package/class_Deliverable.php index 097ec1929..7f6b56c2c 100644 --- a/application/hub/interfaces/package/class_Deliverable.php +++ b/application/hub/interfaces/package/class_Deliverable.php @@ -27,10 +27,10 @@ interface Deliverable extends FrameworkInterface { * from given helper's template instance and pushing it on the 'undeclared' * stack. * - * @param $helperInstance An instance of a Helper class + * @param $helperInstance An instance of a HubHelper class * @return void */ - function enqueueRawDataFromTemplate (Helper $helperInstance); + function enqueueRawDataFromTemplate (HubHelper $helperInstance); /** * Checks whether a package has been enqueued for delivery. diff --git a/application/hub/main/helper/class_ b/application/hub/main/helper/class_ index d48c9257f..f2df8d58c 100644 --- a/application/hub/main/helper/class_ +++ b/application/hub/main/helper/class_ @@ -33,7 +33,7 @@ class !!!???Helper extends BaseHubSystemHelper implements Helpable!!! { parent::__construct(__CLASS__); // Set recipient type - $this->setRecipientType(NetworkPackage::NETWORK_TARGET_!!!); + $this->setRecipientType(NetworkPackage::NETWORK_TARGET_```); // Set package tags $this->setPackageTags(array('???')); diff --git a/application/hub/main/helper/class_BaseHubSystemHelper.php b/application/hub/main/helper/class_BaseHubSystemHelper.php index 9abd0cf1a..60d5d7a20 100644 --- a/application/hub/main/helper/class_BaseHubSystemHelper.php +++ b/application/hub/main/helper/class_BaseHubSystemHelper.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseHubSystemHelper extends BaseHubSystem implements Helper { +class BaseHubSystemHelper extends BaseHubSystem implements HubHelper { /** * Recipient type */ diff --git a/application/hub/main/helper/connection/class_BaseConnectionHelper.php b/application/hub/main/helper/connection/class_BaseConnectionHelper.php index 44661ff12..6f2eeb2df 100644 --- a/application/hub/main/helper/connection/class_BaseConnectionHelper.php +++ b/application/hub/main/helper/connection/class_BaseConnectionHelper.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, ProtocolHandler { +class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable { // Exception codes const EXCEPTION_UNSUPPORTED_ERROR_HANDLER = 0x9100; diff --git a/application/hub/main/package/class_NetworkPackage.php b/application/hub/main/package/class_NetworkPackage.php index cc0a7d4f5..a325f471a 100644 --- a/application/hub/main/package/class_NetworkPackage.php +++ b/application/hub/main/package/class_NetworkPackage.php @@ -624,10 +624,10 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R * from given helper's template instance and pushing it on the 'undeclared' * stack. * - * @param $helperInstance An instance of a Helper class + * @param $helperInstance An instance of a HubHelper class * @return void */ - public function enqueueRawDataFromTemplate (Helper $helperInstance) { + public function enqueueRawDataFromTemplate (HubHelper $helperInstance) { // Get protocol instance for recipient $protocolInstance = ProtocolHandlerFactory::createProtocolFromRecipientHelper($helperInstance);