From fa99247ab5fbc35b3d95e5dcd9c1772c386fbf5d Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 17 Mar 2014 23:07:24 +0100 Subject: [PATCH] No 'this' in static methods. ;-) Signed-off-by: Roland Haeder --- .../hub/main/factories/node/class_NodeObjectFactory.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/application/hub/main/factories/node/class_NodeObjectFactory.php b/application/hub/main/factories/node/class_NodeObjectFactory.php index 2a6d54f2e..3b676eb7a 100644 --- a/application/hub/main/factories/node/class_NodeObjectFactory.php +++ b/application/hub/main/factories/node/class_NodeObjectFactory.php @@ -41,13 +41,16 @@ class NodeObjectFactory extends ObjectFactory { * @throws FactoryRequiredParameterException If not all parameters are set and no instance 'node' is set. */ public static final function createNodeInstance (Requestable $requestInstance = NULL, Responseable $responseInstance = NULL) { + // Get new factory instance + $factoryInstance = new NodeObjectFactory(); + // If there is no handler? if (Registry::getRegistry()->instanceExists('node')) { // Get handler from registry $nodeInstance = NodeObjectFactory::createNodeInstance(); } elseif (($requestInstance instanceof Requestable) && ($responseInstance instanceof Responseable)) { // The default node-mode is from our configuration - $nodeMode = $this->getConfigInstance()->getConfigEntry('node_default_mode'); + $nodeMode = $factoryInstance->getConfigInstance()->getConfigEntry('node_default_mode'); // Is the node 'mode' parameter set? if ($requestInstance->isRequestElementSet('mode')) { @@ -59,7 +62,7 @@ class NodeObjectFactory extends ObjectFactory { } // Now convert the node-mode in a class name - $className = 'Hub' . $this->convertToClassName($nodeMode) . 'Node'; + $className = 'Hub' . $factoryInstance->convertToClassName($nodeMode) . 'Node'; // Get the node instance $nodeInstance = ObjectFactory::createObjectByName($className, array($requestInstance)); @@ -77,7 +80,7 @@ class NodeObjectFactory extends ObjectFactory { Registry::getRegistry()->addInstance('node', $nodeInstance); } else { // Throw an exception here - throw new FactoryRequiredParameterException(new NodeObjectFactory(), self::EXCEPTION_FACTORY_REQUIRE_PARAMETER); + throw new FactoryRequiredParameterException($factoryInstance, self::EXCEPTION_FACTORY_REQUIRE_PARAMETER); } // Return the instance -- 2.39.5