From a47467b7c3b875b36785e30ef71c34aca04fd778 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 2 Dec 2020 06:42:04 +0100 Subject: [PATCH] Continued: - replaced some instances with newly introduced traits - updated core framework MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../class_BaseRecipientDiscovery.php | 27 +++---------------- .../package/class_NetworkPackageHandler.php | 27 ++----------------- .../tasks/node/ping/class_NodePingTask.php | 27 +++---------------- core | 2 +- 4 files changed, 9 insertions(+), 74 deletions(-) diff --git a/application/hub/classes/discovery/recipient/class_BaseRecipientDiscovery.php b/application/hub/classes/discovery/recipient/class_BaseRecipientDiscovery.php index 0591f214f..1a1b2cdfb 100644 --- a/application/hub/classes/discovery/recipient/class_BaseRecipientDiscovery.php +++ b/application/hub/classes/discovery/recipient/class_BaseRecipientDiscovery.php @@ -8,7 +8,7 @@ use Org\Shipsimu\Hub\Discovery\Recipient\DiscoverableRecipient; use Org\Shipsimu\Hub\Factory\Lists\Recipient\RecipientListFactory; // Import framework stuff -use Org\Mxchange\CoreFramework\Lists\Listable; +use Org\Mxchange\CoreFramework\Traits\Lists\ListableTrait; /** * A PackageRecipient discovery class @@ -33,10 +33,8 @@ use Org\Mxchange\CoreFramework\Lists\Listable; * along with this program. If not, see . */ abstract class BaseRecipientDiscovery extends BaseNodeDiscovery implements DiscoverableRecipient { - /** - * Instance of the list - */ - private $listInstance = NULL; + // Load traits + use ListableTrait; /** * Protected constructor @@ -56,25 +54,6 @@ abstract class BaseRecipientDiscovery extends BaseNodeDiscovery implements Disco $this->setListInstance($listInstance); } - /** - * Setter for the list instance - * - * @param $listInstance A list of Listable - * @return void - */ - protected final function setListInstance (Listable $listInstance) { - $this->listInstance = $listInstance; - } - - /** - * Getter for the list instance - * - * @return $listInstance A list of Listable - */ - protected final function getListInstance () { - return $this->listInstance; - } - /** * "Getter" for recipient iterator * diff --git a/application/hub/classes/handler/package/class_NetworkPackageHandler.php b/application/hub/classes/handler/package/class_NetworkPackageHandler.php index cc8ed5ccc..bd011d371 100644 --- a/application/hub/classes/handler/package/class_NetworkPackageHandler.php +++ b/application/hub/classes/handler/package/class_NetworkPackageHandler.php @@ -40,8 +40,8 @@ use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Socket\InvalidSocketException; use Org\Mxchange\CoreFramework\Traits\Crypto\CryptoTrait; +use Org\Mxchange\CoreFramework\Traits\Visitor\VisitorTrait; use Org\Mxchange\CoreFramework\Visitor\Visitable; -use Org\Mxchange\CoreFramework\Visitor\Visitor; // Import SPL stuff use \BadMethodCallException; @@ -88,6 +88,7 @@ use \UnexpectedValueException; class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Receivable, Registerable, Visitable { // Load traits use CryptoTrait; + use VisitorTrait; /** * Package mask for compressing package data: @@ -324,11 +325,6 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei */ private $compressorInstance = NULL; - /** - * Visitor handler instance - */ - private $visitorInstance = NULL; - /** * Protected constructor * @@ -419,25 +415,6 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei return $this->compressorInstance; } - /** - * Setter for visitor instance - * - * @param $visitorInstance A Visitor instance - * @return void - */ - protected final function setVisitorInstance (Visitor $visitorInstance) { - $this->visitorInstance = $visitorInstance; - } - - /** - * Getter for visitor instance - * - * @return $visitorInstance A Visitor instance - */ - protected final function getVisitorInstance () { - return $this->visitorInstance; - } - /** * Initialize all stackers * diff --git a/application/hub/classes/tasks/node/ping/class_NodePingTask.php b/application/hub/classes/tasks/node/ping/class_NodePingTask.php index c16243450..6102ba8ec 100644 --- a/application/hub/classes/tasks/node/ping/class_NodePingTask.php +++ b/application/hub/classes/tasks/node/ping/class_NodePingTask.php @@ -7,9 +7,9 @@ use Org\Shipsimu\Hub\Factory\Node\NodeObjectFactory; use Org\Shipsimu\Hub\Task\BaseHubTask; // Import framework stuff -use Org\Mxchange\CoreFramework\Lists\Listable; use Org\Mxchange\CoreFramework\Task\BaseTask; use Org\Mxchange\CoreFramework\Task\Taskable; +use Org\Mxchange\CoreFramework\Traits\Lists\ListableTrait; use Org\Mxchange\CoreFramework\Visitor\Visitable; use Org\Mxchange\CoreFramework\Visitor\Visitor; @@ -36,10 +36,8 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor; * along with this program. If not, see . */ class NodePingTask extends BaseHubTask implements Taskable, Visitable { - /** - * Instance of the list - */ - private $listInstance = NULL; + // Load traits + use ListableTrait; /** * Protected constructor @@ -73,25 +71,6 @@ class NodePingTask extends BaseHubTask implements Taskable, Visitable { return $taskInstance; } - /** - * Setter for the list instance - * - * @param $listInstance A list of Listable - * @return void - */ - protected final function setListInstance (Listable $listInstance) { - $this->listInstance = $listInstance; - } - - /** - * Getter for the list instance - * - * @return $listInstance A list of Listable - */ - protected final function getListInstance () { - return $this->listInstance; - } - /** * Accepts the visitor to process the visitor * diff --git a/core b/core index c30da7e11..575accd32 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit c30da7e118a91b814adb6e997a1e4a39d0f1cba4 +Subproject commit 575accd328d27eccb2bf3caddb564b291e0780df -- 2.39.5