]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/tasks/idle/class_IdleLoopTask.php
Continued:
[core.git] / framework / main / classes / tasks / idle / class_IdleLoopTask.php
index 7652b5888a301c6436291533f8e90e3dda494137..7b844a37607131502c6125d74ce1beb640868d7c 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Mxchange\CoreFramework\Task\IdleLoop;
 
 // Import Framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Task\BaseTask;
 use Org\Mxchange\CoreFramework\Task\Taskable;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
@@ -13,7 +14,7 @@ use Org\Mxchange\CoreFramework\Visitor\Visitor;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -41,12 +42,12 @@ class IdleLoopTask extends BaseTask implements Taskable, Visitable {
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
 
                // Init idle loop time from config ("cache" it here)
-               $this->idleTime = $this->getConfigInstance()->getConfigEntry('idle_loop_time');
+               $this->idleTime = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('idle_loop_time');
        }
 
        /**
@@ -54,7 +55,7 @@ class IdleLoopTask extends BaseTask implements Taskable, Visitable {
         *
         * @return      $taskInstance   An instance of a Taskable/Visitable class
         */
-       public static final function createIdleLoopTask () {
+       public static final function createIdleLoopTask (): Taskable {
                // Get new instance
                $taskInstance = new IdleLoopTask();
 
@@ -68,7 +69,7 @@ class IdleLoopTask extends BaseTask implements Taskable, Visitable {
         * @param       $visitorInstance        An instance of a Visitor class
         * @return      void
         */
-       public function accept (Visitor $visitorInstance) {
+       public function accept (Visitor $visitorInstance): void {
                // Visit this task
                $visitorInstance->visitTask($this);
        }
@@ -78,7 +79,7 @@ class IdleLoopTask extends BaseTask implements Taskable, Visitable {
         *
         * @return      void
         */
-       public function executeTask () {
+       public function executeTask (): void {
                // Idle here a little
                $this->idle($this->idleTime);
        }
@@ -88,9 +89,9 @@ class IdleLoopTask extends BaseTask implements Taskable, Visitable {
         *
         * @return      void
         */
-       public function doShutdown () {
+       public function doShutdown (): void {
                // Debug message
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK: Shutting down...');
        }
 
 }