From 575accd328d27eccb2bf3caddb564b291e0780df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 2 Dec 2020 06:37:52 +0100 Subject: [PATCH] Refacturing: - replaced $listInstance with trait MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../classes/iterator/class_BaseIterator.php | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/framework/main/classes/iterator/class_BaseIterator.php b/framework/main/classes/iterator/class_BaseIterator.php index c7ea6f09..6d082c04 100644 --- a/framework/main/classes/iterator/class_BaseIterator.php +++ b/framework/main/classes/iterator/class_BaseIterator.php @@ -5,6 +5,7 @@ namespace Org\Mxchange\CoreFramework\Iterator; // Import framework stuff use Org\Mxchange\CoreFramework\Lists\Listable; use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem; +use Org\Mxchange\CoreFramework\Traits\Lists\ListableTrait; // Import SPL stuff use \Iterator; @@ -32,10 +33,8 @@ use \Iterator; * along with this program. If not, see . */ abstract class BaseIterator extends BaseFrameworkSystem implements Iterator { - /** - * Instance of the list - */ - private $listInstance = NULL; + // Load traits + use ListableTrait; /** * Protected constructor @@ -48,23 +47,4 @@ abstract class BaseIterator extends BaseFrameworkSystem implements Iterator { parent::__construct($className); } - /** - * 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; - } - } -- 2.39.5