X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fhub%2Fmain%2Ffactories%2Fstates%2Fminer%2Fclass_MinerStateFactory.php;fp=application%2Fhub%2Fmain%2Ffactories%2Fstates%2Fminer%2Fclass_MinerStateFactory.php;h=2b2a7e02f034dcb9d6906c766a0cd52d66fcc570;hb=99d8bcb8c9474a6c8b8178bceee48545aeda7467;hp=b947915c54868e0addfeadc6093c884783ceebde;hpb=79acde36944b08ef27370877a9844e40a0fa26ff;p=hub.git diff --git a/application/hub/main/factories/states/miner/class_MinerStateFactory.php b/application/hub/main/factories/states/miner/class_MinerStateFactory.php index b947915c5..2b2a7e02f 100644 --- a/application/hub/main/factories/states/miner/class_MinerStateFactory.php +++ b/application/hub/main/factories/states/miner/class_MinerStateFactory.php @@ -37,15 +37,17 @@ class MinerStateFactory extends ObjectFactory { * 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() . '.');