]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/factories/states/cruncher/class_CruncherStateFactory.php
Updated 'core'.
[hub.git] / application / hub / main / factories / states / cruncher / class_CruncherStateFactory.php
index ce1963bc563f998e8c6f30a97893a38578fc2fd1..8701aa589cea01ad924340e6609809668dafbfd1 100644 (file)
@@ -40,15 +40,18 @@ class CruncherStateFactory extends ObjectFactory {
         * @param       $cruncherInstance       A CruncherHelper class instance
         * @return      $stateInstance          A Stateable class instance
         */
-       public static final function createCruncherStateInstanceByName ($stateName, CruncherHelper $cruncherInstance) {
+       public static final function createCruncherStateInstanceByName ($stateName) {
                // Then construct the class' configuraton entry
                $className = 'cruncher_' . $stateName . '_state_class';
 
+               // Get cruncher instance from registry
+               $cruncherInstance = Registry::getRegistry()->getInstance('cruncher');
+
                // Get a class from that configuration entry
-               $stateInstance = self::createObjectByConfiguredName($className, array($cruncherInstance));
+               $stateInstance = self::createObjectByConfiguredName($className);
 
                // Debug message
-               self::createDebugInstance(__CLASS__)->debugOutput('CRUNCHER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Cruncher state has changed from ' . $nodeInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
+               self::createDebugInstance(__CLASS__)->debugOutput('CRUNCHER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Cruncher state has changed from ' . $cruncherInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
 
                // Once we have that state, set it in the cruncher instance
                $cruncherInstance->setStateInstance($stateInstance);