]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 26 Jan 2025 17:14:39 +0000 (18:14 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 26 Jan 2025 17:14:39 +0000 (18:14 +0100)
- added returned type-hints
- updated 'core' framework

application/hub/classes/iterator/network/class_NetworkListenIterator.php
application/hub/classes/iterator/node/class_NodePingIterator.php
application/hub/classes/iterator/pool/handler/class_HandlerPoolIterator.php
application/hub/classes/iterator/pool/monitor/class_MonitorPoolIterator.php
application/hub/classes/iterator/pool/shutdown/class_ShutdownPoolIterator.php
application/hub/classes/iterator/pool/tasks/class_TaskPoolIterator.php
application/hub/classes/iterator/producer/keys/class_TestUnitKeyProducerIterator.php
core

index bd9ee6f5f8043d6f836cbd0c1ed2e20f9f9ae463..bff3740abe292127e8c84bfb5bf07bba2b63b196 100644 (file)
@@ -55,7 +55,7 @@ class NetworkListenIterator extends BaseIterator implements Iterator {
         * @param       $listInstance           A list of a Listable
         * @return      $iteratorInstance       An instance a Iterator class
         */
-       public static final function createNetworkListenIterator (Listable $listInstance) {
+       public static final function createNetworkListenIterator (Listable $listInstance): NetworkListenIterator {
                // Get new instance
                $iteratorInstance = new NetworkListenIterator();
 
@@ -72,7 +72,7 @@ class NetworkListenIterator extends BaseIterator implements Iterator {
         * @return      $current        Current value in iteration
         * @throws      IndexOutOfBoundsException       If $indexKey is out of bounds
         */
-       public function current () {
+       public function current (): mixed {
                // Default is null
                $current = NULL;
 
@@ -94,7 +94,7 @@ class NetworkListenIterator extends BaseIterator implements Iterator {
         *
         * @return      $indexKey       Current key in iteration
         */
-       public function key () {
+       public function key (): int {
                return $this->indexKey;
        }
 
@@ -103,7 +103,7 @@ class NetworkListenIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function next () {
+       public function next (): void {
                $this->indexKey++;
        }
 
@@ -112,7 +112,7 @@ class NetworkListenIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function rewind () {
+       public function rewind (): void {
                $this->indexKey = 0;
        }
 
@@ -121,7 +121,7 @@ class NetworkListenIterator extends BaseIterator implements Iterator {
         *
         * @return      $isValid        Whether the current entry is there
         */
-       public function valid () {
+       public function valid (): bool {
                // Check for total active peers and if we are not at the end
                $isValid = ($this->key() < $this->getListInstance()->count());
 
index 11b28fe9f7df0c9ec9256463eee67cb63c5b5f94..bd840bb03765bc826ae9fda66fe3bf42fd9ea7bf 100644 (file)
@@ -47,7 +47,7 @@ class NodePingIterator extends BaseIterator implements Iterator {
         *
         * @return      $iteratorInstance               An instance of a Iterator class
         */
-       public static final function createNodePingIterator () {
+       public static final function createNodePingIterator (): NodePingIterator {
                // Get new instance
                $iteratorInstance = new NodePingIterator();
 
@@ -60,7 +60,7 @@ class NodePingIterator extends BaseIterator implements Iterator {
         *
         * @return      $current        Current value in iteration
         */
-       public function current () {
+       public function current (): mixed {
                // Default is null
                $current = NULL;
 
@@ -75,7 +75,7 @@ class NodePingIterator extends BaseIterator implements Iterator {
         *
         * @return      $key    Current key in iteration
         */
-       public function key () {
+       public function key (): int {
                // Default is null
                $key = NULL;
 
@@ -90,7 +90,7 @@ class NodePingIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function next () {
+       public function next (): void {
                DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
@@ -99,7 +99,7 @@ class NodePingIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function rewind () {
+       public function rewind (): void {
                DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
@@ -108,7 +108,7 @@ class NodePingIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function valid () {
+       public function valid (): bool {
                DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
        }
 
index a4281a501056e38c98905016dad90482fc80daf6..a413d16b38d77ac7ddb09cad0b31048effb68ab9 100644 (file)
@@ -55,7 +55,7 @@ class HandlerPoolIterator extends BaseIterator implements Iterator {
         * @param       $listInstance           A list of a Listable
         * @return      $iteratorInstance       An instance a Iterator class
         */
-       public static final function createHandlerPoolIterator (Listable $listInstance) {
+       public static final function createHandlerPoolIterator (Listable $listInstance): HandlerPoolIterator {
                // Get new instance
                $iteratorInstance = new HandlerPoolIterator();
 
@@ -72,7 +72,7 @@ class HandlerPoolIterator extends BaseIterator implements Iterator {
         * @return      $current        Current value in iteration
         * @throws      IndexOutOfBoundsException       If $indexKey is out of bounds
         */
-       public function current () {
+       public function current (): mixed {
                // Default is null
                $current = NULL;
 
@@ -94,7 +94,7 @@ class HandlerPoolIterator extends BaseIterator implements Iterator {
         *
         * @return      $indexKey       Current key in iteration
         */
-       public function key () {
+       public function key (): int {
                return $this->indexKey;
        }
 
@@ -103,7 +103,7 @@ class HandlerPoolIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function next () {
+       public function next (): void {
                $this->indexKey++;
        }
 
@@ -112,7 +112,7 @@ class HandlerPoolIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function rewind () {
+       public function rewind (): void {
                $this->indexKey = 0;
        }
 
@@ -121,7 +121,7 @@ class HandlerPoolIterator extends BaseIterator implements Iterator {
         *
         * @return      $isValid        Whether the current entry is there
         */
-       public function valid () {
+       public function valid (): bool {
                // Check for total active peers and if we are not at the end
                $isValid = ($this->key() < $this->getListInstance()->count());
 
index c91eb8907ffc2d2fd9ddc5b5ed7f9229269ca3cb..203655ef54ac18ec8b2f179c08f7dafdbe1805f6 100644 (file)
@@ -56,7 +56,7 @@ class MonitorPoolIterator extends BaseIterator implements Iterator, Registerable
         * @param       $listInstance           A list of a Listable
         * @return      $iteratorInstance       An instance a Iterator class
         */
-       public static final function createMonitorPoolIterator (Listable $listInstance) {
+       public static final function createMonitorPoolIterator (Listable $listInstance): MonitorPoolIterator {
                // Get new instance
                $iteratorInstance = new MonitorPoolIterator();
 
@@ -73,7 +73,7 @@ class MonitorPoolIterator extends BaseIterator implements Iterator, Registerable
         * @return      $current        Current value in iteration
         * @throws      IndexOutOfBoundsException       If $indexKey is out of bounds
         */
-       public function current () {
+       public function current (): mixed {
                // Default is null
                $current = NULL;
 
@@ -95,7 +95,7 @@ class MonitorPoolIterator extends BaseIterator implements Iterator, Registerable
         *
         * @return      $indexKey       Current key in iteration
         */
-       public function key () {
+       public function key (): int {
                return $this->indexKey;
        }
 
@@ -104,7 +104,7 @@ class MonitorPoolIterator extends BaseIterator implements Iterator, Registerable
         *
         * @return      void
         */
-       public function next () {
+       public function next (): void {
                $this->indexKey++;
        }
 
@@ -113,7 +113,7 @@ class MonitorPoolIterator extends BaseIterator implements Iterator, Registerable
         *
         * @return      void
         */
-       public function rewind () {
+       public function rewind (): void {
                $this->indexKey = 0;
        }
 
@@ -122,7 +122,7 @@ class MonitorPoolIterator extends BaseIterator implements Iterator, Registerable
         *
         * @return      $isValid        Whether the current entry is there
         */
-       public function valid () {
+       public function valid (): bool {
                // Check for total active peers and if we are not at the end
                $isValid = ($this->key() < $this->getListInstance()->count());
 
index e28a62cde254d49e33cacb2c6dfc8abfce7e0315..b95b77562deb38263369340c3bd603b1c6d082f1 100644 (file)
@@ -53,7 +53,7 @@ class ShutdownPoolIterator extends BaseIterator implements Iterator {
         * @param       $listInstance           A list of a Listable
         * @return      $iteratorInstance       An instance a Iterator class
         */
-       public static final function createShutdownPoolIterator (Listable $listInstance) {
+       public static final function createShutdownPoolIterator (Listable $listInstance): ShutdownPoolIterator {
                // Get new instance
                $iteratorInstance = new ShutdownPoolIterator();
 
@@ -70,7 +70,7 @@ class ShutdownPoolIterator extends BaseIterator implements Iterator {
         * @return      $current        Current value in iteration
         * @throws      IndexOutOfBoundsException       If $indexKey is out of bounds
         */
-       public function current () {
+       public function current (): mixed {
                // Default is null
                $current = NULL;
 
@@ -92,7 +92,7 @@ class ShutdownPoolIterator extends BaseIterator implements Iterator {
         *
         * @return      $indexKey       Current key in iteration
         */
-       public function key () {
+       public function key (): int {
                return $this->indexKey;
        }
 
@@ -101,7 +101,7 @@ class ShutdownPoolIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function next () {
+       public function next (): void {
                $this->indexKey++;
        }
 
@@ -110,7 +110,7 @@ class ShutdownPoolIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function rewind () {
+       public function rewind (): void {
                $this->indexKey = 0;
        }
 
@@ -119,7 +119,7 @@ class ShutdownPoolIterator extends BaseIterator implements Iterator {
         *
         * @return      $isValid        Whether the current entry is there
         */
-       public function valid () {
+       public function valid (): bool {
                // Check for total active peers and if we are not at the end
                $isValid = ($this->key() < $this->getListInstance()->count());
 
index ee2084fdc2a12961510f4cd8b62c7302a4168c67..77c76786bcd28aaf543d56d479175ca5cad9569a 100644 (file)
@@ -56,7 +56,7 @@ class TaskPoolIterator extends BaseIterator implements Iterator, Registerable {
         * @param       $listInstance           A list of a Listable
         * @return      $iteratorInstance       An instance a Iterator class
         */
-       public static final function createTaskPoolIterator (Listable $listInstance) {
+       public static final function createTaskPoolIterator (Listable $listInstance): TaskPoolIterator {
                // Get new instance
                $iteratorInstance = new TaskPoolIterator();
 
@@ -73,7 +73,7 @@ class TaskPoolIterator extends BaseIterator implements Iterator, Registerable {
         * @return      $current        Current value in iteration
         * @throws      IndexOutOfBoundsException       If $indexKey is out of bounds
         */
-       public function current () {
+       public function current (): mixed {
                // Default is null
                $current = NULL;
 
@@ -95,7 +95,7 @@ class TaskPoolIterator extends BaseIterator implements Iterator, Registerable {
         *
         * @return      $indexKey       Current key in iteration
         */
-       public function key () {
+       public function key (): int {
                return $this->indexKey;
        }
 
@@ -104,7 +104,7 @@ class TaskPoolIterator extends BaseIterator implements Iterator, Registerable {
         *
         * @return      void
         */
-       public function next () {
+       public function next (): void {
                $this->indexKey++;
        }
 
@@ -113,7 +113,7 @@ class TaskPoolIterator extends BaseIterator implements Iterator, Registerable {
         *
         * @return      void
         */
-       public function rewind () {
+       public function rewind (): void {
                $this->indexKey = 0;
        }
 
@@ -122,7 +122,7 @@ class TaskPoolIterator extends BaseIterator implements Iterator, Registerable {
         *
         * @return      $isValid        Whether the current entry is there
         */
-       public function valid () {
+       public function valid (): bool {
                // Check for total active peers and if we are not at the end
                $isValid = ($this->key() < $this->getListInstance()->count());
 
index 3f017b4f64f907737c2be2994ac3f4531431b274..e6241bb92179d8518c4971410274682b9a2fb595 100644 (file)
@@ -76,7 +76,7 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
         *
         * @return      $iteratorInstance       An instance of a Iterator class
         */
-       public final static function createTestUnitKeyProducerIterator () {
+       public final static function createTestUnitKeyProducerIterator (): TestUnitKeyProducerIterator {
                // Get new instance
                $iteratorInstance = new TestUnitKeyProducerIterator();
 
@@ -89,7 +89,7 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
         *
         * @return      $current        Current value in iteration
         */
-       public function current () {
+       public function current (): mixed {
                // Calculate ASCII string representation of the key number
                $current = $this->dec2asc($this->currentIteration);
 
@@ -106,7 +106,7 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
         * @return      $key    Current key in iteration
         * @throws      UnsupportedOperationException   This method should not be called
         */
-       public function key () {
+       public function key (): int {
                throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
@@ -115,7 +115,7 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function next () {
+       public function next (): void {
                /*
                 * This is of course a very ineffective key generation iterator because
                 * it will create a lot of keys that will never decode an encrypted
@@ -131,7 +131,7 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
         * @return      void
         * @throws      UnsupportedOperationException   This method should not be called
         */
-       public function rewind () {
+       public function rewind (): void {
                throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
@@ -140,7 +140,7 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
         *
         * @return      void
         */
-       public function valid () {
+       public function valid (): bool {
                return ($this->currentIteration <= $this->maxBits);
        }
 
diff --git a/core b/core
index 3ad2578dc223f97de06547be49d66e7adfea677c..76a44f7f1b907c63484c751f1fcf19730c553b7d 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 3ad2578dc223f97de06547be49d66e7adfea677c
+Subproject commit 76a44f7f1b907c63484c751f1fcf19730c553b7d