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;
*
* @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
*
*
* @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');
}
/**
*
* @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();
* @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);
}
*
* @return void
*/
- public function executeTask () {
+ public function executeTask (): void {
// Idle here a little
$this->idle($this->idleTime);
}
*
* @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...');
}
}