* given miner instance.
*
* @param $stateName Name of the state
- * @param $minerInstance A MinerHelper class instance
* @return $stateInstance A Stateable class instance
*/
- public static final function createMinerStateInstanceByName ($stateName, MinerHelper $minerInstance) {
+ public static final function createMinerStateInstanceByName ($stateName) {
// Then construct the class' configuraton entry
$className = 'miner_' . $stateName . '_state_class';
+ // Get miner instance
+ $minerInstance = Registry::getRegistry()->getInstance('miner');
+
// Get a class from that configuration entry
- $stateInstance = self::createObjectByConfiguredName($className, array($minerInstance));
+ $stateInstance = self::createObjectByConfiguredName($className);
// Debug message
self::createDebugInstance(__CLASS__)->debugOutput('MINER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Miner state has changed from ' . $minerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');