From: Roland Haeder Date: Wed, 27 May 2015 01:28:27 +0000 (+0200) Subject: Method convertToClassName() and convertDashesToUnderscores() are now static as X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=948e194bc84bf2219426dc56ad7481d04cd82374 Method convertToClassName() and convertDashesToUnderscores() are now static as they don't use any object context. Signed-off-by: Roland Häder --- diff --git a/application/tests/class_ApplicationHelper.php b/application/tests/class_ApplicationHelper.php index c8b407a5..7e0de1fc 100644 --- a/application/tests/class_ApplicationHelper.php +++ b/application/tests/class_ApplicationHelper.php @@ -157,7 +157,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica $responseType = self::getResponseTypeFromSystem(); // Create a new request object - $requestInstance = ObjectFactory::createObjectByName($this->convertToClassName($response) . 'Request'); + $requestInstance = ObjectFactory::createObjectByName(self::convertToClassName($response) . 'Request'); // Remember request instance here $this->setRequestInstance($requestInstance); @@ -170,7 +170,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica } // END - if // ... and a new response object - $responseClass = sprintf('%sResponse', $this->convertToClassName($response)); + $responseClass = sprintf('%sResponse', self::convertToClassName($response)); $responseInstance = ObjectFactory::createObjectByName($responseClass, array($this)); // Remember response instance here @@ -189,7 +189,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica } // END - if // Get a controller resolver - $resolverClass = $this->convertToClassName($this->getAppShortName() . '_' . $responseType . '_controller_resolver'); + $resolverClass = self::convertToClassName($this->getAppShortName() . '_' . $responseType . '_controller_resolver'); $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName, $this)); // Get a controller instance as well diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 85aeda63..d523e639 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -1891,12 +1891,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @param $str The string, what ever it is needs to be converted * @return $className Generated class name */ - public function convertToClassName ($str) { + public static final function convertToClassName ($str) { // Init class name $className = ''; // Convert all dashes in underscores - $str = $this->convertDashesToUnderscores($str); + $str = self::convertDashesToUnderscores($str); // Now use that underscores to get classname parts for hungarian style foreach (explode('_', $str) as $strPart) { @@ -1914,7 +1914,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @param $str The string with maybe dashes inside * @return $str The converted string with no dashed, but underscores */ - public final function convertDashesToUnderscores ($str) { + public static final function convertDashesToUnderscores ($str) { // Convert them all $str = str_replace('-', '_', $str); @@ -2084,7 +2084,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.':
'.print_r($fieldArray, TRUE).'
'); // Convert dashes to underscore - $fieldName2 = $this->convertDashesToUnderscores($fieldName); + $fieldName2 = self::convertDashesToUnderscores($fieldName); // Does the field exist? if ($this->isFieldSet($fieldName)) { @@ -2124,7 +2124,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . $this->__toString() . ':' . __LINE__ . '] fieldName=' . $fieldName . ',fieldArray=
'.print_r($fieldArray, TRUE).'
'); // Convert dashes to underscore - $fieldName = $this->convertDashesToUnderscores($fieldName); + $fieldName = self::convertDashesToUnderscores($fieldName); // Determine it $isSet = isset($fieldArray[$fieldName]); diff --git a/inc/classes/main/commands/html/class_HtmlLoginAreaCommand.php b/inc/classes/main/commands/html/class_HtmlLoginAreaCommand.php index 555f246c..e1d0eb95 100644 --- a/inc/classes/main/commands/html/class_HtmlLoginAreaCommand.php +++ b/inc/classes/main/commands/html/class_HtmlLoginAreaCommand.php @@ -171,7 +171,7 @@ class HtmlLoginAreaCommand extends BaseCommand implements Commandable { $applicationInstance = $registryInstance->getInstance('application'); // Default action is the one from configuration - $this->actionName = $this->convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . $this->getConfigInstance()->getConfigEntry('login_default_action'); + $this->actionName = self::convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . $this->getConfigInstance()->getConfigEntry('login_default_action'); // Get "action" from request $actReq = $requestInstance->getRequestElement('action'); @@ -179,7 +179,7 @@ class HtmlLoginAreaCommand extends BaseCommand implements Commandable { // Do we have a "action" parameter set? if ((is_string($actReq)) && (!empty($actReq))) { // Then use it with prefix - $this->actionName = $this->convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . $actReq; + $this->actionName = self::convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . $actReq; } // END - if // Get application instance diff --git a/inc/classes/main/criteria/class_BaseCriteria.php b/inc/classes/main/criteria/class_BaseCriteria.php index 86e67857..400ed06c 100644 --- a/inc/classes/main/criteria/class_BaseCriteria.php +++ b/inc/classes/main/criteria/class_BaseCriteria.php @@ -142,7 +142,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE)); // Convert dashes to underscore - $criteriaKey = $this->convertDashesToUnderscores($criteriaKey); + $criteriaKey = self::convertDashesToUnderscores($criteriaKey); // "Walk" through all criterias foreach ($this->getGenericArray('criteria') as $criteriaType => $dummy) { @@ -165,7 +165,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue))); // Convert dashes to underscore - $criteriaKey = $this->convertDashesToUnderscores($criteriaKey); + $criteriaKey = self::convertDashesToUnderscores($criteriaKey); // Debug message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue); @@ -190,7 +190,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue); // Add it - $this->pushValueToGenericArrayElement('criteria', 'choice', 'entries', $this->convertDashesToUnderscores($criteriaKey), (string) $criteriaValue); + $this->pushValueToGenericArrayElement('criteria', 'choice', 'entries', self::convertDashesToUnderscores($criteriaKey), (string) $criteriaValue); } /** @@ -232,7 +232,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE)); // Convert dashes to underscore - $criteriaKey = $this->convertDashesToUnderscores($criteriaKey); + $criteriaKey = self::convertDashesToUnderscores($criteriaKey); // Debug message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteria()=' . $this->countGenericArrayGroup('criteria', $criteriaType))); @@ -290,7 +290,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { assert((strpos($key, 'my-') === FALSE) && (strpos($key, 'my_') === FALSE)); // Convert dashes to underscore - $key = $this->convertDashesToUnderscores($key); + $key = self::convertDashesToUnderscores($key); // Then walk through all search criteria foreach ($this->getGenericArrayKey('criteria', $criteriaType, 'entries') as $criteriaKey => $criteriaValue) { @@ -298,7 +298,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue))); // Convert dashes to underscore - $criteriaKey = $this->convertDashesToUnderscores($criteriaKey); + $criteriaKey = self::convertDashesToUnderscores($criteriaKey); // Is the element found and does it match? if (($key == $criteriaKey) && ($criteriaValue == $entry)) { @@ -363,7 +363,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { assert(!is_array($criteriaValue)); // Convert dashes to underscore - $criteriaKey = $this->convertDashesToUnderscores($criteriaKey); + $criteriaKey = self::convertDashesToUnderscores($criteriaKey); // Is the value in array or is $onlyKeys empty? if ((isset($onlyKeys[$criteriaKey])) || (count($onlyKeys) == 0)) { diff --git a/inc/classes/main/feature/class_FrameworkFeature.php b/inc/classes/main/feature/class_FrameworkFeature.php index 46d61ff0..77f9431b 100644 --- a/inc/classes/main/feature/class_FrameworkFeature.php +++ b/inc/classes/main/feature/class_FrameworkFeature.php @@ -140,7 +140,7 @@ class FrameworkFeature extends BaseFrameworkSystem implements Feature { assert(self::isFeatureAvailable($featureName)); // Array for call-back - $callable = array(self::$enabledFeatures[$featureName]['instance'], $featureMethod); + $callable = array(self::$enabledFeatures[$featureName]['instance'], 'featureMethod' . self::convertToClassName($featureMethod)); // So is the feature's method callable? if (!is_callable($callable)) { diff --git a/inc/classes/main/helper/class_BaseHelper.php b/inc/classes/main/helper/class_BaseHelper.php index a8c513c0..c06f86fd 100644 --- a/inc/classes/main/helper/class_BaseHelper.php +++ b/inc/classes/main/helper/class_BaseHelper.php @@ -188,7 +188,7 @@ class BaseHelper extends BaseFrameworkSystem { //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'='.$fieldValue); // Now filter it through the value through the filter method - $filteredValue = call_user_func_array(array($this, 'doFilter' . $this->convertToClassName($filterMethod)), array($fieldValue)); + $filteredValue = call_user_func_array(array($this, 'doFilter' . self::convertToClassName($filterMethod)), array($fieldValue)); // Assign it with a template variable $this->getTemplateInstance()->assignVariable('block_' . $fieldName, $filteredValue); diff --git a/inc/classes/main/request/html/class_HtmlRequest.php b/inc/classes/main/request/html/class_HtmlRequest.php index e808c710..edf9c9a4 100644 --- a/inc/classes/main/request/html/class_HtmlRequest.php +++ b/inc/classes/main/request/html/class_HtmlRequest.php @@ -102,7 +102,7 @@ class HtmlRequest extends BaseRequest implements Requestable { $headerValue = NULL; // Construct the name - $name = 'HTTP_' . strtoupper($this->convertDashesToUnderscores($headerName)); + $name = 'HTTP_' . strtoupper(self::convertDashesToUnderscores($headerName)); // Does this header exist? if (isset($_SERVER[$name])) { diff --git a/inc/classes/main/resolver/action/class_BaseActionResolver.php b/inc/classes/main/resolver/action/class_BaseActionResolver.php index c8daf001..44836e9d 100644 --- a/inc/classes/main/resolver/action/class_BaseActionResolver.php +++ b/inc/classes/main/resolver/action/class_BaseActionResolver.php @@ -75,7 +75,7 @@ class BaseActionResolver extends BaseResolver { } // END - if // Create class name - $className = $this->getCapitalizedClassPrefix() . $this->convertToClassName($actionName) . 'Action'; + $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($actionName) . 'Action'; // Now, let us create the full name of the action class $this->setClassName($className); @@ -103,7 +103,7 @@ class BaseActionResolver extends BaseResolver { $actionInstance = NULL; // Create action class name - $className = $this->getCapitalizedClassPrefix() . $this->convertToClassName($this->getActionName()) . 'Action'; + $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($this->getActionName()) . 'Action'; // ... and set it $this->setClassName($className); diff --git a/inc/classes/main/resolver/class_BaseResolver.php b/inc/classes/main/resolver/class_BaseResolver.php index 1e9274f2..e6582f1a 100644 --- a/inc/classes/main/resolver/class_BaseResolver.php +++ b/inc/classes/main/resolver/class_BaseResolver.php @@ -73,7 +73,7 @@ class BaseResolver extends BaseFrameworkSystem { $className = $this->getClassPrefix(); // And capitalize it - $className = $this->convertToClassName($className); + $className = self::convertToClassName($className); // Return it return $className; diff --git a/inc/classes/main/resolver/command/class_BaseCommandResolver.php b/inc/classes/main/resolver/command/class_BaseCommandResolver.php index c750238d..ff444fd7 100644 --- a/inc/classes/main/resolver/command/class_BaseCommandResolver.php +++ b/inc/classes/main/resolver/command/class_BaseCommandResolver.php @@ -46,7 +46,7 @@ class BaseCommandResolver extends BaseResolver { $commandInstance = NULL; // Create class name - $className = $this->getCapitalizedClassPrefix() . $this->convertToClassName($commandName) . 'Command'; + $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($commandName) . 'Command'; // Create command class name $this->setClassName($className); @@ -157,7 +157,7 @@ class BaseCommandResolver extends BaseResolver { } // END - if // Create the full class name - $className = $this->getCapitalizedClassPrefix() . $this->convertToClassName($commandName) . 'Command'; + $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($commandName) . 'Command'; // Now, let us create the full name of the command class $this->setClassName($className); diff --git a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php index 5091c750..5615515a 100644 --- a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php +++ b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php @@ -57,7 +57,7 @@ class BaseControllerResolver extends BaseResolver { //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BEFORE: controller=' . $controllerName); if ($controllerName != $defaultController) { // Create controller class name - $className = $this->getCapitalizedClassPrefix() . $this->convertToClassName($controllerName) . 'Controller'; + $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($controllerName) . 'Controller'; // ... and set it $this->setClassName($className); @@ -118,7 +118,7 @@ class BaseControllerResolver extends BaseResolver { } // END - if // Create class name - $className = $this->getCapitalizedClassPrefix() . $this->convertToClassName($controllerName) . 'Controller'; + $className = $this->getCapitalizedClassPrefix() . self::convertToClassName($controllerName) . 'Controller'; // Now, let us create the full name of the controller class $this->setClassName($className); diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index 69b86079..012e4673 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -178,7 +178,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ private function getVariableIndex ($variableName, $variableGroup = NULL) { // Replace all dashes to underscores to match variables with configuration entries - $variableName = trim($this->convertDashesToUnderscores($variableName)); + $variableName = trim(self::convertDashesToUnderscores($variableName)); // First everything is not found $found = FALSE; @@ -253,7 +253,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ protected function readVariable ($variableName, $variableGroup = NULL) { // Replace all dashes to underscores to match variables with configuration entries - $variableName = trim($this->convertDashesToUnderscores($variableName)); + $variableName = trim(self::convertDashesToUnderscores($variableName)); // First everything is not found $content = NULL; @@ -341,7 +341,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ public function addGroupVariable ($variableName, $value) { // Replace all dashes to underscores to match variables with configuration entries - $variableName = trim($this->convertDashesToUnderscores($variableName)); + $variableName = trim(self::convertDashesToUnderscores($variableName)); // Debug message //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': group=' . $this->currGroup . ', variableName=' . $variableName . ', value=' . $value); @@ -378,7 +378,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ private function modifyVariable ($variableName, $value) { // Replace all dashes to underscores to match variables with configuration entries - $variableName = trim($this->convertDashesToUnderscores($variableName)); + $variableName = trim(self::convertDashesToUnderscores($variableName)); // Get index for variable $index = $this->getVariableIndex($variableName); @@ -417,7 +417,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ protected function setVariable ($variableGroup, $variableName, $value) { // Replace all dashes to underscores to match variables with configuration entries - $variableName = trim($this->convertDashesToUnderscores($variableName)); + $variableName = trim(self::convertDashesToUnderscores($variableName)); // Get index for variable $index = $this->getVariableIndex($variableName); @@ -448,7 +448,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ private function generateVariableArray ($variableName, $value) { // Replace all dashes to underscores to match variables with configuration entries - $variableName = trim($this->convertDashesToUnderscores($variableName)); + $variableName = trim(self::convertDashesToUnderscores($variableName)); // Generate the temporary array $varData = array( @@ -749,7 +749,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ private function assignTemplateVariable ($variableName, $var) { // Replace all dashes to underscores to match variables with configuration entries - $variableName = trim($this->convertDashesToUnderscores($variableName)); + $variableName = trim(self::convertDashesToUnderscores($variableName)); // Debug message //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: variableName=' . $variableName . ',variableName=' . $variableName); @@ -967,7 +967,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Search for all variables foreach ($varMatches[1] as $key => $var) { // Replace all dashes to underscores to match variables with configuration entries - $var = trim($this->convertDashesToUnderscores($var)); + $var = trim(self::convertDashesToUnderscores($var)); // Debug message self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:key=' . $key . ',var=' . $var); @@ -1110,7 +1110,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ public final function assignVariable ($variableName, $value) { // Replace all dashes to underscores to match variables with configuration entries - $variableName = trim($this->convertDashesToUnderscores($variableName)); + $variableName = trim(self::convertDashesToUnderscores($variableName)); // Empty variable found? if (empty($variableName)) { @@ -1178,7 +1178,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ public function assignConfigVariable ($variableName) { // Replace all dashes to underscores to match variables with configuration entries - $variableName = trim($this->convertDashesToUnderscores($variableName)); + $variableName = trim(self::convertDashesToUnderscores($variableName)); // Sweet and simple... //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: variableName=' . $variableName . ',getConfigEntry()=' . $this->getConfigInstance()->getConfigEntry($variableName)); @@ -1448,7 +1448,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Is this view helper loaded? if (!isset($this->helpers[$helperName])) { // Create a class name - $className = $this->convertToClassName($helperName) . 'ViewHelper'; + $className = self::convertToClassName($helperName) . 'ViewHelper'; // Generate new instance $this->helpers[$helperName] = ObjectFactory::createObjectByName($className); diff --git a/inc/classes/main/template/image/class_ImageTemplateEngine.php b/inc/classes/main/template/image/class_ImageTemplateEngine.php index 5c56f367..3b7b8da0 100644 --- a/inc/classes/main/template/image/class_ImageTemplateEngine.php +++ b/inc/classes/main/template/image/class_ImageTemplateEngine.php @@ -163,10 +163,10 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl //* DEBUG: */ echo "START: >".$element."<
\n"; if (in_array($element, $this->mainNodes)) { // Okay, main node found! - $methodName = 'setImage' . $this->convertToClassName($element); + $methodName = 'setImage' . self::convertToClassName($element); } elseif (in_array($element, $this->subNodes)) { // Sub node found - $methodName = 'setImageProperty' . $this->convertToClassName($element); + $methodName = 'setImageProperty' . self::convertToClassName($element); } elseif ($element != 'image') { // Invalid node name found throw new InvalidXmlNodeException(array($this, $element, $attributes), XmlParser::EXCEPTION_XML_NODE_UNKNOWN); @@ -200,7 +200,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl } // Construct method name - $methodName = 'finish' . $this->convertToClassName($nodeName); + $methodName = 'finish' . self::convertToClassName($nodeName); // Call the corresponding method call_user_func_array(array($this->getImageInstance(), $methodName), array()); @@ -252,7 +252,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl $imageType = $this->compileRawCode($imageType); // Now make a class name of it - $className = $this->convertToClassName($imageType.'_image'); + $className = self::convertToClassName($imageType.'_image'); // And try to initiate it $this->setImageInstance(ObjectFactory::createObjectByName($className, array($this))); diff --git a/inc/classes/main/template/mail/class_MailTemplateEngine.php b/inc/classes/main/template/mail/class_MailTemplateEngine.php index 7c66d76e..90ae7ccd 100644 --- a/inc/classes/main/template/mail/class_MailTemplateEngine.php +++ b/inc/classes/main/template/mail/class_MailTemplateEngine.php @@ -157,10 +157,10 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla //* DEBUG: */ echo "START: >".$element."<
\n"; if (in_array($element, $this->getMainNodes())) { // Okay, main node found! - $methodName = 'setEmail' . $this->convertToClassName($element); + $methodName = 'setEmail' . self::convertToClassName($element); } elseif (in_array($element, $this->getSubNodes())) { // Sub node found - $methodName = 'setEmailProperty' . $this->convertToClassName($element); + $methodName = 'setEmailProperty' . self::convertToClassName($element); } elseif ($element != 'text-mail') { // Invalid node name found throw new InvalidXmlNodeException(array($this, $element, $attributes), XmlParser::EXCEPTION_XML_NODE_UNKNOWN); @@ -194,7 +194,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla } // Construct method name - $methodName = 'finish' . $this->convertToClassName($nodeName); + $methodName = 'finish' . self::convertToClassName($nodeName); // Call the corresponding method call_user_func_array(array($this, $methodName), array()); diff --git a/inc/classes/main/template/menu/class_MenuTemplateEngine.php b/inc/classes/main/template/menu/class_MenuTemplateEngine.php index 62997fa8..f0237b1e 100644 --- a/inc/classes/main/template/menu/class_MenuTemplateEngine.php +++ b/inc/classes/main/template/menu/class_MenuTemplateEngine.php @@ -252,13 +252,13 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla //* DEBUG: */ echo "START: >".$element."<
\n"; if (in_array($element, $this->getMainNodes())) { // Okay, main node found! - $methodName = 'start' . $this->convertToClassName($element); + $methodName = 'start' . self::convertToClassName($element); // Set it $this->setCurrMainNode($element); } elseif (in_array($element, $this->getSubNodes())) { // Sub node found - $methodName = 'start' . $this->convertToClassName($element); + $methodName = 'start' . self::convertToClassName($element); } elseif ($element != 'menu') { // Invalid node name found throw new InvalidXmlNodeException(array($this, $element, $attributes), XmlParser::EXCEPTION_XML_NODE_UNKNOWN); @@ -289,7 +289,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla } // END - if // Construct method name - $methodName = 'finish' . $this->convertToClassName($nodeName); + $methodName = 'finish' . self::convertToClassName($nodeName); // Call the corresponding method //* DEBUG: */ echo "call: ".$methodName."
\n"; diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index d6ff28a2..5a206d5c 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -153,7 +153,7 @@ class FrameworkConfiguration implements Registerable { */ public function getConfigEntry ($configKey) { // Convert dashes to underscore - $configKey = $this->convertDashesToUnderscores($configKey); + $configKey = self::convertDashesToUnderscores($configKey); // Is a valid configuration key provided? if (empty($configKey)) { @@ -179,7 +179,7 @@ class FrameworkConfiguration implements Registerable { */ public final function setConfigEntry ($configKey, $configValue) { // Cast to string - $configKey = $this->convertDashesToUnderscores($configKey); + $configKey = self::convertDashesToUnderscores($configKey); // Is a valid configuration key key provided? if ((empty($configKey)) || (!is_string($configKey))) { @@ -208,7 +208,7 @@ class FrameworkConfiguration implements Registerable { */ public final function unsetConfigEntry ($configKey) { // Convert dashes to underscore - $configKey = $this->convertDashesToUnderscores($configKey); + $configKey = self::convertDashesToUnderscores($configKey); // Is the configuration key there? if (!$this->isConfigurationEntrySet($configKey)) {