From 1dd3c575552fbec19a613e364bf971cfb50fbc20 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 24 Mar 2015 01:09:09 +0100 Subject: [PATCH] Don't shorten variable names, even when they become long. If so, then find a better way of naming them. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../class_XmlRewriterTemplateDecorator.php | 2 +- .../template/class_BaseTemplateEngine.php | 42 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php b/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php index acdf71ea..f2fcfd48 100644 --- a/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php +++ b/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php @@ -318,7 +318,7 @@ class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableT /** * Getter for variable group array * - * @return $vargroups All variable groups + * @return $variableGroups All variable groups */ public final function getVariableGroups () { // Call the inner class' method diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index 60f5a3cd..94a6ce0e 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -124,7 +124,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { /** * All template groups except "general" */ - private $varGroups = array(); + private $variableGroups = array(); /** * Code begin @@ -327,7 +327,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Skip group 'general' if (($groupName != 'general') && ($add === TRUE)) { - $this->varGroups[$groupName] = 'OK'; + $this->variableGroups[$groupName] = 'OK'; } // END - if } @@ -359,13 +359,13 @@ class BaseTemplateEngine extends BaseFrameworkSystem { /** * Getter for variable value, throws a NoVariableException if the variable is not found * - * @param $varGroup Variable group to use + * @param $variableGroup Variable group to use * @param $index Index in variable array * @return $value Value to set */ - private function getVariableValue ($varGroup, $index) { + private function getVariableValue ($variableGroup, $index) { // Return it - return $this->varStack[$varGroup][$index]['value']; + return $this->varStack[$variableGroup][$index]['value']; } /** @@ -396,13 +396,13 @@ class BaseTemplateEngine extends BaseFrameworkSystem { /** * Sets a variable value for given variable group and index * - * @param $varGroup Variable group to use + * @param $variableGroup Variable group to use * @param $index Index in variable array * @param $value Value to set * @return void */ - private function setVariableValue ($varGroup, $index, $value) { - $this->varStack[$varGroup][$index]['value'] = $value; + private function setVariableValue ($variableGroup, $index, $value) { + $this->varStack[$variableGroup][$index]['value'] = $value; } /** @@ -410,12 +410,12 @@ class BaseTemplateEngine extends BaseFrameworkSystem { * variable is already set. If so, the variable got modified, otherwise * added. * - * @param $varGroup Variable group to use + * @param $variableGroup Variable group to use * @param $variableName Variable to set * @param $value Value to set * @return void */ - protected function setVariable ($varGroup, $variableName, $value) { + protected function setVariable ($variableGroup, $variableName, $value) { // Replace all dashes to underscores to match variables with configuration entries $variableName = trim($this->convertDashesToUnderscores($variableName)); @@ -425,13 +425,13 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Is the variable set? if ($index === FALSE) { // Is the stack there? - if (!isset($this->varStack[$varGroup])) { + if (!isset($this->varStack[$variableGroup])) { // Then initialize it here - $this->varStack[$varGroup] = array(); + $this->varStack[$variableGroup] = array(); } // END - if // Not found, add it - array_push($this->varStack[$varGroup], $this->generateVariableArray($variableName, $value)); + array_push($this->varStack[$variableGroup], $this->generateVariableArray($variableName, $value)); } else { // Then modify it $this->setVariableValue($this->currGroup, $index, $value); @@ -742,20 +742,20 @@ class BaseTemplateEngine extends BaseFrameworkSystem { * Try to assign an extracted template variable as a "content" or 'config' * variable. * - * @param $varName The variable's name (shall be content or config) + * @param $variableName The variable's name (shall be content or config) * by default * @param $variableName The variable we want to assign * @return void */ - private function assignTemplateVariable ($varName, $var) { + private function assignTemplateVariable ($variableName, $var) { // Replace all dashes to underscores to match variables with configuration entries $variableName = trim($this->convertDashesToUnderscores($variableName)); // Debug message - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: varName=' . $varName . ',variableName=' . $variableName); + //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: variableName=' . $variableName . ',variableName=' . $variableName); // Is it not a config variable? - if ($varName != 'config') { + if ($variableName != 'config') { // Regular template variables $this->assignVariable($variableName, ''); } else { @@ -785,12 +785,12 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // Initialize all missing variables foreach ($variableMatches[3] as $key => $var) { // Variable name - $varName = $variableMatches[1][$key]; + $variableName = $variableMatches[1][$key]; // Workarround: Do not assign empty variables if (!empty($var)) { // Try to assign it, empty strings are being ignored - $this->assignTemplateVariable($varName, $var); + $this->assignTemplateVariable($variableName, $var); } // END - if } // END - foreach } // END - if @@ -1508,10 +1508,10 @@ class BaseTemplateEngine extends BaseFrameworkSystem { /** * Getter for variable group array * - * @return $vargroups All variable groups + * @return $variableGroups All variable groups */ public final function getVariableGroups () { - return $this->varGroups; + return $this->variableGroups; } /** -- 2.30.2