]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/factories/states/miner/class_MinerStateFactory.php
Instance 'miner' is now added to registry in BaseHubMiner.
[hub.git] / application / hub / main / factories / states / miner / class_MinerStateFactory.php
index b947915c54868e0addfeadc6093c884783ceebde..2b2a7e02f034dcb9d6906c766a0cd52d66fcc570 100644 (file)
@@ -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() . '.');