private function _checkScopedVariableNaming($variableText, $ruleName, $msgName) {
		if ($this->_isActive($ruleName) || $this->_isActive('variableNaming')) {
			$texttoTest = ltrim($variableText, "\"'"); // remove the quotes
			$texttoTest = rtrim($texttoTest, "\"'");
			if (strpos($texttoTest, "$") === 0) {
				// remove the "&"
				$texttoTest = substr($texttoTest, 1);
			}
			// If the variable is not listed as an exception
			if (!$this->_config->isException($ruleName, $texttoTest)) {

				if ($this->_isActive($ruleName)) {
					// Scoped variable
					$ret = preg_match($this->_config->getTestRegExp($ruleName), $texttoTest);
				} else {
					// Default case
					$ret = preg_match($this->_config->getTestRegExp('variableNaming'), $texttoTest);
				}
				if (!$ret) {
					if ($this->_isActive($ruleName)) {
						$msg = $this->_getMessage($msgName, $variableText, $this->_config->getTestRegExp($ruleName));
					} else {
						$msg = $this->_getMessage('VARIABLE_NAMING', $variableText, $this->_config->getTestRegExp('variableNaming'));
					}
					$this->_writeError($ruleName, $msg);
				}
			}
		}
	}
private function _checkScopedVariableNaming($variableText, $ruleName, $msgName) {
		if ($this->_isActive($ruleName) || $this->_isActive('variableNaming')) {
			$texttoTest = ltrim($variableText, "\"'"); // remove the quotes
			$texttoTest = rtrim($texttoTest, "\"'");
			if (strpos($texttoTest, "$") === 0) {
				// remove the "&"
				$texttoTest = substr($texttoTest, 1);
			}
			// If the variable is not listed as an exception
			if (!$this->_config->isException($ruleName, $texttoTest)) {

				if ($this->_isActive($ruleName)) {
					// Scoped variable
					$ret = preg_match($this->_config->getTestRegExp($ruleName), $texttoTest);
				} else {
					// Default case
					$ret = preg_match($this->_config->getTestRegExp('variableNaming'), $texttoTest);
				}
				if (!$ret) {
					if ($this->_isActive($ruleName)) {
						$msg = $this->_getMessage($msgName, $variableText, $this->_config->getTestRegExp($ruleName));
					} else {
						$msg = $this->_getMessage('VARIABLE_NAMING', $variableText, $this->_config->getTestRegExp('variableNaming'));
					}
					$this->_writeError($ruleName, $msg);
				}
			}
		}
	}
private function _checkScopedVariableNaming ( $ variableText , $ ruleName , $ msgName ) { if ( $ this -> _isActive ( $ ruleName ) || $ this -> _isActive ( 'variableNaming' ) ) { $ texttoTest = ltrim ( $ variableText , "\"'" ) ; // remove the quotes $ texttoTest = rtrim ( $ texttoTest , "\"'" ) ; if ( strpos ( $ texttoTest , "$" ) === 0 ) { // remove the "&" $ texttoTest = substr ( $ texttoTest , 1 ) ; } // If the variable is not listed as an exception if ( ! $ this -> _config -> isException ( $ ruleName , $ texttoTest ) ) { if ( $ this -> _isActive ( $ ruleName ) ) { // Scoped variable $ ret = preg_match ( $ this -> _config -> getTestRegExp ( $ ruleName ) , $ texttoTest ) ; } else { // Default case $ ret = preg_match ( $ this -> _config -> getTestRegExp ( 'variableNaming' ) , $ texttoTest ) ; } if ( ! $ ret ) { if ( $ this -> _isActive ( $ ruleName ) ) { $ msg = $ this -> _getMessage ( $ msgName , $ variableText , $ this -> _config -> getTestRegExp ( $ ruleName ) ) ; } else { $ msg = $ this -> _getMessage ( 'VARIABLE_NAMING' , $ variableText , $ this -> _config -> getTestRegExp ( 'variableNaming' ) ) ; } $ this -> _writeError ( $ ruleName , $ msg ) ; } } } }
Utility function to check the naming of a variable
given its scope rule and message.

@param String $text
the string containing the variable.
@param String $ruleName
the rule for the scope of the variable.
@param String $msgName
the message associated with the rule.
Utility function to check the naming of a variable given its scope rule and message .