]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Fri, 17 Oct 2014 21:17:42 +0000 (23:17 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 17 Oct 2014 22:44:58 +0000 (00:44 +0200)
- 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 <roland@mxchange.org>
application/hub/interfaces/helper/connections/class_ConnectionHelper.php
application/hub/interfaces/helper/dht/class_HelpableDht.php
application/hub/interfaces/helper/hub/class_HubHelper.php [new file with mode: 0644]
application/hub/interfaces/helper/node/class_HelpableNode.php
application/hub/interfaces/package/class_Deliverable.php
application/hub/main/helper/class_
application/hub/main/helper/class_BaseHubSystemHelper.php
application/hub/main/helper/connection/class_BaseConnectionHelper.php
application/hub/main/package/class_NetworkPackage.php

index e5e9450e03c1dbdf182604346f8bc1b180c35bfd..4074932f811cbdb0230c6911bd2ad40adddbf794 100644 (file)
@@ -22,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-interface ConnectionHelper extends Helper {
+interface ConnectionHelper extends HubHelper {
        /**
         * Sends raw package data to the recipient
         *
index 91ce1b2e7e703dc2c428c8fc8028d24f6ec03f0b..a7aafa2b1b562f5d2c2a51e9c7c0571c410d01f6 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-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 (file)
index 0000000..5ef351e
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An general interface for hub helper classes
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+interface HubHelper extends Helper {
+}
+
+// [EOF]
+?>
index f53af5b8fc92fa2c7ad4d5c951fa4a0f1e665074..fc783208bdc0da9f6a6c88c5b59bb15e83802668 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * An interface for hub helper classes
+ * An interface for node helper classes
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @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 <http://www.gnu.org/licenses/>.
  */
-interface HelpableNode extends Helper {
+interface HelpableNode extends HubHelper {
        /**
         * Loads the descriptor XML file
         *
index 097ec1929a421d49e4331984887941ca59b03613..7f6b56c2ccef60dd2488e52316143557801390c1 100644 (file)
@@ -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.
index d48c9257f28d53c527f331cf0c646e9a5044d641..f2df8d58c3f532d3acb4cbf2a5e9d7bbfccd673c 100644 (file)
@@ -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('???'));
index 9abd0cf1aa1d01c6a51d4a4e8b92db28c1b96265..60d5d7a20b6582c638f686c6822e379ebe211f85 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class BaseHubSystemHelper extends BaseHubSystem implements Helper {
+class BaseHubSystemHelper extends BaseHubSystem implements HubHelper {
        /**
         * Recipient type
         */
index 44661ff12cae3a2d7053789bfdcfdf552f7d96f2..6f2eeb2df4800f754c9d28205c88b670293d0d50 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, ProtocolHandler {
+class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable {
        // Exception codes
        const EXCEPTION_UNSUPPORTED_ERROR_HANDLER = 0x9100;
 
index cc0a7d4f52af168e187b8aa449ed0932f93ab3ce..a325f471a2320f999c8679730979ce5f0af9aabc 100644 (file)
@@ -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);