*
* @return $dhtInstance An instance of a Distributable class
*/
- public final static function create??? () {
+ public final static function create??? (): Distributable {
// Get new instance
$dhtInstance = new ???DhtFacade();
* @return void
* @todo 0% done
*/
- protected function insertDataIntoDht (array $dhtData) {
+ protected function insertDataIntoDht (array $dhtData): void {
DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
}
+
}
*
* @return void
*/
- private function initStacks () {
+ private function initStacks (): void {
// Initialize all stacker
$this->getStackInstance()->initStacks([
self::STACKER_NAME_INSERT_NODE,
* @param $dhtData A valid array with DHT-related data (e.g. node/peer data)
* @return void
*/
- protected abstract function insertDataIntoDht (array $dhtData);
+ protected abstract function insertDataIntoDht (array $dhtData): void;
/**
* Updates/refreshes DHT data (e.g. status).
* @return void
* @todo Find more to do here
*/
- public function updateDhtData () {
+ public function updateDhtData (): void {
// Set some dummy configuration entries, e.g. dht_status
FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('dht_status', $this->getStateInstance()->getStateName());
}
*
* @return $isPending Whether there are pending entries
*/
- public function ifInsertNodeDataPending () {
+ public function ifInsertNodeDataPending (): bool {
// Determine it if it is not empty
$isPending = ($this->getStackInstance()->isStackEmpty(self::STACKER_NAME_INSERT_NODE) === FALSE);
*
* @return void
*/
- public function insertSingleNodeData () {
+ public function insertSingleNodeData (): void {
// Get next node data from stack
$nodeData = $this->getStackInstance()->popNamed(self::STACKER_NAME_INSERT_NODE);
* @return $hasUnpublished Whether there are unpublished entries
* @todo Add minimum/maximum age limitations
*/
- public function hasUnpublishedEntries () {
+ public function hasUnpublishedEntries (): bool {
// Call method on database frontend
$hasUnpublished = $this->getFrontendInstance()->hasUnpublishedEntries();
* @return void
* @throws UnexpectedValueException If $resultInstance is not valid
*/
- public function initEntryPublication () {
+ public function initEntryPublication (): void {
// Call method on database frontend
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DHT: CALLED!');
$this->getFrontendInstance()->initEntryPublication();
*
* @return $isPending Whether there are entries pending publication
*/
- public function hasEntriesPendingPublication () {
+ public function hasEntriesPendingPublication (): bool {
// Determine it if it is not empty
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DHT: CALLED!');
$isPending = ($this->getStackInstance()->isStackEmpty(self::STACKER_NAME_PENDING_PUBLISHING) === FALSE);
*
* @return $isBooting Whether this DHT is currently booting
*/
- public function ifDhtIsBooting () {
+ public function ifDhtIsBooting (): boot {
// Call state instance
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DHT: CALLED!');
$isBooting = $this->getStateInstance()->ifDhtIsBooting();
* @todo Find out if loadDescriptorXml() can be called only once to avoid a lot methods working.
* @throws BadMethodCallException If this method was called but no pending entries publication
*/
- public function publishEntry () {
+ public function publishEntry (): void {
// This test must not fail
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DHT: CALLED!');
if (!$this->hasEntriesPendingPublication()) {
* @return $isFullyBooted Whether the DHT is fully booted
* @todo 0% done
*/
- public function hasFullyBootstrapped () {
+ public function hasFullyBootstrapped (): bool {
// Get state and check it
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DHT: CALLED!');
DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
* @return void
* @todo Switch flag 'accept_bootstrap'
*/
- public function enableAcceptDhtBootstrap () {
+ public function enableAcceptDhtBootstrap (): void {
// Call method on database frontend
$this->getFrontendInstance()->enableAcceptDhtBootstrap();
}
*
* @return $dhtInstance An instance of a Distributable class
*/
- public final static function createNodeDhtFacade () {
+ public final static function createNodeDhtFacade (): DistributableNode {
// Get new instance
$dhtInstance = new NodeDhtFacade();
* @return void
* @todo Does this data need to be enriched with more meta data?
*/
- protected function insertDataIntoDht (array $dhtData) {
+ protected function insertDataIntoDht (array $dhtData): void {
// Check if there is already an entry for given node_id
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: dhtData()=%d - CALLED!', count($dhtData)));
if ($this->getFrontendInstance()->isNodeRegistered($dhtData)) {
*
* @return void
*/
- public function initDht () {
+ public function initDht (): void {
// Is the local node registered?
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-DHT-FACADE: CALLED!');
if ($this->getFrontendInstance()->isLocalNodeRegistered()) {
*
* @return void
*/
- public function bootstrapDht () {
+ public function bootstrapDht (): void {
// Get a helper instance
$helperInstance = ObjectFactory::createObjectByConfiguredName('dht_bootstrap_helper_class');
* @param $sessionId Session id to lookup
* @return $nodeData Node-data array
*/
- public function findNodeLocalBySessionId (string $sessionId) {
+ public function findNodeLocalBySessionId (string $sessionId): array {
// Validate parameter
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: sessionId=%s - CALLED!', $sessionId));
if (empty($sessionId)) {
* @param $locatorInstance An instance of a LocateableNode class
* @return $nodeData Node-data array
*/
- public function findNodeByUniversalNodeLocator (LocateableNode $locatorInstance) {
+ public function findNodeByUniversalNodeLocator (LocateableNode $locatorInstance): array {
// Default is empty data array
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: locatorInstance=%s - CALLED!', $locatorInstance->__toString()));
//* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: locatorInstance=%s', __METHOD__, __LINE__, print_r($locatorInstance, TRUE)));
* @throws NodeSessionIdVerficationException If the node was not found and update is forced
* @throws UnexpectedValueException If $resultInstance does not implement wanted interface
*/
- public function registerNodeByMessageInstance (DeliverableMessage $messageInstance, HandleableDataSet $handlerInstance, bool $forceUpdate = FALSE) {
+ public function registerNodeByMessageInstance (DeliverableMessage $messageInstance, HandleableDataSet $handlerInstance, bool $forceUpdate = FALSE): void {
// Get a search criteria class
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: state=%s,messageInstance=%s,handlerInstance=%s,forceUpdate=%d - CALLED', $this->getPrintableState(), $messageInstance->__toString(), $handlerInstance->__toString(), intval($forceUpdate)));
$searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
* @return $nodeList An array with all found nodes
* @throws UnexpectedValueException If $resultInstance does not implement wanted interface
*/
- public function queryLocalNodeListExceptByMessageInstance (DeliverableMessage $messageInstance, HandleableDataSet $handlerInstance, string $excludeKey, string $andKey, string $separator) {
+ public function queryLocalNodeListExceptByMessageInstance (DeliverableMessage $messageInstance, HandleableDataSet $handlerInstance, string $excludeKey, string $andKey, string $separator): array {
// Get a search criteria class
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: messageInstance=%s,handlerInstance=%s,excludeKey=%s,andKey=%s,separator=%s - CALLED!', $messageInstance->__toString(), $handlerInstance->__toString(), $excludeKey, $andKey, $separator));
//* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: state=%s,messageInstance=%s', $this->getPrintableState(), print_r($messageInstance, TRUE)));
* @param $nodeList An array from an earlier database result instance
* @return void
*/
- public function insertNodeList (array $nodeList) {
+ public function insertNodeList (array $nodeList): void {
// If no node is in the list (array), skip the rest of this method
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: nodeList()=%d - CALLED!', count($nodeList)));
if (count($nodeList) == 0) {
* @return $recipients An indexed array with DHT recipients
* @throws UnexpectedValueException If $resultInstance does not implement wanted interface
*/
- public function findRecipientsByPackageInstance (DeliverablePackage $packageInstance) {
+ public function findRecipientsByPackageInstance (DeliverablePackage $packageInstance): array {
// Query get a result instance back from DHT database frontend
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: packageInstance=%s - CALLED!', $packageInstance->__toString()));
$resultInstance = $this->getFrontendInstance()->getResultFromExcludedSender($packageInstance);
*
* @param $key Key to search for
* @param $value Value to check on found key
- * @return $recipiens Array with DHT recipients from given key/value pair
+ * @return $recipients Array with DHT recipients from given key/value pair
* @throws InvalidArgumentException If $key is empty
* @throws UnexpectedValueException If $resultInstance does not implement wanted interface
*/
- public function findRecipientsByKey (string $key, $value) {
+ public function findRecipientsByKey (string $key, mixed $value): array {
// Is key parameter valid?
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: key=%s,value[%s]=%s - CALLED!', $key, gettype($value), $value));
if (empty($key)) {
*/
public final static function createHubcoinRewardFeature () {
// Get a new instance
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('[%s:%d]: CALLED!', __METHOD__, __LINE__));
$featureInstance = new HubcoinRewardFeature();
// Return the prepared instance
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('[%s:%d]: featureInstance=%s - EXIT!', __METHOD__, __LINE__, $featureInstance->__toString()));
return $featureInstance;
}
*/
public function isFeatureAvailable () {
// Testing this feature is pretty simple:
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: CALLED!', __METHOD__, __LINE__));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('[%s:%d]: CALLED!', __METHOD__, __LINE__));
$isAvailable = ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('extension_scrypt_loaded') === TRUE) && (extension_loaded('scrypt')) && (is_callable('scrypt')));
// Return status
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: isAvailable=%d - EXIT!', __METHOD__, __LINE__, intval($isAvailable)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('[%s:%d]: isAvailable=%d - EXIT!', __METHOD__, __LINE__, intval($isAvailable)));
return $isAvailable;
}
*/
public function featureMethodGenerateHash ($data) {
// Make sure the feature is available
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: data()=%d - CALLED!', __METHOD__, __LINE__, strlen($data)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('[%s:%d]: data()=%d - CALLED!', __METHOD__, __LINE__, strlen($data)));
assert(FrameworkFeature::isFeatureAvailable('hubcoin_reward'));
// Call inner class
$hash = Scrypt::hashScrypt($data);
// Return generated hash
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: hash=%s - EXIT!', __METHOD__, __LINE__, $hash));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('[%s:%d]: hash=%s - EXIT!', __METHOD__, __LINE__, $hash));
return $hash;
}
*/
public function featureMethodCheckHash ($data, string $hash) {
// Make sure the feature is available
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: data()=%d,hash=%s - CALLED!', __METHOD__, __LINE__, strlen($data), $hash));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('[%s:%d]: data()=%d,hash=%s - CALLED!', __METHOD__, __LINE__, strlen($data), $hash));
assert(FrameworkFeature::isFeatureAvailable('hubcoin_reward'));
// Determine it
$isValid = Scrypt::checkScrypt($data, $hash);
// Return status
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: isValid=%d - EXIT!', __METHOD__, __LINE__, intval($isValid)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('[%s:%d]: isValid=%d - EXIT!', __METHOD__, __LINE__, intval($isValid)));
return $isValid;
}
*/
private function validateSocket (StorableSocket $socketInstance) {
// Is it a valid resource?
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-SYSTEM: socketInstance->socketResource=%s - CALLED!', $socketInstance->getPrintableName()));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('HUB-SYSTEM: socketInstance->socketResource=%s - CALLED!', $socketInstance->getPrintableName()));
if (!$socketInstance->isValidSocket()) {
// Throw an exception
throw new InvalidSocketException([$this, $socketInstance->getSocketResource()], self::EXCEPTION_INVALID_SOCKET);
* @throws InvalidArgumentException If $connectionType is empty
* @throws InvalidConnectionTypeException If the provided connection type is not valid
*/
- public function addPeer (StorableSocket $socketInstance, string $connectionType) {
+ public function addPeer (StorableSocket $socketInstance, string $connectionType): void {
// Validate parameter
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DEFAULT-PEER-POOL: socketResource[%s]=%s,connectionType=%s - CALLED!', gettype($socketInstance->getSocketResource()), $socketInstance->getPrintableName(), $connectionType));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DEFAULT-PEER-POOL: socketResource[%s]=%s,connectionType=%s - CALLED!', gettype($socketInstance->getSocketResource()), $socketInstance->getPrintableName(), $connectionType));
if (empty($connectionType)) {
// Throw exception
throw new InvalidArgumentException('Parameter "connectionType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
*
* @return $sockets An array with all sockets
*/
- public final function getAllSockets () {
+ public final function getAllSockets (): array {
// Get the list
$sockets = $this->getArrayFromList('pool');
// Return it
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DEFAULT-PEER-POOL: sockets()=%d - EXIT!', count($sockets)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DEFAULT-PEER-POOL: sockets()=%d - EXIT!', count($sockets)));
return $sockets;
}
*
* @return $sockets An array with all socket arrays
*/
- public final function getAllSingleSockets () {
+ public final function getAllSingleSockets (): array {
// Get the array list
$socketArrays = $this->getArrayFromList('pool');
* @throws InvalidConnectionTypeException If the found connection type is not valid
* @throws InvalidArgumentException If $connectionType is empty
*/
- public function getSocketsByConnectionType (string $connectionType) {
+ public function getSocketsByConnectionType (string $connectionType): array {
// Validate parameter
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DEFAULT-PEER-POOL: connectionType=%s - CALLED!', $connectionType));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DEFAULT-PEER-POOL: connectionType=%s - CALLED!', $connectionType));
if (empty($connectionType)) {
// Throw exception
throw new InvalidArgumentException('Parameter "connectionType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
*/
public function getSocketFromPackageInstance (DeliverablePackage $packageInstance, string $connectionType = NULL) {
// Validate parameter
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DEFAULT-PEER-POOL: packageInstance=%s,connectionType[%s]=%s - CALLED!', $packageInstance->__toString(), gettype($connectionType), $connectionType));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DEFAULT-PEER-POOL: packageInstance=%s,connectionType[%s]=%s - CALLED!', $packageInstance->__toString(), gettype($connectionType), $connectionType));
if (empty($connectionType)) {
// Throw exception
throw new InvalidArgumentException('Parameter "connectionType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
}
// Return the determined socket instance
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DEFAULT-PEER-POOL: socketInstance[]=%s - EXIT!', gettype($socketInstance)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('DEFAULT-PEER-POOL: socketInstance[]=%s - EXIT!', gettype($socketInstance)));
return $socketInstance;
}
*
* @return $sessionIdLength Length of session ids
*/
- protected final function getSessionIdLength () {
+ protected final function getSessionIdLength (): int {
return $this->sessionIdLength;
}
* is resolveSessionIdByUniversalNodeLocator()
*
* @param $sessionId A valid session id
- * @return $recipientUniversalNodeLocator Recipient as Universal Node Locator
+ * @return $recipientUnl Recipient as Universal Node Locator
* @throws InvalidArgumentException If $sessionId is not valid
*/
- protected function resolveUniversalNodeLocatorBySessionId (string $sessionId) {
+ protected function resolveUniversalNodeLocatorBySessionId (string $sessionId): string {
// Validate parameter
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-TOOLS: sessionId=%s - CALLED!', $sessionId));
if (empty($sessionId)) {
* @return $nodeId Node id
* @throws InvalidArgumentException If $sessionId is not valid
*/
- public static function resolveNodeIdBySessionId (string $sessionId) {
+ public static function resolveNodeIdBySessionId (string $sessionId): string {
// Validate parameter
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-TOOLS: sessionId=%s - CALLED!', $sessionId));
if (empty($sessionId)) {
* @param $locatorInstance An instance of a LocateableNode class
* @return $sessionId Valid session id
*/
- public static function resolveSessionIdByUniversalNodeLocator (LocateableNode $locatorInstance) {
+ public static function resolveSessionIdByUniversalNodeLocator (LocateableNode $locatorInstance): string {
// Get an own instance
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-TOOLS: locatorInstance=%s - CALLED!', $locatorInstance->__toString()));
$selfInstance = self::getSelfInstance();
* @throws InvalidSessionIdException If the provided session id is invalid (and no Universal Node Locator)
* @throws NoValidHostnameException If the provided hostname cannot be resolved into an IP address
*/
- public static function resolveSessionIdToUnl (string $address) {
+ public static function resolveSessionIdToUnl (string $address): string {
// Is the parameter valid?
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-TOOLS: address=%s - CALLED!', $address));
if (empty($address)) {
*
* @return $unl The determined external UNL of this node
*/
- public static function determineOwnExternalAddress () {
+ public static function determineOwnExternalAddress (): string {
// Is the external_address config entry set?
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS: CALLED!');
if (isset(self::$cachedAddresses[DiscoverableUniversalNodeLocator::UNL_TYPE_EXTERNAL])) {
*
* @return $unl The determined internal UNL of this node
*/
- public static function determineOwnInternalAddress () {
+ public static function determineOwnInternalAddress (): string {
// Is the internal_address config entry set?
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS: CALLED!');
if (isset(self::$cachedAddresses[DiscoverableUniversalNodeLocator::UNL_TYPE_INTERNAL])) {
*
* @return $externalUnl External UNL
*/
- public static function determineExternalUniversalNodeLocator () {
+ public static function determineExternalUniversalNodeLocator (): string {
// Determine UNL based on this node:
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-TOOLS: CALLED!');
// 1) Get discovery class
* @param $unl Universal Node Locator to validate
* @return $isValid Whether the UNL is valid
*/
- public static function isValidUniversalNodeLocator (string $unl) {
+ public static function isValidUniversalNodeLocator (string $unl): bool {
// Debug message
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UNIVERSAL-NODE-LOCATOR: unl=' . $unl . ' - CALLED!');
* @return $nodeData Node-data array
* @throws InvalidArgumentException If parameter $sessionId is not valid
*/
- function findNodeLocalBySessionId (string $sessionId);
+ function findNodeLocalBySessionId (string $sessionId): array;
/**
* Finds a node locally by given UNL instance
* @param $locatorInstance An instance of a LocateableNode class
* @return $nodeData Node-data array
*/
- function findNodeByUniversalNodeLocator (LocateableNode $locatorInstance);
+ function findNodeByUniversalNodeLocator (LocateableNode $locatorInstance): array;
/**
* Registers an other node with this node by given message data. The
* @param $forceUpdate Optionally force update, don't register (default: register if not found)
* @return void
*/
- function registerNodeByMessageInstance (DeliverableMessage $messageInstance, HandleableDataSet $handlerInstance, bool $forceUpdate = FALSE);
+ function registerNodeByMessageInstance (DeliverableMessage $messageInstance, HandleableDataSet $handlerInstance, bool $forceUpdate = FALSE): void;
/**
* Queries the local DHT data(base) for a node list with all supported
* @param $separator Sepator char (1st parameter for explode() call)
* @return $nodeList An array with all found nodes
*/
- function queryLocalNodeListExceptByMessageInstance (DeliverableMessage $messageInstance, HandleableDataSet $handlerInstance, string $excludeKey, string $andKey, string $separator);
+ function queryLocalNodeListExceptByMessageInstance (DeliverableMessage $messageInstance, HandleableDataSet $handlerInstance, string $excludeKey, string $andKey, string $separator): array;
/**
* Inserts given node list array (from earlier database result produced by
* @param $nodeList An array from an earlier database result instance
* @return void
*/
- function insertNodeList (array $nodeList);
+ function insertNodeList (array $nodeList): void;
/**
* Checks whether there are entries in "INSERT" node data stack
*
* @return $isPending Whether there are pending entries
*/
- function ifInsertNodeDataPending ();
+ function ifInsertNodeDataPending (): bool;
/**
* Checks whether there are unpublished entries
*
* @return $hasUnpublished Whether there are unpublished entries
*/
- function hasUnpublishedEntries ();
+ function hasUnpublishedEntries (): bool;
/**
* Initializes publication of DHT entries. This does only prepare
*
* @return void
*/
- function initEntryPublication ();
+ function initEntryPublication (): void;
/**
* Checks whether there are entries pending publication
*
* @return $isPending Whether there are entries pending publication
*/
- function hasEntriesPendingPublication ();
+ function hasEntriesPendingPublication (): bool;
/**
* Publishes next entry found in stack. This method shall also update the
*
* @return void
*/
- function publishEntry ();
+ function publishEntry (): void;
}
* @return void
* @throws InvalidConnectionTypeException If the provided connection type is not valid
*/
- function addPeer (StorableSocket $socketInstance, string $connectionType);
+ function addPeer (StorableSocket $socketInstance, string $connectionType): void;
/**
* Getter for array of all socket resources
*
* @return $sockets An array with all sockets
*/
- function getAllSockets ();
+ function getAllSockets (): array;
/**
* Getter for array of all socket arrays
*
* @return $sockets An array with all socket arrays
*/
- function getAllSingleSockets ();
+ function getAllSingleSockets (): array;
/**
* "Getter" for all sockets of specified type
-Subproject commit cc9a1193fe856148b71982e055dd05051751cef2
+Subproject commit ba75c20fcc3cc172de195703b3220168d97912fd