- ApplicationHelper now doesn't have all these fields set, BaseApplication holds it
- all __construct()'s $className parameter have now a type-hint "string" set
- updated core framework
Signed-off-by: Roland Häder <roland@mxchange.org>
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class ApplicationHelper extends BaseApplication implements ManageableApplication, Registerable {
- /**
- * The version number of this application
- */
- private $appVersion = '';
-
- /**
- * The human-readable name for this application
- */
- private $appName = '';
-
- /**
- * The short uni*-like name for this application
- */
- private $shortName = '';
-
- /**
- * An instance of this class
- */
- private static $selfInstance = NULL;
-
/**
* Private constructor
*
*/
public static final function getSelfInstance () {
// Is the instance there?
- if (is_null(self::$selfInstance)) {
- self::$selfInstance = new ApplicationHelper();
+ if (is_null(self::getApplicationInstance())) {
+ self::setApplicationInstance(new ApplicationHelper());
} // END - if
// Return the instance
- return self::$selfInstance;
- }
-
- /**
- * Getter for the version number
- *
- * @return $appVersion The application's version number
- */
- public final function getAppVersion () {
- return $this->appVersion;
- }
- /**
- * Setter for the version number
- *
- * @param $appVersion The application's version number
- * @return void
- */
- public final function setAppVersion ($appVersion) {
- // Cast and set it
- $this->appVersion = (string) $appVersion;
- }
-
- /**
- * Getter for human-readable name
- *
- * @return $appName The application's human-readable name
- */
- public final function getAppName () {
- return $this->appName;
- }
-
- /**
- * Setter for human-readable name
- *
- * @param $appName The application's human-readable name
- * @return void
- */
- public final function setAppName ($appName) {
- // Cast and set it
- $this->appName = (string) $appName;;
- }
-
- /**
- * Getter for short uni*-like name
- *
- * @return $shortName The application's short uni*-like name
- */
- public final function getAppShortName () {
- return $this->shortName;
- }
-
- /**
- * Setter for short uni*-like name
- *
- * @param $shortName The application's short uni*-like name
- * @return void
- */
- public final function setAppShortName ($shortName) {
- // Cast and set it
- $this->shortName = (string) $shortName;
+ return self::getApplicationInstance();
}
/**
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-HUB-CONTAINER: className=%s - CONSTRUCTED!', $className));
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Real class name
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Real class name
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Real name of class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Real name of class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Real name of class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Real name of class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Real name of class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Real name of class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Real name of class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-RAW-DATA-HANDLER: className=%s - CONSTRUCTED!', $className));
parent::__construct($className);
* @param $className Name of the concrete class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of implementing class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the concrete class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the concrete class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
return $this->connectionType;
}
+ /**
+ * Getter for protocol name
+ *
+ * @return $protocolName Name of used protocol
+ */
+ public final function getProtocolName () {
+ return $this->protocolName;
+ }
+
+ /**
+ * Setter for protocol name
+ *
+ * @param $protocolName Name of used protocol
+ * @return void
+ */
+ protected final function setProtocolName (string $protocolName) {
+ $this->protocolName = $protocolName;
+ }
+
+ /**
+ * Setter for listener instance
+ *
+ * @param $listenerInstance A Listenable instance
+ * @return void
+ */
+ public final function setListenerInstance (Listenable $listenerInstance) {
+ $this->listenerInstance = $listenerInstance;
+ }
+
+ /**
+ * Getter for listener instance
+ *
+ * @return $listenerInstance A Listenable instance
+ */
+ public final function getListenerInstance () {
+ return $this->listenerInstance;
+ }
+
+ /**
+ * Getter for address
+ *
+ * @return $address Address from shared information
+ */
+ public final function getAddress () {
+ // Return it from generic array
+ return $this->getGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_ADDRESS);
+ }
+
+ /**
+ * Getter for port
+ *
+ * @return $port Port from shared information
+ */
+ public final function getPort () {
+ // Return it from generic array
+ return $this->getGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_PORT);
+ }
+
/**
* Fills the information class with data from a Listenable instance
*
*/
public function fillWithListenerInformation (Listenable $listenerInstance) {
// Fill the generic array with several data from the listener:
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-INFO: protocolName=' . $listenerInstance->getProtocolName() . ',listenerInstance=' . $listenerInstance->__toString() . ' - CALLED!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-INFO: protocolName=%s,listenerInstance=%s - CALLED!', $listenerInstance->getProtocolName(), $listenerInstance->__toString()));
$this->setProtocolName($listenerInstance->getProtocolName());
- $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_ADDRESS , $listenerInstance->getListenAddress());
- $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_PORT , $listenerInstance->getListenPort());
+ $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_ADDRESS, $listenerInstance->getListenAddress());
+ $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_PORT , $listenerInstance->getListenPort());
// Set listener here
$this->setListenerInstance($listenerInstance);
// Trace message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-INFO: EXIT!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-INFO: EXIT!');
}
/**
*/
public function fillWithConnectionHelperInformation (ConnectionHelper $helperInstance) {
// Fill the generic array with several data from the listener:
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-INFO: protocolName=' . $helperInstance->getProtocolName() . ',helperInstance=' . $helperInstance->__toString() . ',socketResource=' . $helperInstance->getSocketResource() . ' - CALLED!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-INFO: protocolName=%s,helperInstance=%s,socketResource=%s - CALLED!', $helperInstance->getProtocolName(), $helperInstance->__toString(), $helperInstance->getSocketResource()));
$this->setProtocolName($helperInstance->getSocketInstance()->getSocketProtocol());
- $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_ADDRESS , $helperInstance->getSocketInstance()->getSocketRecipientAddress());
- $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_PORT , $helperInstance->getSocketInstance()->getSocketRecipientPort());
+ $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_ADDRESS, $helperInstance->getSocketInstance()->getSocketRecipientAddress());
+ $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_PORT , $helperInstance->getSocketInstance()->getSocketRecipientPort());
// Set helper here
$this->setHelperInstance($helperInstance);
// Trace message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-INFO: EXIT!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-INFO: EXIT!');
}
/**
$this->setSocketInstance($socketInstance);
// Trace message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-INFO: EXIT!');
- }
-
- /**
- * Getter for address
- *
- * @return $address Address from shared information
- */
- public final function getAddress () {
- // Return it from generic array
- return $this->getGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_ADDRESS);
- }
-
- /**
- * Getter for port
- *
- * @return $port Port from shared information
- */
- public final function getPort () {
- // Return it from generic array
- return $this->getGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_PORT);
- }
-
- /**
- * Getter for protocol name
- *
- * @return $protocolName Name of used protocol
- */
- public final function getProtocolName () {
- return $this->protocolName;
- }
-
- /**
- * Setter for protocol name
- *
- * @param $protocolName Name of used protocol
- * @return void
- */
- protected final function setProtocolName (string $protocolName) {
- $this->protocolName = $protocolName;
- }
-
- /**
- * Setter for listener instance
- *
- * @param $listenerInstance A Listenable instance
- * @return void
- */
- public final function setListenerInstance (Listenable $listenerInstance) {
- $this->listenerInstance = $listenerInstance;
- }
-
- /**
- * Getter for listener instance
- *
- * @return $listenerInstance A Listenable instance
- */
- public final function getListenerInstance () {
- return $this->listenerInstance;
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-INFO: EXIT!');
}
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Complete class name
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Complete class name
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the real class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
* @param $className Name of the class
* @return void
*/
- protected function __construct ($className) {
+ protected function __construct (string $className) {
// Call parent constructor
parent::__construct($className);
}
-Subproject commit c15d02389e67a880e7b4c6b19f2b06722efa4e6f
+Subproject commit c1aadb61b45c15273c07c366887c8f58c53155e3