Fixed to conform to coding standards

This commit is contained in:
Chris Gray 2014-01-17 00:46:39 -06:00
parent 78974dee1b
commit 415e642351
2 changed files with 4 additions and 3 deletions

View File

@ -226,7 +226,7 @@ class Context
} elseif ($variableName == '@key') {
$current = $this->lastKey();
} elseif ($variableName[0] == "'" || $variableName[0] == '"') {
if ($variableName[0] == substr($variableName, -1) && strlen($variableName) > 2){
if ($variableName[0] == substr($variableName, -1) && strlen($variableName) > 2) {
$current = substr($variableName, 1, strlen($variableName) -2);
} else {
throw new \RuntimeException("Malformed string: ".$variableName);

View File

@ -424,11 +424,12 @@ class Template
/**
* Break an argument string into an array of strings
*
* @param string $string Argument String as passed to a helper
* @param string $string Argument String as passed to a helper
*
* @return array the argument list as an array
*/
public function parseArguments($string){
public function parseArguments($string)
{
$parts = array();
preg_match_all('#(?<!\\\\)("|\')(?:[^\\\\]|\\\\.)*?\1|\S+#s', $string, $parts);
$parts = isset($parts[0])?$parts[0]:array();